Completed
Pull Request — release-2.1 (#4272)
by Mert
08:21
created
Themes/default/Packages.template.php 1 patch
Braces   +144 added lines, -104 removed lines patch added patch discarded remove patch
@@ -31,12 +31,13 @@  discard block
 block discarded – undo
31 31
 		</div>
32 32
 		<div class="information">';
33 33
 
34
-	if ($context['is_installed'])
35
-		echo '
34
+	if ($context['is_installed']) {
35
+			echo '
36 36
 			<strong>', $txt['package_installed_warning1'], '</strong><br>
37 37
 			<br>
38 38
 			', $txt['package_installed_warning2'], '<br>
39 39
 			<br>';
40
+	}
40 41
 
41 42
 	echo $txt['package_installed_warning3'], '
42 43
 		</div><br>';
@@ -63,8 +64,9 @@  discard block
 block discarded – undo
63 64
 				', $context['package_readme'], '
64 65
 				<span class="floatright">', $txt['package_available_readme_language'], '
65 66
 					<select name="readme_language" id="readme_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=', $context['uninstalling'] ? 'uninstall' : 'install', ';package=', $context['filename'], ';readme=\' + this.options[this.selectedIndex].value + \';license=\' + get_selected(\'license_language\'));">';
66
-						foreach ($context['readmes'] as $a => $b)
67
-							echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>';
67
+						foreach ($context['readmes'] as $a => $b) {
68
+													echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_readme_default'] : ucfirst($b), '</option>';
69
+						}
68 70
 			echo '
69 71
 					</select>
70 72
 				</span>
@@ -83,8 +85,9 @@  discard block
 block discarded – undo
83 85
 				', $context['package_license'], '
84 86
 				<span class="floatright">', $txt['package_available_license_language'], '
85 87
 					<select name="license_language" id="license_language" onchange="if (this.options[this.selectedIndex].value) window.location.href = smf_prepareScriptUrl(smf_scripturl + \'', '?action=admin;area=packages;sa=install', ';package=', $context['filename'], ';license=\' + this.options[this.selectedIndex].value + \';readme=\' + get_selected(\'readme_language\'));">';
86
-						foreach ($context['licenses'] as $a => $b)
87
-							echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>';
88
+						foreach ($context['licenses'] as $a => $b) {
89
+													echo '<option value="', $b, '"', $a === 'selected' ? ' selected' : '', '>', $b == 'default' ? $txt['package_license_default'] : ucfirst($b), '</option>';
90
+						}
88 91
 			echo '
89 92
 					</select>
90 93
 				</span>
@@ -111,9 +114,10 @@  discard block
 block discarded – undo
111 114
 					', $txt['package_db_uninstall_actions'], ':
112 115
 					<ul>';
113 116
 
114
-		foreach ($context['database_changes'] as $change)
115
-			echo '
117
+		foreach ($context['database_changes'] as $change) {
118
+					echo '
116 119
 						<li>', $change, '</li>';
120
+		}
117 121
 		echo '
118 122
 					</ul>
119 123
 				</div>
@@ -123,14 +127,14 @@  discard block
 block discarded – undo
123 127
 	echo '
124 128
 			<div class="information">';
125 129
 
126
-	if (empty($context['actions']) && empty($context['database_changes']))
127
-		echo '
130
+	if (empty($context['actions']) && empty($context['database_changes'])) {
131
+			echo '
128 132
 				<br>
129 133
 				<div class="errorbox">
130 134
 					', $txt['corrupt_compatible'], '
131 135
 				</div>
132 136
 			</div>';
133
-	else
137
+	} else
134 138
 	{
135 139
 		echo '
136 140
 					', $txt['perform_actions'], '
@@ -230,9 +234,10 @@  discard block
 block discarded – undo
230 234
 					<tr class="title_bar">
231 235
 						<td></td>
232 236
 						<td>';
233
-				if (!empty($context['themes_locked']))
234
-					echo '
237
+				if (!empty($context['themes_locked'])) {
238
+									echo '
235 239
 							<input type="hidden" name="custom_theme[]" value="', $id, '">';
240
+				}
236 241
 				echo '
237 242
 							<input type="checkbox" name="custom_theme[]" id="custom_theme_', $id, '" value="', $id, '" onclick="', (!empty($theme['has_failure']) ? 'if (this.form.custom_theme_' . $id . '.checked && !confirm(\'' . $txt['package_theme_failure_warning'] . '\')) return false;' : ''), 'invertAll(this, this.form, \'dummy_theme_', $id, '\', true);"', !empty($context['themes_locked']) ? ' disabled checked' : '', '>
238 243
 						</td>
@@ -373,14 +378,15 @@  discard block
 block discarded – undo
373 378
 	</script>';
374 379
 
375 380
 	// And a bit more for database changes.
376
-	if (!empty($context['database_changes']))
377
-		echo '
381
+	if (!empty($context['database_changes'])) {
382
+			echo '
378 383
 	<script>
379 384
 		var database_changes_area = document.getElementById(\'db_changes_div\');
380 385
 		var db_vis = false;
381 386
 		database_changes_area.style.display = "none";
382 387
 	</script>';
383
-}
388
+	}
389
+	}
384 390
 
385 391
 /**
386 392
  * Extract package contents
@@ -412,12 +418,12 @@  discard block
 block discarded – undo
412 418
 				<h3 class="catbg">', $context['uninstalling'] ? $txt['uninstall'] : $txt['extracting'], '</h3>
413 419
 			</div>
414 420
 			<div class="information">', $txt['package_installed_extract'], '</div>';
415
-	}
416
-	else
417
-		echo '
421
+	} else {
422
+			echo '
418 423
 			<div class="cat_bar">
419 424
 				<h3 class="catbg">', $txt['package_installed_redirecting'], '</h3>
420 425
 			</div>';
426
+	}
421 427
 
422 428
 	echo '
423 429
 		<div class="windowbg">';
@@ -428,25 +434,25 @@  discard block
 block discarded – undo
428 434
 		echo '
429 435
 			', $context['redirect_text'], '<br><br>
430 436
 			<a href="', $context['redirect_url'], '">', $txt['package_installed_redirect_go_now'], '</a> | <a href="', $scripturl, '?action=admin;area=packages;sa=browse">', $txt['package_installed_redirect_cancel'], '</a>';
431
-	}
432
-	elseif ($context['uninstalling'])
433
-		echo '
437
+	} elseif ($context['uninstalling']) {
438
+			echo '
434 439
 			', $txt['package_uninstall_done'];
435
-	elseif ($context['install_finished'])
440
+	} elseif ($context['install_finished'])
436 441
 	{
437
-		if ($context['extract_type'] == 'avatar')
438
-			echo '
442
+		if ($context['extract_type'] == 'avatar') {
443
+					echo '
439 444
 				', $txt['avatars_extracted'];
440
-		elseif ($context['extract_type'] == 'language')
441
-			echo '
445
+		} elseif ($context['extract_type'] == 'language') {
446
+					echo '
442 447
 				', $txt['language_extracted'];
443
-		else
444
-			echo '
448
+		} else {
449
+					echo '
445 450
 				', $txt['package_installed_done'];
446
-	}
447
-	else
448
-		echo '
451
+		}
452
+	} else {
453
+			echo '
449 454
 			', $txt['corrupt_compatible'];
455
+	}
450 456
 
451 457
 	echo '
452 458
 		</div>';
@@ -480,9 +486,10 @@  discard block
 block discarded – undo
480 486
 		<div class="windowbg">
481 487
 			<ol>';
482 488
 
483
-	foreach ($context['files'] as $fileinfo)
484
-		echo '
489
+	foreach ($context['files'] as $fileinfo) {
490
+			echo '
485 491
 				<li><a href="', $scripturl, '?action=admin;area=packages;sa=examine;package=', $context['filename'], ';file=', $fileinfo['filename'], '" title="', $txt['view'], '">', $fileinfo['filename'], '</a> (', $fileinfo['size'], ' ', $txt['package_bytes'], ')</li>';
492
+	}
486 493
 
487 494
 	echo '
488 495
 			</ol>
@@ -546,9 +553,10 @@  discard block
 block discarded – undo
546 553
 			</script>
547 554
 			<div id="yourVersion" style="display:none">', $context['forum_version'], '</div>';
548 555
 
549
-	if (empty($modSettings['disable_smf_js']))
550
-		echo '
556
+	if (empty($modSettings['disable_smf_js'])) {
557
+			echo '
551 558
 			<script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
559
+	}
552 560
 
553 561
 	// This sets the announcements and current versions themselves ;).
554 562
 	echo '
@@ -587,12 +595,13 @@  discard block
 block discarded – undo
587 595
 		}
588 596
 	}
589 597
 
590
-	if (!$mods_available)
591
-		echo '
598
+	if (!$mods_available) {
599
+			echo '
592 600
 		<div class="noticebox">', $txt['no_packages'], '</div>';
593
-	else
594
-		echo '
601
+	} else {
602
+			echo '
595 603
 		<br>';
604
+	}
596 605
 
597 606
 	// the advanced (emulation) box, collapsed by default
598 607
 	echo '
@@ -681,11 +690,12 @@  discard block
 block discarded – undo
681 690
 {
682 691
 	global $context, $txt, $scripturl;
683 692
 
684
-	if (!empty($context['package_ftp']['error']))
685
-			echo '
693
+	if (!empty($context['package_ftp']['error'])) {
694
+				echo '
686 695
 					<div class="errorbox">
687 696
 						<pre>', $context['package_ftp']['error'], '</pre>
688 697
 					</div>';
698
+	}
689 699
 
690 700
 	echo '
691 701
 	<div id="admin_form_wrapper">
@@ -766,13 +776,14 @@  discard block
 block discarded – undo
766 776
 				<fieldset>
767 777
 					<legend>' . $txt['package_servers'] . '</legend>
768 778
 					<ul class="package_servers">';
769
-	foreach ($context['servers'] as $server)
770
-		echo '
779
+	foreach ($context['servers'] as $server) {
780
+			echo '
771 781
 						<li class="flow_auto">
772 782
 							<span class="floatleft">' . $server['name'] . '</span>
773 783
 							<span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=remove;server=' . $server['id'] . ';', $context['session_var'], '=', $context['session_id'], '">[ ' . $txt['delete'] . ' ]</a></span>
774 784
 							<span class="package_server floatright"><a href="' . $scripturl . '?action=admin;area=packages;get;sa=browse;server=' . $server['id'] . '">[ ' . $txt['package_browse'] . ' ]</a></span>
775 785
 						</li>';
786
+	}
776 787
 	echo '
777 788
 					</ul>
778 789
 				</fieldset>
@@ -859,11 +870,12 @@  discard block
 block discarded – undo
859 870
 		<div class="windowbg2">';
860 871
 
861 872
 	// No packages, as yet.
862
-	if (empty($context['package_list']))
863
-		echo '
873
+	if (empty($context['package_list'])) {
874
+			echo '
864 875
 			<ul>
865 876
 				<li>', $txt['no_packages'], '</li>
866 877
 			</ul>';
878
+	}
867 879
 	// List out the packages...
868 880
 	else
869 881
 	{
@@ -875,11 +887,12 @@  discard block
 block discarded – undo
875 887
 				<li>
876 888
 					<strong><span id="ps_img_', $i, '" class="toggle_up" alt="*" style="display: none;"></span> ', $packageSection['title'], '</strong>';
877 889
 
878
-			if (!empty($packageSection['text']))
879
-				echo '
890
+			if (!empty($packageSection['text'])) {
891
+							echo '
880 892
 					<div class="sub_bar">
881 893
 						<h3 class="subbg">', $packageSection['text'], '</h3>
882 894
 					</div>';
895
+			}
883 896
 
884 897
 			echo '
885 898
 					<', $context['list_type'], ' id="package_section_', $i, '" class="packages">';
@@ -889,13 +902,15 @@  discard block
 block discarded – undo
889 902
 				echo '
890 903
 						<li>';
891 904
 				// Textual message. Could be empty just for a blank line...
892
-				if ($package['is_text'])
893
-					echo '
905
+				if ($package['is_text']) {
906
+									echo '
894 907
 							', empty($package['name']) ? '&nbsp;' : $package['name'];
908
+				}
895 909
 				// This is supposed to be a rule..
896
-				elseif ($package['is_line'])
897
-					echo '
910
+				elseif ($package['is_line']) {
911
+									echo '
898 912
 						<hr>';
913
+				}
899 914
 				// A remote link.
900 915
 				elseif ($package['is_remote'])
901 916
 				{
@@ -917,21 +932,25 @@  discard block
 block discarded – undo
917 932
 						<ul id="package_section_', $i, '_pkg_', $id, '" class="package_section">';
918 933
 
919 934
 					// Show the mod type?
920
-					if ($package['type'] != '')
921
-						echo '
935
+					if ($package['type'] != '') {
936
+											echo '
922 937
 							<li class="package_section">', $txt['package_type'], ':&nbsp; ', $smcFunc['ucwords']($smcFunc['strtolower']($package['type'])), '</li>';
938
+					}
923 939
 					// Show the version number?
924
-					if ($package['version'] != '')
925
-						echo '
940
+					if ($package['version'] != '') {
941
+											echo '
926 942
 							<li class="package_section">', $txt['mod_version'], ':&nbsp; ', $package['version'], '</li>';
943
+					}
927 944
 					// How 'bout the author?
928
-					if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link']))
929
-						echo '
945
+					if (!empty($package['author']) && $package['author']['name'] != '' && isset($package['author']['link'])) {
946
+											echo '
930 947
 							<li class="package_section">', $txt['mod_author'], ':&nbsp; ', $package['author']['link'], '</li>';
948
+					}
931 949
 					// The homepage....
932
-					if ($package['author']['website']['link'] != '')
933
-						echo '
950
+					if ($package['author']['website']['link'] != '') {
951
+											echo '
934 952
 							<li class="package_section">', $txt['author_website'], ':&nbsp; ', $package['author']['website']['link'], '</li>';
953
+					}
935 954
 
936 955
 					// Desciption: bleh bleh!
937 956
 					// Location of file: http://someplace/.
@@ -984,8 +1003,8 @@  discard block
 block discarded – undo
984 1003
 
985 1004
 				foreach ($ps['items'] as $id => $package)
986 1005
 				{
987
-					if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote'])
988
-						echo '
1006
+					if (!$package['is_text'] && !$package['is_line'] && !$package['is_remote']) {
1007
+											echo '
989 1008
 				var oPackageToggle_', $section, '_pkg_', $id, ' = new smc_Toggle({
990 1009
 					bToggleEnabled: true,
991 1010
 					bCurrentlyCollapsed: true,
@@ -1000,6 +1019,7 @@  discard block
 block discarded – undo
1000 1019
 						}
1001 1020
 					]
1002 1021
 				});';
1022
+					}
1003 1023
 				}
1004 1024
 			}
1005 1025
 			echo '
@@ -1040,9 +1060,10 @@  discard block
 block discarded – undo
1040 1060
 {
1041 1061
 	global $context, $txt, $scripturl;
1042 1062
 
1043
-	if (!empty($context['saved_successful']))
1044
-		echo '
1063
+	if (!empty($context['saved_successful'])) {
1064
+			echo '
1045 1065
 	<div class="infobox">', $txt['settings_saved'], '</div>';
1066
+	}
1046 1067
 
1047 1068
 	echo '
1048 1069
 	<div id="admincenter">
@@ -1104,8 +1125,9 @@  discard block
 block discarded – undo
1104 1125
 	global $context, $txt;
1105 1126
 
1106 1127
 	// Nothing to do? Brilliant!
1107
-	if (empty($context['package_ftp']))
1108
-		return false;
1128
+	if (empty($context['package_ftp'])) {
1129
+			return false;
1130
+	}
1109 1131
 
1110 1132
 	if (empty($context['package_ftp']['form_elements_only']))
1111 1133
 	{
@@ -1114,19 +1136,21 @@  discard block
 block discarded – undo
1114 1136
 				<div id="need_writable_list" class="smalltext">
1115 1137
 					', $txt['package_ftp_why_file_list'], '
1116 1138
 					<ul style="display: inline;">';
1117
-		if (!empty($context['notwritable_files']))
1118
-			foreach ($context['notwritable_files'] as $file)
1139
+		if (!empty($context['notwritable_files'])) {
1140
+					foreach ($context['notwritable_files'] as $file)
1119 1141
 				echo '
1120 1142
 						<li>', $file, '</li>';
1143
+		}
1121 1144
 
1122 1145
 		echo '
1123 1146
 					</ul>';
1124 1147
 
1125
-		if (!$context['server']['is_windows'])
1126
-			echo '
1148
+		if (!$context['server']['is_windows']) {
1149
+					echo '
1127 1150
 				<hr>
1128 1151
 				', $txt['package_chmod_linux'], '<br>
1129 1152
 				<tt># chmod a+w ', implode(' ', $context['notwritable_files']), '</tt>';
1153
+		}
1130 1154
 
1131 1155
 		echo '
1132 1156
 				</div>';
@@ -1137,9 +1161,10 @@  discard block
 block discarded – undo
1137 1161
 					<tt id="ftp_error_message">', !empty($context['package_ftp']['error']) ? $context['package_ftp']['error'] : '', '</tt>
1138 1162
 				</div></div>';
1139 1163
 
1140
-	if (!empty($context['package_ftp']['destination']))
1141
-		echo '
1164
+	if (!empty($context['package_ftp']['destination'])) {
1165
+			echo '
1142 1166
 				<form action="', $context['package_ftp']['destination'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">';
1167
+	}
1143 1168
 
1144 1169
 	echo '
1145 1170
 					<fieldset>
@@ -1172,25 +1197,28 @@  discard block
 block discarded – undo
1172 1197
 					</dl>
1173 1198
 					</fieldset>';
1174 1199
 
1175
-	if (empty($context['package_ftp']['form_elements_only']))
1176
-		echo '
1200
+	if (empty($context['package_ftp']['form_elements_only'])) {
1201
+			echo '
1177 1202
 
1178 1203
 					<div class="righttext" style="margin: 1ex;">
1179 1204
 						<span id="test_ftp_placeholder_full"></span>
1180 1205
 						<input type="submit" value="', $txt['package_proceed'], '" class="button">
1181 1206
 					</div>';
1207
+	}
1182 1208
 
1183
-	if (!empty($context['package_ftp']['destination']))
1184
-		echo '
1209
+	if (!empty($context['package_ftp']['destination'])) {
1210
+			echo '
1185 1211
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1186 1212
 				</form>';
1213
+	}
1187 1214
 
1188 1215
 	// Hide the details of the list.
1189
-	if (empty($context['package_ftp']['form_elements_only']))
1190
-		echo '
1216
+	if (empty($context['package_ftp']['form_elements_only'])) {
1217
+			echo '
1191 1218
 		<script>
1192 1219
 			document.getElementById(\'need_writable_list\').style.display = \'none\';
1193 1220
 		</script>';
1221
+	}
1194 1222
 
1195 1223
 	// Quick generate the test button.
1196 1224
 	echo '
@@ -1546,9 +1574,10 @@  discard block
 block discarded – undo
1546 1574
 				<tr class="windowbg">
1547 1575
 					<td width="30%"><strong>';
1548 1576
 
1549
-				if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive'))
1550
-					echo '
1577
+				if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) {
1578
+									echo '
1551 1579
 						<span class="generic_icons folder"></span>';
1580
+				}
1552 1581
 
1553 1582
 				echo '
1554 1583
 						', $name, '
@@ -1565,8 +1594,9 @@  discard block
 block discarded – undo
1565 1594
 				</tr>
1566 1595
 			';
1567 1596
 
1568
-		if (!empty($dir['contents']))
1569
-			template_permission_show_contents($name, $dir['contents'], 1);
1597
+		if (!empty($dir['contents'])) {
1598
+					template_permission_show_contents($name, $dir['contents'], 1);
1599
+		}
1570 1600
 	}
1571 1601
 
1572 1602
 	echo '
@@ -1602,13 +1632,14 @@  discard block
 block discarded – undo
1602 1632
 			</fieldset>';
1603 1633
 
1604 1634
 	// Likely to need FTP?
1605
-	if (empty($context['ftp_connected']))
1606
-		echo '
1635
+	if (empty($context['ftp_connected'])) {
1636
+			echo '
1607 1637
 			<p>
1608 1638
 				', $txt['package_file_perms_ftp_details'], ':
1609 1639
 			</p>
1610 1640
 			', template_control_chmod(), '
1611 1641
 			<div class="noticebox">', $txt['package_file_perms_ftp_retain'], '</div>';
1642
+	}
1612 1643
 
1613 1644
 	echo '
1614 1645
 			<span id="test_ftp_placeholder_full"></span>
@@ -1617,9 +1648,10 @@  discard block
 block discarded – undo
1617 1648
 		</div>';
1618 1649
 
1619 1650
 	// Any looks fors we've already done?
1620
-	foreach ($context['look_for'] as $path)
1621
-		echo '
1651
+	foreach ($context['look_for'] as $path) {
1652
+			echo '
1622 1653
 			<input type="hidden" name="back_look[]" value="', $path, '">';
1654
+	}
1623 1655
 	echo '
1624 1656
 	</form><br>';
1625 1657
 }
@@ -1658,9 +1690,10 @@  discard block
 block discarded – undo
1658 1690
 				<td class="smalltext" width="30%">' . str_repeat('&nbsp;', $level * 5), '
1659 1691
 					', (!empty($dir['type']) && $dir['type'] == 'dir_recursive') || !empty($dir['list_contents']) ? '<a id="link_' . $cur_ident . '" href="' . $scripturl . '?action=admin;area=packages;sa=perms;find=' . base64_encode($ident . '/' . $name) . ';back_look=' . $context['back_look_data'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '#fol_' . $cur_ident . '" onclick="return expandFolder(\'' . $cur_ident . '\', \'' . addcslashes($ident . '/' . $name, "'\\") . '\');">' : '';
1660 1692
 
1661
-			if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive'))
1662
-				echo '
1693
+			if (!empty($dir['type']) && ($dir['type'] == 'dir' || $dir['type'] == 'dir_recursive')) {
1694
+							echo '
1663 1695
 						<span class="generic_icons folder"></span>';
1696
+			}
1664 1697
 
1665 1698
 			echo '
1666 1699
 					', $name, '
@@ -1686,14 +1719,15 @@  discard block
 block discarded – undo
1686 1719
 	}
1687 1720
 
1688 1721
 	// We have more files to show?
1689
-	if ($has_more)
1690
-		echo '
1722
+	if ($has_more) {
1723
+			echo '
1691 1724
 	<tr class="windowbg" id="content_', $js_ident, '_more">
1692 1725
 		<td class="smalltext" width="40%">' . str_repeat('&nbsp;', $level * 5), '
1693 1726
 			&#171; <a href="' . $scripturl . '?action=admin;area=packages;sa=perms;find=' . base64_encode($ident) . ';fileoffset=', ($context['file_offset'] + $context['file_limit']), ';' . $context['session_var'] . '=' . $context['session_id'] . '#fol_' . preg_replace('~[^A-Za-z0-9_\-=:]~', ':-:', $ident) . '">', $txt['package_file_perms_more_files'], '</a> &#187;
1694 1727
 		</td>
1695 1728
 		<td colspan="6"></td>
1696 1729
 	</tr>';
1730
+	}
1697 1731
 
1698 1732
 	if ($drawn_div)
1699 1733
 	{
@@ -1701,15 +1735,17 @@  discard block
 block discarded – undo
1701 1735
 		$isFound = false;
1702 1736
 		foreach ($context['look_for'] as $tree)
1703 1737
 		{
1704
-			if (substr($tree, 0, strlen($ident)) == $ident)
1705
-				$isFound = true;
1738
+			if (substr($tree, 0, strlen($ident)) == $ident) {
1739
+							$isFound = true;
1740
+			}
1706 1741
 		}
1707 1742
 
1708
-		if ($level > 1 && !$isFound)
1709
-			echo '
1743
+		if ($level > 1 && !$isFound) {
1744
+					echo '
1710 1745
 		<script>
1711 1746
 			expandFolder(\'', $js_ident, '\', \'\');
1712 1747
 		</script>';
1748
+		}
1713 1749
 	}
1714 1750
 }
1715 1751
 
@@ -1729,11 +1765,12 @@  discard block
 block discarded – undo
1729 1765
 				<h3 class="catbg">', $txt['package_file_perms_applying'], '</h3>
1730 1766
 			</div>';
1731 1767
 
1732
-	if (!empty($context['skip_ftp']))
1733
-		echo '
1768
+	if (!empty($context['skip_ftp'])) {
1769
+			echo '
1734 1770
 			<div class="errorbox">
1735 1771
 				', $txt['package_file_perms_skipping_ftp'], '
1736 1772
 			</div>';
1773
+	}
1737 1774
 
1738 1775
 	// How many have we done?
1739 1776
 	$remaining_items = count($context['method'] == 'individual' ? $context['to_process'] : $context['directory_list']);
@@ -1771,28 +1808,31 @@  discard block
 block discarded – undo
1771 1808
 				<br>';
1772 1809
 
1773 1810
 	// Put out the right hidden data.
1774
-	if ($context['method'] == 'individual')
1775
-		echo '
1811
+	if ($context['method'] == 'individual') {
1812
+			echo '
1776 1813
 				<input type="hidden" name="custom_value" value="', $context['custom_value'], '">
1777 1814
 				<input type="hidden" name="totalItems" value="', $context['total_items'], '">
1778 1815
 				<input type="hidden" name="toProcess" value="', $context['to_process_encode'], '">';
1779
-	else
1780
-		echo '
1816
+	} else {
1817
+			echo '
1781 1818
 				<input type="hidden" name="predefined" value="', $context['predefined_type'], '">
1782 1819
 				<input type="hidden" name="fileOffset" value="', $context['file_offset'], '">
1783 1820
 				<input type="hidden" name="totalItems" value="', $context['total_items'], '">
1784 1821
 				<input type="hidden" name="dirList" value="', $context['directory_list_encode'], '">
1785 1822
 				<input type="hidden" name="specialFiles" value="', $context['special_files_encode'], '">';
1823
+	}
1786 1824
 
1787 1825
 	// Are we not using FTP for whatever reason.
1788
-	if (!empty($context['skip_ftp']))
1789
-		echo '
1826
+	if (!empty($context['skip_ftp'])) {
1827
+			echo '
1790 1828
 				<input type="hidden" name="skip_ftp" value="1">';
1829
+	}
1791 1830
 
1792 1831
 	// Retain state.
1793
-	foreach ($context['back_look_data'] as $path)
1794
-		echo '
1832
+	foreach ($context['back_look_data'] as $path) {
1833
+			echo '
1795 1834
 				<input type="hidden" name="back_look[]" value="', $path, '">';
1835
+	}
1796 1836
 
1797 1837
 	echo '
1798 1838
 				<input type="hidden" name="method" value="', $context['method'], '">
Please login to merge, or discard this patch.
Themes/default/ModerationCenter.template.php 1 patch
Braces   +56 added lines, -39 removed lines patch added patch discarded remove patch
@@ -55,18 +55,20 @@  discard block
 block discarded – undo
55 55
 			<div class="modbox">
56 56
 				<ul>';
57 57
 
58
-		foreach ($context['group_requests'] as $request)
59
-			echo '
58
+		foreach ($context['group_requests'] as $request) {
59
+					echo '
60 60
 				<li class="smalltext">
61 61
 					<a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], '
62 62
 				</li>';
63
+		}
63 64
 
64 65
 		// Don't have any watched users right now?
65
-		if (empty($context['group_requests']))
66
-			echo '
66
+		if (empty($context['group_requests'])) {
67
+					echo '
67 68
 				<li>
68 69
 					<strong class="smalltext">', $txt['mc_group_requests_none'], '</strong>
69 70
 				</li>';
71
+		}
70 72
 
71 73
 		echo '
72 74
 				</ul>
@@ -124,18 +126,20 @@  discard block
 block discarded – undo
124 126
 			<div class="modbox">
125 127
 				<ul>';
126 128
 
127
-		foreach ($context['watched_users'] as $user)
128
-			echo '
129
+		foreach ($context['watched_users'] as $user) {
130
+					echo '
129 131
 					<li>
130 132
 						<span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span>
131 133
 					</li>';
134
+		}
132 135
 
133 136
 		// Don't have any watched users right now?
134
-		if (empty($context['watched_users']))
135
-			echo '
137
+		if (empty($context['watched_users'])) {
138
+					echo '
136 139
 					<li>
137 140
 						<strong class="smalltext">', $txt['mc_watched_users_none'], '</strong>
138 141
 					</li>';
142
+		}
139 143
 
140 144
 		echo '
141 145
 				</ul>
@@ -193,18 +197,20 @@  discard block
 block discarded – undo
193 197
 			<div class="modbox">
194 198
 				<ul>';
195 199
 
196
-		foreach ($context['reported_posts'] as $post)
197
-			echo '
200
+		foreach ($context['reported_posts'] as $post) {
201
+					echo '
198 202
 					<li>
199 203
 						<span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span>
200 204
 					</li>';
205
+		}
201 206
 
202 207
 		// Don't have any watched users right now?
203
-		if (empty($context['reported_posts']))
204
-			echo '
208
+		if (empty($context['reported_posts'])) {
209
+					echo '
205 210
 					<li>
206 211
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
207 212
 					</li>';
213
+		}
208 214
 
209 215
 		echo '
210 216
 				</ul>
@@ -262,18 +268,20 @@  discard block
 block discarded – undo
262 268
 			<div class="modbox">
263 269
 				<ul>';
264 270
 
265
-		foreach ($context['reported_users'] as $user)
266
-			echo '
271
+		foreach ($context['reported_users'] as $user) {
272
+					echo '
267 273
 					<li>
268 274
 						<span class="smalltext">', $user['user']['link'], '</span>
269 275
 					</li>';
276
+		}
270 277
 
271 278
 		// Don't have any watched users right now?
272
-		if (empty($context['reported_users']))
273
-			echo '
279
+		if (empty($context['reported_users'])) {
280
+					echo '
274 281
 					<li>
275 282
 						<strong class="smalltext">', $txt['mc_reported_users_none'], '</strong>
276 283
 					</li>';
284
+		}
277 285
 
278 286
 		echo '
279 287
 				</ul>
@@ -344,9 +352,10 @@  discard block
 block discarded – undo
344 352
 						<ul class="moderation_notes">';
345 353
 
346 354
 			// Cycle through the notes.
347
-			foreach ($context['notes'] as $note)
348
-				echo '
355
+			foreach ($context['notes'] as $note) {
356
+							echo '
349 357
 							<li class="smalltext">', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
358
+			}
350 359
 
351 360
 			echo '
352 361
 						</ul>
@@ -388,16 +397,17 @@  discard block
 block discarded – undo
388 397
 	$remove_button = create_button('delete', 'remove_message', 'remove');
389 398
 
390 399
 	// No posts?
391
-	if (empty($context['unapproved_items']))
392
-		echo '
400
+	if (empty($context['unapproved_items'])) {
401
+			echo '
393 402
 		<div class="windowbg2">
394 403
 			<p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p>
395 404
 		</div>';
396
-	else
397
-		echo '
405
+	} else {
406
+			echo '
398 407
 			<div class="pagesection floatleft">
399 408
 				', $context['page_index'], '
400 409
 			</div>';
410
+	}
401 411
 
402 412
 	foreach ($context['unapproved_items'] as $item)
403 413
 	{
@@ -414,14 +424,16 @@  discard block
 block discarded – undo
414 424
 			<span class="floatright">
415 425
 				<a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>';
416 426
 
417
-		if ($item['can_delete'])
418
-			echo '
427
+		if ($item['can_delete']) {
428
+					echo '
419 429
 			', $context['menu_separator'], '
420 430
 				<a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>';
431
+		}
421 432
 
422
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
423
-			echo '
433
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
434
+					echo '
424 435
 				<input type="checkbox" name="item[]" value="', $item['id'], '" checked> ';
436
+		}
425 437
 
426 438
 		echo '
427 439
 			</span>
@@ -431,8 +443,8 @@  discard block
 block discarded – undo
431 443
 	echo '
432 444
 		<div class="pagesection">';
433 445
 
434
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
435
-		echo '
446
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
447
+			echo '
436 448
 			<div class="floatright">
437 449
 				<select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
438 450
 					<option value="0">', $txt['with_selected'], ':</option>
@@ -442,12 +454,14 @@  discard block
 block discarded – undo
442 454
 				</select>
443 455
 				<noscript><input type="submit" name="mc_go" value="', $txt['go'], '" class="button"></noscript>
444 456
 			</div>';
457
+	}
445 458
 
446
-	if (!empty($context['unapproved_items']))
447
-		echo '
459
+	if (!empty($context['unapproved_items'])) {
460
+			echo '
448 461
 			<div class="floatleft">
449 462
 				<div class="pagelinks">', $context['page_index'], '</div>
450 463
 			</div>';
464
+	}
451 465
 
452 466
 	echo '
453 467
 		</div>
@@ -467,8 +481,9 @@  discard block
 block discarded – undo
467 481
 	global $scripturl, $context, $txt, $delete_button;
468 482
 
469 483
 	// We'll have a delete please bob.
470
-	if (empty($delete_button))
471
-		$delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"');
484
+	if (empty($delete_button)) {
485
+			$delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"');
486
+	}
472 487
 
473 488
 	$output_html = '
474 489
 					<div>
@@ -477,10 +492,11 @@  discard block
 block discarded – undo
477 492
 						</div>
478 493
 						<div class="floatright">';
479 494
 
480
-	if ($post['can_delete'])
481
-		$output_html .= '
495
+	if ($post['can_delete']) {
496
+			$output_html .= '
482 497
 							<a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a>
483 498
 							<input type="checkbox" name="delete[]" value="' . $post['id'] . '">';
499
+	}
484 500
 
485 501
 	$output_html .= '
486 502
 						</div>
@@ -522,12 +538,12 @@  discard block
 block discarded – undo
522 538
 				<input type="submit" name="save" value="', $txt['save'], '" class="button">
523 539
 			</div>
524 540
 		</form>';
525
-	}
526
-	else
527
-		echo '
541
+	} else {
542
+			echo '
528 543
 		<div class="windowbg">
529 544
 			<div class="centertext">', $txt['mc_no_settings'], '</div>
530 545
 		</div>';
546
+	}
531 547
 
532 548
 	echo '
533 549
 	</div>';
@@ -623,8 +639,8 @@  discard block
 block discarded – undo
623 639
 					</dd>
624 640
 				</dl>';
625 641
 
626
-	if ($context['template_data']['can_edit_personal'])
627
-		echo '
642
+	if ($context['template_data']['can_edit_personal']) {
643
+			echo '
628 644
 				<input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', '>
629 645
 					<label for="make_personal">
630 646
 						<strong>', $txt['mc_warning_template_personal'], '</strong>
@@ -632,6 +648,7 @@  discard block
 block discarded – undo
632 648
 					<br>
633 649
 					<span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span>
634 650
 					<br>';
651
+	}
635 652
 
636 653
 	echo '
637 654
 				<hr>
Please login to merge, or discard this patch.
Themes/default/ManageBoards.template.php 1 patch
Braces   +99 added lines, -68 removed lines patch added patch discarded remove patch
@@ -25,18 +25,20 @@  discard block
 block discarded – undo
25 25
 		</div>
26 26
 		<div class="windowbg2 noup">';
27 27
 
28
-	if (!empty($context['move_board']))
29
-		echo '
28
+	if (!empty($context['move_board'])) {
29
+			echo '
30 30
 		<div class="noticebox">
31 31
 			', $context['move_title'], ' [<a href="', $scripturl, '?action=admin;area=manageboards">', $txt['mboards_cancel_moving'], '</a>]', '
32 32
 		</div>';
33
+	}
33 34
 
34 35
 	// No categories so show a label.
35
-	if (empty($context['categories']))
36
-		echo '
36
+	if (empty($context['categories'])) {
37
+			echo '
37 38
 		<div class="windowbg centertext">
38 39
 			', $txt['mboards_no_cats'], '
39 40
 		</div>';
41
+	}
40 42
 
41 43
 	// Loop through every category, listing the boards in each as we go.
42 44
 	foreach ($context['categories'] as $category)
@@ -54,9 +56,10 @@  discard block
 block discarded – undo
54 56
 		<form action="', $scripturl, '?action=admin;area=manageboards;sa=newboard;cat=', $category['id'], '" method="post" accept-charset="', $context['character_set'], '">
55 57
 				<ul id="category_', $category['id'], '" class="nolist">';
56 58
 
57
-		if (!empty($category['move_link']))
58
-			echo '
59
+		if (!empty($category['move_link'])) {
60
+					echo '
59 61
 					<li><a href="', $category['move_link']['href'], '" title="', $category['move_link']['label'], '"><span class="generic_icons select_above"></span></a></li>';
62
+		}
60 63
 
61 64
 		$recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '"></a>';
62 65
 		$redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '">';
@@ -81,9 +84,10 @@  discard block
 block discarded – undo
81 84
 				echo '
82 85
 					<li class="windowbg" style="padding-', $context['right_to_left'] ? 'right' : 'left', ': ', 5 + 30 * $board['move_links'][0]['child_level'], 'px;">';
83 86
 
84
-				foreach ($board['move_links'] as $link)
85
-					echo '
87
+				foreach ($board['move_links'] as $link) {
88
+									echo '
86 89
 						<a href="', $link['href'], '" class="move_links" title="', $link['label'], '"><span class="generic_icons select_', $link['class'], '" title="', $link['label'], '"></span></a>';
90
+				}
87 91
 
88 92
 				echo '
89 93
 					</li>';
@@ -132,9 +136,10 @@  discard block
 block discarded – undo
132 136
 						<select name="cat_order">';
133 137
 
134 138
 		// Print every existing category into a select box.
135
-		foreach ($context['category_order'] as $order)
136
-			echo '
139
+		foreach ($context['category_order'] as $order) {
140
+					echo '
137 141
 							<option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>';
142
+		}
138 143
 		echo '
139 144
 						</select>
140 145
 					</dd>';
@@ -169,14 +174,15 @@  discard block
 block discarded – undo
169 174
 	{
170 175
 		foreach ($context['custom_category_settings'] as $catset_id => $catset)
171 176
 		{
172
-			if (!empty($catset['dt']) && !empty($catset['dd']))
173
-				echo '
177
+			if (!empty($catset['dt']) && !empty($catset['dd'])) {
178
+							echo '
174 179
 						<dt class="clear', !is_numeric($catset_id) ? ' catset_' . $catset_id : '', '">
175 180
 							', $catset['dt'], '
176 181
 						</dt>
177 182
 						<dd', !is_numeric($catset_id) ? ' class="catset_' . $catset_id . '"' : '', '>
178 183
 							', $catset['dd'], '
179 184
 						</dd>';
185
+			}
180 186
 		}
181 187
 	}
182 188
 
@@ -184,21 +190,23 @@  discard block
 block discarded – undo
184 190
 	echo '
185 191
 				</dl>';
186 192
 
187
-	if (isset($context['category']['is_new']))
188
-		echo '
193
+	if (isset($context['category']['is_new'])) {
194
+			echo '
189 195
 					<input type="submit" name="add" value="', $txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">';
190
-	else
191
-		echo '
196
+	} else {
197
+			echo '
192 198
 					<input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', $context['tabindex']++, '" class="button">
193 199
 					<input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" data-confirm="', $txt['catConfirm'], '" class="button you_sure">';
200
+	}
194 201
 	echo '
195 202
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
196 203
 					<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
197 204
 
198 205
 	// If this category is empty we don't bother with the next confirmation screen.
199
-	if ($context['category']['is_empty'])
200
-		echo '
206
+	if ($context['category']['is_empty']) {
207
+			echo '
201 208
 					<input type="hidden" name="empty" value="1">';
209
+	}
202 210
 
203 211
 	echo '
204 212
 			</div>
@@ -225,9 +233,10 @@  discard block
 block discarded – undo
225 233
 				<p>', $txt['mboards_delete_cat_contains'], ':</p>
226 234
 				<ul>';
227 235
 
228
-	foreach ($context['category']['children'] as $child)
229
-		echo '
236
+	foreach ($context['category']['children'] as $child) {
237
+			echo '
230 238
 					<li>', $child, '</li>';
239
+	}
231 240
 
232 241
 	echo '
233 242
 				</ul>
@@ -241,10 +250,11 @@  discard block
 block discarded – undo
241 250
 					<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', count($context['category_order']) == 1 ? ' disabled' : '', '>', $txt['mboards_delete_option2'], '</label>:
242 251
 					<select name="cat_to"', count($context['category_order']) == 1 ? ' disabled' : '', '>';
243 252
 
244
-	foreach ($context['category_order'] as $cat)
245
-		if ($cat['id'] != 0)
253
+	foreach ($context['category_order'] as $cat) {
254
+			if ($cat['id'] != 0)
246 255
 			echo '
247 256
 						<option value="', $cat['id'], '">', $cat['true_name'], '</option>';
257
+	}
248 258
 
249 259
 	echo '
250 260
 					</select>
@@ -288,9 +298,10 @@  discard block
 block discarded – undo
288 298
 					</dt>
289 299
 					<dd>
290 300
 						<select name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != 0; this.form.board_order.disabled = this.options[this.selectedIndex].value != 0 || this.form.order.options[this.form.order.selectedIndex].value == \'\';}">';
291
-		foreach ($context['categories'] as $category)
292
-			echo '
301
+		foreach ($context['categories'] as $category) {
302
+					echo '
293 303
 							<option', $category['selected'] ? ' selected' : '', ' value="', $category['id'], '">', $category['name'], '</option>';
304
+		}
294 305
 		echo '
295 306
 						</select>
296 307
 					</dd>';
@@ -317,9 +328,10 @@  discard block
 block discarded – undo
317 328
 	echo '
318 329
 						<select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled' : '', '>
319 330
 							', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : '';
320
-	foreach ($context['board_order'] as $order)
321
-		echo '
331
+	foreach ($context['board_order'] as $order) {
332
+			echo '
322 333
 							<option', $order['selected'] ? ' selected' : '', ' value="', $order['id'], '">', $order['name'], '</option>';
334
+	}
323 335
 	echo '
324 336
 						</select>
325 337
 					</dd>';
@@ -348,13 +360,15 @@  discard block
 block discarded – undo
348 360
 					<dd>
349 361
 						<select name="profile">';
350 362
 
351
-	if (isset($context['board']['is_new']))
352
-		echo '
363
+	if (isset($context['board']['is_new'])) {
364
+			echo '
353 365
 							<option value="-1">[', $txt['permission_profile_inherit'], ']</option>';
366
+	}
354 367
 
355
-	foreach ($context['profiles'] as $id => $profile)
356
-		echo '
368
+	foreach ($context['profiles'] as $id => $profile) {
369
+			echo '
357 370
 							<option value="', $id, '"', $id == $context['board']['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
371
+	}
358 372
 
359 373
 	echo '
360 374
 						</select>
@@ -367,8 +381,8 @@  discard block
 block discarded – undo
367 381
 					</dt>
368 382
 					<dd>';
369 383
 
370
-	if (!empty($modSettings['deny_boards_access']))
371
-		echo '
384
+	if (!empty($modSettings['deny_boards_access'])) {
385
+			echo '
372 386
 						<table>
373 387
 							<tr>
374 388
 								<td></td>
@@ -376,10 +390,11 @@  discard block
 block discarded – undo
376 390
 								<th>', $txt['permissions_option_off'], '</th>
377 391
 								<th>', $txt['permissions_option_deny'], '</th>
378 392
 							</tr>';
393
+	}
379 394
 
380 395
 	// List all the membergroups so the user can choose who may access this board.
381
-	foreach ($context['groups'] as $group)
382
-		if (empty($modSettings['deny_boards_access']))
396
+	foreach ($context['groups'] as $group) {
397
+			if (empty($modSettings['deny_boards_access']))
383 398
 			echo '
384 399
 						<label for="groups_', $group['id'], '">
385 400
 							<input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', in_array($group['id'], $context['board_managers']) ? ' checked disabled' : ($group['allow'] ? ' checked' : ''), '>
@@ -387,8 +402,9 @@  discard block
 block discarded – undo
387 402
 								', $group['name'], '
388 403
 							</span>
389 404
 						</label><br>';
390
-		else
391
-			echo '
405
+	}
406
+		else {
407
+					echo '
392 408
 							<tr>
393 409
 								<td>
394 410
 									<label for="groups_', $group['id'], '_a">
@@ -408,16 +424,17 @@  discard block
 block discarded – undo
408 424
 								</td>
409 425
 								<td></td>
410 426
 							</tr>';
427
+		}
411 428
 
412
-	if (empty($modSettings['deny_boards_access']))
413
-		echo '
429
+	if (empty($modSettings['deny_boards_access'])) {
430
+			echo '
414 431
 						<span class="select_all_box">
415 432
 							<em>', $txt['check_all'], '</em> <input type="checkbox" onclick="invertAll(this, this.form, \'groups[\');">
416 433
 						</span>
417 434
 						<br><br>
418 435
 					</dd>';
419
-	else
420
-		echo '
436
+	} else {
437
+			echo '
421 438
 							<tr class="select_all_box">
422 439
 								<td>
423 440
 								</td>
@@ -436,6 +453,7 @@  discard block
 block discarded – undo
436 453
 							</tr>
437 454
 						</table>
438 455
 					</dd>';
456
+	}
439 457
 
440 458
 	// Options to choose moderators, specify as announcement board and choose whether to count posts here.
441 459
 	echo '
@@ -490,8 +508,8 @@  discard block
 block discarded – undo
490 508
 					</dl>
491 509
 				</div>';
492 510
 
493
-		if ($context['board']['redirect'])
494
-			echo '
511
+		if ($context['board']['redirect']) {
512
+					echo '
495 513
 				<div id="reset_redirect_div">
496 514
 					<dl class="settings">
497 515
 						<dt>
@@ -504,6 +522,7 @@  discard block
 block discarded – undo
504 522
 						</dd>
505 523
 					</dl>
506 524
 				</div>';
525
+		}
507 526
 	}
508 527
 
509 528
 	echo '
@@ -531,9 +550,10 @@  discard block
 block discarded – undo
531 550
 							<select name="boardtheme" id="boardtheme" onchange="refreshOptions();">
532 551
 								<option value="0"', $context['board']['theme'] == 0 ? ' selected' : '', '>', $txt['mboards_theme_default'], '</option>';
533 552
 
534
-	foreach ($context['themes'] as $theme)
535
-		echo '
553
+	foreach ($context['themes'] as $theme) {
554
+			echo '
536 555
 									<option value="', $theme['id'], '"', $context['board']['theme'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
556
+	}
537 557
 
538 558
 	echo '
539 559
 							</select>
@@ -562,14 +582,15 @@  discard block
 block discarded – undo
562 582
 
563 583
 		foreach ($context['custom_board_settings'] as $cbs_id => $cbs)
564 584
 		{
565
-			if (!empty($cbs['dt']) && !empty($cbs['dd']))
566
-				echo '
585
+			if (!empty($cbs['dt']) && !empty($cbs['dd'])) {
586
+							echo '
567 587
 						<dt class="clear', !is_numeric($cbs_id) ? ' cbs_' . $cbs_id : '', '">
568 588
 							', $cbs['dt'], '
569 589
 						</dt>
570 590
 						<dd', !is_numeric($cbs_id) ? ' class="cbs_' . $cbs_id . '"' : '', '>
571 591
 							', $cbs['dd'], '
572 592
 						</dd>';
593
+			}
573 594
 		}
574 595
 
575 596
 		echo '
@@ -577,9 +598,10 @@  discard block
 block discarded – undo
577 598
 				</div>';
578 599
 	}
579 600
 
580
-	if (!empty($context['board']['is_recycle']))
581
-		echo '
601
+	if (!empty($context['board']['is_recycle'])) {
602
+			echo '
582 603
 				<div class="noticebox">', $txt['mboards_recycle_disabled_delete'], '</div>';
604
+	}
583 605
 
584 606
 	echo '
585 607
 				<input type="hidden" name="rid" value="', $context['redirect_location'], '">
@@ -587,21 +609,24 @@  discard block
 block discarded – undo
587 609
 				<input type="hidden" name="', $context['admin-be-' . $context['board']['id'] . '_token_var'], '" value="', $context['admin-be-' . $context['board']['id'] . '_token'], '">';
588 610
 
589 611
 	// If this board has no children don't bother with the next confirmation screen.
590
-	if ($context['board']['no_children'])
591
-		echo '
612
+	if ($context['board']['no_children']) {
613
+			echo '
592 614
 				<input type="hidden" name="no_children" value="1">';
615
+	}
593 616
 
594
-	if (isset($context['board']['is_new']))
595
-		echo '
617
+	if (isset($context['board']['is_new'])) {
618
+			echo '
596 619
 				<input type="hidden" name="cur_cat" value="', $context['board']['category'], '">
597 620
 				<input type="submit" name="add" value="', $txt['mboards_new_board'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">';
598
-	else
599
-		echo '
621
+	} else {
622
+			echo '
600 623
 				<input type="submit" name="edit" value="', $txt['modify'], '" onclick="return !isEmptyText(this.form.board_name);" class="button">';
624
+	}
601 625
 
602
-	if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle']))
603
-		echo '
626
+	if (!isset($context['board']['is_new']) && empty($context['board']['is_recycle'])) {
627
+			echo '
604 628
 				<input type="submit" name="delete" value="', $txt['mboards_delete_board'], '" data-confirm="', $txt['boardConfirm'], '" class="button you_sure">';
629
+	}
605 630
 	echo '
606 631
 			</div>
607 632
 		</form>
@@ -622,12 +647,13 @@  discard block
 block discarded – undo
622 647
 		sItemListContainerId: \'moderator_container\',
623 648
 		aListItems: [';
624 649
 
625
-	foreach ($context['board']['moderators'] as $id_member => $member_name)
626
-		echo '
650
+	foreach ($context['board']['moderators'] as $id_member => $member_name) {
651
+			echo '
627 652
 					{
628 653
 						sItemId: ', JavaScriptEscape($id_member), ',
629 654
 						sItemName: ', JavaScriptEscape($member_name), '
630 655
 					}', $id_member == $context['board']['last_moderator_id'] ? '' : ',';
656
+	}
631 657
 
632 658
 	echo '
633 659
 		]
@@ -647,12 +673,13 @@  discard block
 block discarded – undo
647 673
 		sItemListContainerId: \'moderator_group_container\',
648 674
 		aListItems: [';
649 675
 
650
-	foreach ($context['board']['moderator_groups'] as $id_group => $group_name)
651
-		echo '
676
+	foreach ($context['board']['moderator_groups'] as $id_group => $group_name) {
677
+			echo '
652 678
 					{
653 679
 						sItemId: ', JavaScriptEscape($id_group), ',
654 680
 						sItemName: ', JavaScriptEscape($group_name), '
655 681
 					}', $id_group == $context['board']['last_moderator_group_id'] ? '' : ',';
682
+	}
656 683
 
657 684
 		echo '
658 685
 			]
@@ -678,17 +705,19 @@  discard block
 block discarded – undo
678 705
 		echo '
679 706
 			document.getElementById("redirect_address_div").style.display = redirectEnabled ? "" : "none";';
680 707
 
681
-		if ($context['board']['redirect'])
682
-			echo '
708
+		if ($context['board']['redirect']) {
709
+					echo '
683 710
 			document.getElementById("reset_redirect_div").style.display = redirectEnabled ? "" : "none";';
711
+		}
684 712
 	}
685 713
 
686 714
 	// Include any JavaScript added by mods using the 'integrate_edit_board' hook.
687 715
 	if (!empty($context['custom_refreshOptions']) && is_array($context['custom_refreshOptions']))
688 716
 	{
689
-		foreach ($context['custom_refreshOptions'] as $refreshOption)
690
-			echo '
717
+		foreach ($context['custom_refreshOptions'] as $refreshOption) {
718
+					echo '
691 719
 			', $refreshOption;
720
+		}
692 721
 	}
693 722
 
694 723
 	echo '
@@ -717,9 +746,10 @@  discard block
 block discarded – undo
717 746
 				<p>', $txt['mboards_delete_board_contains'], '</p>
718 747
 					<ul>';
719 748
 
720
-	foreach ($context['children'] as $child)
721
-		echo '
749
+	foreach ($context['children'] as $child) {
750
+			echo '
722 751
 						<li>', $child['node']['name'], '</li>';
752
+	}
723 753
 
724 754
 	echo '
725 755
 					</ul>
@@ -733,10 +763,11 @@  discard block
 block discarded – undo
733 763
 					<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1"', empty($context['can_move_children']) ? ' disabled' : '', '>', $txt['mboards_delete_board_option2'], '</label>:
734 764
 					<select name="board_to"', empty($context['can_move_children']) ? ' disabled' : '', '>';
735 765
 
736
-	foreach ($context['board_order'] as $board)
737
-		if ($board['id'] != $context['board']['id'] && empty($board['is_child']))
766
+	foreach ($context['board_order'] as $board) {
767
+			if ($board['id'] != $context['board']['id'] && empty($board['is_child']))
738 768
 			echo '
739 769
 						<option value="', $board['id'], '">', $board['name'], '</option>';
770
+	}
740 771
 
741 772
 	echo '
742 773
 					</select>
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Braces   +461 added lines, -344 removed lines patch added patch discarded remove patch
@@ -18,23 +18,25 @@  discard block
 block discarded – undo
18 18
 	global $context;
19 19
 
20 20
 	// Prevent Chrome from auto completing fields when viewing/editing other members profiles
21
-	if (isBrowser('is_chrome') && !$context['user']['is_owner'])
22
-		echo '
21
+	if (isBrowser('is_chrome') && !$context['user']['is_owner']) {
22
+			echo '
23 23
 	<script>
24 24
 		disableAutoComplete();
25 25
 	</script>';
26
+	}
26 27
 
27 28
 	// If an error occurred while trying to save previously, give the user a clue!
28 29
 	echo '
29 30
 					', template_error_message();
30 31
 
31 32
 	// If the profile was update successfully, let the user know this.
32
-	if (!empty($context['profile_updated']))
33
-		echo '
33
+	if (!empty($context['profile_updated'])) {
34
+			echo '
34 35
 					<div class="infobox">
35 36
 						', $context['profile_updated'], '
36 37
 					</div>';
37
-}
38
+	}
39
+	}
38 40
 
39 41
 /**
40 42
  * Template for any HTML needed below the profile (closing off divs/tables, etc.)
@@ -102,8 +104,7 @@  discard block
 block discarded – undo
102 104
 	if (empty($context['unread_alerts']))
103 105
 	{
104 106
 		template_alerts_all_read();
105
-	}
106
-	else
107
+	} else
107 108
 	{
108 109
 		foreach ($context['unread_alerts'] as $id_alert => $details)
109 110
 		{
@@ -164,10 +165,11 @@  discard block
 block discarded – undo
164 165
 			<div class="custom_fields_above_name">
165 166
 				<ul >';
166 167
 
167
-		foreach ($context['print_custom_fields']['above_member'] as $field)
168
-			if (!empty($field['output_html']))
168
+		foreach ($context['print_custom_fields']['above_member'] as $field) {
169
+					if (!empty($field['output_html']))
169 170
 				echo '
170 171
 					<li>', $field['output_html'], '</li>';
172
+		}
171 173
 
172 174
 		echo '
173 175
 				</ul>
@@ -188,10 +190,11 @@  discard block
 block discarded – undo
188 190
 			<div class="custom_fields_below_avatar">
189 191
 				<ul >';
190 192
 
191
-		foreach ($context['print_custom_fields']['below_avatar'] as $field)
192
-			if (!empty($field['output_html']))
193
+		foreach ($context['print_custom_fields']['below_avatar'] as $field) {
194
+					if (!empty($field['output_html']))
193 195
 				echo '
194 196
 					<li>', $field['output_html'], '</li>';
197
+		}
195 198
 
196 199
 		echo '
197 200
 				</ul>
@@ -202,22 +205,25 @@  discard block
 block discarded – undo
202 205
 		echo '
203 206
 			<ul class="clear">';
204 207
 	// Email is only visible if it's your profile or you have the moderate_forum permission
205
-	if ($context['member']['show_email'])
206
-		echo '
208
+	if ($context['member']['show_email']) {
209
+			echo '
207 210
 				<li><a href="mailto:', $context['member']['email'], '" title="', $context['member']['email'], '" rel="nofollow"><span class="generic_icons mail" title="' . $txt['email'] . '"></span></a></li>';
211
+	}
208 212
 
209 213
 	// Don't show an icon if they haven't specified a website.
210
-	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
211
-		echo '
214
+	if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website'])) {
215
+			echo '
212 216
 				<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<span class="generic_icons www" title="' . $context['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
217
+	}
213 218
 
214 219
 	// Are there any custom profile fields as icons?
215 220
 	if (!empty($context['print_custom_fields']['icons']))
216 221
 	{
217
-		foreach ($context['print_custom_fields']['icons'] as $field)
218
-			if (!empty($field['output_html']))
222
+		foreach ($context['print_custom_fields']['icons'] as $field) {
223
+					if (!empty($field['output_html']))
219 224
 				echo '
220 225
 					<li class="custom_field">', $field['output_html'], '</li>';
226
+		}
221 227
 	}
222 228
 
223 229
 	echo '
@@ -225,23 +231,26 @@  discard block
 block discarded – undo
225 231
 			<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['text'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<span class="' . ($context['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $context['member']['online']['text'] . '"></span>' : $context['member']['online']['label'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['label'] . '</span>' : '';
226 232
 
227 233
 	// Can they add this member as a buddy?
228
-	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
229
-		echo '
234
+	if (!empty($context['can_have_buddy']) && !$context['user']['is_owner']) {
235
+			echo '
230 236
 				<br><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
237
+	}
231 238
 
232 239
 	echo '
233 240
 			</span>';
234 241
 
235
-	if (!$context['user']['is_owner'] && $context['can_send_pm'])
236
-		echo '
242
+	if (!$context['user']['is_owner'] && $context['can_send_pm']) {
243
+			echo '
237 244
 			<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '" class="infolinks">', $txt['profile_sendpm_short'], '</a>';
245
+	}
238 246
 
239 247
 	echo '
240 248
 			<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '" class="infolinks">', $txt['showPosts'], '</a>';
241 249
 
242
-	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled']))
243
-		echo '
250
+	if ($context['user']['is_owner'] && !empty($modSettings['drafts_post_enabled'])) {
251
+			echo '
244 252
 			<a href="', $scripturl, '?action=profile;area=showdrafts;u=', $context['id_member'], '" class="infolinks">', $txt['drafts_show'], '</a>';
253
+	}
245 254
 
246 255
 	echo '
247 256
 			<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '" class="infolinks">', $txt['statPanel'], '</a>';
@@ -253,10 +262,11 @@  discard block
 block discarded – undo
253 262
 			<div class="custom_fields_bottom">
254 263
 				<ul class="nolist">';
255 264
 
256
-		foreach ($context['print_custom_fields']['bottom_poster'] as $field)
257
-			if (!empty($field['output_html']))
265
+		foreach ($context['print_custom_fields']['bottom_poster'] as $field) {
266
+					if (!empty($field['output_html']))
258 267
 				echo '
259 268
 					<li>', $field['output_html'], '</li>';
269
+		}
260 270
 
261 271
 		echo '
262 272
 				</ul>
@@ -270,15 +280,17 @@  discard block
 block discarded – undo
270 280
 		<div id="detailedinfo">
271 281
 			<dl class="settings">';
272 282
 
273
-	if ($context['user']['is_owner'] || $context['user']['is_admin'])
274
-		echo '
283
+	if ($context['user']['is_owner'] || $context['user']['is_admin']) {
284
+			echo '
275 285
 				<dt>', $txt['username'], ': </dt>
276 286
 				<dd>', $context['member']['username'], '</dd>';
287
+	}
277 288
 
278
-	if (!isset($context['disabled_fields']['posts']))
279
-		echo '
289
+	if (!isset($context['disabled_fields']['posts'])) {
290
+			echo '
280 291
 				<dt>', $txt['profile_posts'], ': </dt>
281 292
 				<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
293
+	}
282 294
 
283 295
 	if ($context['member']['show_email'])
284 296
 	{
@@ -287,15 +299,17 @@  discard block
 block discarded – undo
287 299
 				<dd><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></dd>';
288 300
 	}
289 301
 
290
-	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
291
-		echo '
302
+	if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title'])) {
303
+			echo '
292 304
 				<dt>', $txt['custom_title'], ': </dt>
293 305
 				<dd>', $context['member']['title'], '</dd>';
306
+	}
294 307
 
295
-	if (!empty($context['member']['blurb']))
296
-		echo '
308
+	if (!empty($context['member']['blurb'])) {
309
+			echo '
297 310
 				<dt>', $txt['personal_text'], ': </dt>
298 311
 				<dd>', $context['member']['blurb'], '</dd>';
312
+	}
299 313
 
300 314
 	echo '
301 315
 				<dt>', $txt['age'], ':</dt>
@@ -310,11 +324,12 @@  discard block
 block discarded – undo
310 324
 		echo '
311 325
 				<dl class="settings">';
312 326
 
313
-		foreach ($context['print_custom_fields']['standard'] as $field)
314
-			if (!empty($field['output_html']))
327
+		foreach ($context['print_custom_fields']['standard'] as $field) {
328
+					if (!empty($field['output_html']))
315 329
 				echo '
316 330
 					<dt>', $field['name'], ':</dt>
317 331
 					<dd>', $field['output_html'], '</dd>';
332
+		}
318 333
 
319 334
 		echo '
320 335
 				</dl>';
@@ -332,9 +347,10 @@  discard block
 block discarded – undo
332 347
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', ($context['can_issue_warning'] && !$context['user']['is_owner'] ? 'issuewarning' : 'viewwarning'), '">', $context['member']['warning'], '%</a>';
333 348
 
334 349
 		// Can we provide information on what this means?
335
-		if (!empty($context['warning_status']))
336
-			echo '
350
+		if (!empty($context['warning_status'])) {
351
+					echo '
337 352
 						<span class="smalltext">(', $context['warning_status'], ')</span>';
353
+		}
338 354
 
339 355
 		echo '
340 356
 					</dd>';
@@ -345,9 +361,10 @@  discard block
 block discarded – undo
345 361
 	{
346 362
 
347 363
 		// If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
348
-		if (!empty($context['activate_message']))
349
-			echo '
364
+		if (!empty($context['activate_message'])) {
365
+					echo '
350 366
 					<dt class="clear"><span class="alert">', $context['activate_message'], '</span>&nbsp;(<a href="', $context['activate_link'], '"', ($context['activate_type'] == 4 ? ' class="you_sure" data-confirm="' . $txt['profileConfirm'] . '"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
367
+		}
351 368
 
352 369
 		// If the current member is banned, show a message and possibly a link to the ban.
353 370
 		if (!empty($context['member']['bans']))
@@ -357,9 +374,10 @@  discard block
 block discarded – undo
357 374
 					<dt class="clear" id="ban_info" style="display: none;">
358 375
 						<strong>', $txt['user_banned_by_following'], ':</strong>';
359 376
 
360
-			foreach ($context['member']['bans'] as $ban)
361
-				echo '
377
+			foreach ($context['member']['bans'] as $ban) {
378
+							echo '
362 379
 						<br><span class="smalltext">', $ban['explanation'], '</span>';
380
+			}
363 381
 
364 382
 			echo '
365 383
 					</dt>';
@@ -373,30 +391,34 @@  discard block
 block discarded – undo
373 391
 	// If the person looking is allowed, they can check the members IP address and hostname.
374 392
 	if ($context['can_see_ip'])
375 393
 	{
376
-		if (!empty($context['member']['ip']))
377
-		echo '
394
+		if (!empty($context['member']['ip'])) {
395
+				echo '
378 396
 					<dt>', $txt['ip'], ': </dt>
379 397
 					<dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
398
+		}
380 399
 
381
-		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
382
-			echo '
400
+		if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip'])) {
401
+					echo '
383 402
 					<dt>', $txt['hostname'], ': </dt>
384 403
 					<dd>', $context['member']['hostname'], '</dd>';
404
+		}
385 405
 	}
386 406
 
387 407
 	echo '
388 408
 					<dt>', $txt['local_time'], ':</dt>
389 409
 					<dd>', $context['member']['local_time'], '</dd>';
390 410
 
391
-	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
392
-		echo '
411
+	if (!empty($modSettings['userLanguage']) && !empty($context['member']['language'])) {
412
+			echo '
393 413
 					<dt>', $txt['language'], ':</dt>
394 414
 					<dd>', $context['member']['language'], '</dd>';
415
+	}
395 416
 
396
-	if ($context['member']['show_last_login'])
397
-		echo '
417
+	if ($context['member']['show_last_login']) {
418
+			echo '
398 419
 					<dt>', $txt['lastLoggedIn'], ': </dt>
399 420
 					<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
421
+	}
400 422
 
401 423
 	echo '
402 424
 				</dl>';
@@ -408,10 +430,11 @@  discard block
 block discarded – undo
408 430
 				<div class="custom_fields_above_signature">
409 431
 					<ul class="nolist">';
410 432
 
411
-		foreach ($context['print_custom_fields']['above_signature'] as $field)
412
-			if (!empty($field['output_html']))
433
+		foreach ($context['print_custom_fields']['above_signature'] as $field) {
434
+					if (!empty($field['output_html']))
413 435
 				echo '
414 436
 						<li>', $field['output_html'], '</li>';
437
+		}
415 438
 
416 439
 		echo '
417 440
 					</ul>
@@ -419,12 +442,13 @@  discard block
 block discarded – undo
419 442
 	}
420 443
 
421 444
 	// Show the users signature.
422
-	if ($context['signature_enabled'] && !empty($context['member']['signature']))
423
-		echo '
445
+	if ($context['signature_enabled'] && !empty($context['member']['signature'])) {
446
+			echo '
424 447
 				<div class="signature">
425 448
 					<h5>', $txt['signature'], ':</h5>
426 449
 					', $context['member']['signature'], '
427 450
 				</div>';
451
+	}
428 452
 
429 453
 	// Are there any custom profile fields for below the signature?
430 454
 	if (!empty($context['print_custom_fields']['below_signature']))
@@ -433,10 +457,11 @@  discard block
 block discarded – undo
433 457
 				<div class="custom_fields_below_signature">
434 458
 					<ul class="nolist">';
435 459
 
436
-		foreach ($context['print_custom_fields']['below_signature'] as $field)
437
-			if (!empty($field['output_html']))
460
+		foreach ($context['print_custom_fields']['below_signature'] as $field) {
461
+					if (!empty($field['output_html']))
438 462
 				echo '
439 463
 						<li>', $field['output_html'], '</li>';
464
+		}
440 465
 
441 466
 		echo '
442 467
 					</ul>
@@ -481,62 +506,70 @@  discard block
 block discarded – undo
481 506
 				</div>
482 507
 				<div class="list_posts">';
483 508
 
484
-			if (!$post['approved'])
485
-				echo '
509
+			if (!$post['approved']) {
510
+							echo '
486 511
 					<div class="approve_post">
487 512
 						<em>', $txt['post_awaiting_approval'], '</em>
488 513
 					</div>';
514
+			}
489 515
 
490 516
 			echo '
491 517
 					', $post['body'], '
492 518
 				</div>';
493 519
 
494
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
495
-				echo '
520
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
521
+							echo '
496 522
 				<div class="floatright">
497 523
 					<ul class="quickbuttons">';
524
+			}
498 525
 
499 526
 			// If they *can* reply?
500
-			if ($post['can_reply'])
501
-				echo '
527
+			if ($post['can_reply']) {
528
+							echo '
502 529
 						<li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
530
+			}
503 531
 
504 532
 			// If they *can* quote?
505
-			if ($post['can_quote'])
506
-				echo '
533
+			if ($post['can_quote']) {
534
+							echo '
507 535
 						<li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
536
+			}
508 537
 
509 538
 			// How about... even... remove it entirely?!
510
-			if ($post['can_delete'])
511
-				echo '
539
+			if ($post['can_delete']) {
540
+							echo '
512 541
 						<li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
542
+			}
513 543
 
514
-			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete'])
515
-				echo '
544
+			if ($post['can_reply'] || $post['can_quote'] || $post['can_delete']) {
545
+							echo '
516 546
 					</ul>
517 547
 				</div>';
548
+			}
518 549
 
519 550
 			echo '
520 551
 			</div>';
521 552
 		}
553
+	} else {
554
+			template_show_list('attachments');
522 555
 	}
523
-	else
524
-		template_show_list('attachments');
525 556
 
526 557
 	// No posts? Just end with a informative message.
527
-	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
528
-		echo '
558
+	if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts']))) {
559
+			echo '
529 560
 			<div class="windowbg2">
530 561
 				', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
531 562
 			</div>';
563
+	}
532 564
 
533 565
 	// Show more page numbers.
534
-	if (!empty($context['page_index']))
535
-		echo '
566
+	if (!empty($context['page_index'])) {
567
+			echo '
536 568
 		<div class="pagesection">
537 569
 			<div class="pagelinks">', $context['page_index'], '</div>
538 570
 		</div>';
539
-}
571
+	}
572
+	}
540 573
 
541 574
 /**
542 575
  * Template for showing alerts within the alerts popup
@@ -546,11 +579,12 @@  discard block
 block discarded – undo
546 579
 	global $context, $txt, $scripturl;
547 580
 
548 581
 	// Do we have an update message?
549
-	if (!empty($context['update_message']))
550
-		echo '
582
+	if (!empty($context['update_message'])) {
583
+			echo '
551 584
 		<div class="infobox">
552 585
 			', $context['update_message'], '.
553 586
 		</div>';
587
+	}
554 588
 
555 589
 	echo '
556 590
 		<div class="cat_bar">
@@ -559,13 +593,12 @@  discard block
 block discarded – undo
559 593
 			</h3>
560 594
 		</div>';
561 595
 
562
-	if (empty($context['alerts']))
563
-		echo '
596
+	if (empty($context['alerts'])) {
597
+			echo '
564 598
 		<div class="information">
565 599
 			', $txt['alerts_none'], '
566 600
 		</div>';
567
-
568
-	else
601
+	} else
569 602
 	{
570 603
 		// Start the form.
571 604
 		echo '
@@ -627,12 +660,12 @@  discard block
 block discarded – undo
627 660
 		</div>' : '';
628 661
 
629 662
 	// No drafts? Just show an informative message.
630
-	if (empty($context['drafts']))
631
-		echo '
663
+	if (empty($context['drafts'])) {
664
+			echo '
632 665
 		<div class="windowbg2 centertext">
633 666
 			', $txt['draft_none'], '
634 667
 		</div>';
635
-	else
668
+	} else
636 669
 	{
637 670
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
638 671
 		foreach ($context['drafts'] as $draft)
@@ -643,11 +676,13 @@  discard block
 block discarded – undo
643 676
 					<div class="topic_details">
644 677
 						<h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong> &nbsp; &nbsp;';
645 678
 
646
-			if (!empty($draft['sticky']))
647
-				echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
679
+			if (!empty($draft['sticky'])) {
680
+							echo '<span class="generic_icons sticky" title="', $txt['sticky_topic'], '"></span>';
681
+			}
648 682
 
649
-			if (!empty($draft['locked']))
650
-				echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
683
+			if (!empty($draft['locked'])) {
684
+							echo '<span class="generic_icons lock" title="', $txt['locked_topic'], '"></span>';
685
+			}
651 686
 
652 687
 			echo '
653 688
 						</h5>
@@ -680,12 +715,13 @@  discard block
 block discarded – undo
680 715
 {
681 716
 	global $context, $scripturl, $txt;
682 717
 
683
-	if (!empty($context['saved_successful']))
684
-		echo '
718
+	if (!empty($context['saved_successful'])) {
719
+			echo '
685 720
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
686
-	elseif (!empty($context['saved_failed']))
687
-		echo '
721
+	} elseif (!empty($context['saved_failed'])) {
722
+			echo '
688 723
 					<div class="errorbox">', $context['saved_failed'], '</div>';
724
+	}
689 725
 
690 726
 	echo '
691 727
 	<div id="edit_buddies">
@@ -699,24 +735,27 @@  discard block
 block discarded – undo
699 735
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
700 736
 				<th scope="col">', $txt['status'], '</th>';
701 737
 
702
-	if (allowedTo('moderate_forum'))
703
-		echo '
738
+	if (allowedTo('moderate_forum')) {
739
+			echo '
704 740
 				<th scope="col">', $txt['email'], '</th>';
741
+	}
705 742
 
706
-	if (!empty($context['custom_pf']))
707
-		foreach ($context['custom_pf'] as $column)
743
+	if (!empty($context['custom_pf'])) {
744
+			foreach ($context['custom_pf'] as $column)
708 745
 				echo '<th scope="col">', $column['label'], '</th>';
746
+	}
709 747
 
710 748
 	echo '
711 749
 				<th scope="col">', $txt['remove'], '</th>
712 750
 			</tr>';
713 751
 
714 752
 	// If they don't have any buddies don't list them!
715
-	if (empty($context['buddies']))
716
-		echo '
753
+	if (empty($context['buddies'])) {
754
+			echo '
717 755
 			<tr class="windowbg">
718 756
 				<td colspan="', allowedTo('moderate_forum') ? '10' : '9', '"><strong>', $txt['no_buddies'], '</strong></td>
719 757
 			</tr>';
758
+	}
720 759
 
721 760
 		// Now loop through each buddy showing info on each.
722 761
 	else
@@ -728,15 +767,17 @@  discard block
 block discarded – undo
728 767
 					<td>', $buddy['link'], '</td>
729 768
 					<td><a href="', $buddy['online']['href'], '"><span class="' . ($buddy['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $buddy['online']['text'] . '"></span></a></td>';
730 769
 
731
-			if ($buddy['show_email'])
732
-				echo '
770
+			if ($buddy['show_email']) {
771
+							echo '
733 772
 					<td><a href="mailto:' . $buddy['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $buddy['name'] . '"></span></a></td>';
773
+			}
734 774
 
735 775
 			// Show the custom profile fields for this user.
736
-			if (!empty($context['custom_pf']))
737
-				foreach ($context['custom_pf'] as $key => $column)
776
+			if (!empty($context['custom_pf'])) {
777
+							foreach ($context['custom_pf'] as $key => $column)
738 778
 					echo '
739 779
 						<td class="lefttext">', $buddy['options'][$key], '</td>';
780
+			}
740 781
 
741 782
 			echo '
742 783
 					<td><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['buddy_remove'], '"></span></a></td>
@@ -766,9 +807,10 @@  discard block
 block discarded – undo
766 807
 			</dl>
767 808
 		</div>';
768 809
 
769
-	if (!empty($context['token_check']))
770
-		echo '
810
+	if (!empty($context['token_check'])) {
811
+			echo '
771 812
 			<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
813
+	}
772 814
 
773 815
 	echo '
774 816
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -794,12 +836,13 @@  discard block
 block discarded – undo
794 836
 {
795 837
 	global $context, $scripturl, $txt;
796 838
 
797
-	if (!empty($context['saved_successful']))
798
-		echo '
839
+	if (!empty($context['saved_successful'])) {
840
+			echo '
799 841
 					<div class="infobox">', $context['user']['is_owner'] ? $txt['profile_updated_own'] : sprintf($txt['profile_updated_else'], $context['member']['name']), '</div>';
800
-	elseif (!empty($context['saved_failed']))
801
-		echo '
842
+	} elseif (!empty($context['saved_failed'])) {
843
+			echo '
802 844
 					<div class="errorbox">', $context['saved_failed'], '</div>';
845
+	}
803 846
 
804 847
 	echo '
805 848
 	<div id="edit_buddies">
@@ -813,20 +856,22 @@  discard block
 block discarded – undo
813 856
 				<th scope="col" class="quarter_table">', $txt['name'], '</th>
814 857
 				<th scope="col">', $txt['status'], '</th>';
815 858
 
816
-	if (allowedTo('moderate_forum'))
817
-		echo '
859
+	if (allowedTo('moderate_forum')) {
860
+			echo '
818 861
 				<th scope="col">', $txt['email'], '</th>';
862
+	}
819 863
 
820 864
 	echo '
821 865
 				<th scope="col">', $txt['ignore_remove'], '</th>
822 866
 			</tr>';
823 867
 
824 868
 	// If they don't have anyone on their ignore list, don't list it!
825
-	if (empty($context['ignore_list']))
826
-		echo '
869
+	if (empty($context['ignore_list'])) {
870
+			echo '
827 871
 			<tr class="windowbg">
828 872
 				<td colspan="', allowedTo('moderate_forum') ? '4' : '3', '"><strong>', $txt['no_ignore'], '</strong></td>
829 873
 			</tr>';
874
+	}
830 875
 
831 876
 	// Now loop through each buddy showing info on each.
832 877
 	foreach ($context['ignore_list'] as $member)
@@ -836,9 +881,10 @@  discard block
 block discarded – undo
836 881
 				<td>', $member['link'], '</td>
837 882
 				<td><a href="', $member['online']['href'], '"><span class="' . ($member['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $member['online']['text'] . '"></span></a></td>';
838 883
 
839
-		if ($member['show_email'])
840
-			echo '
884
+		if ($member['show_email']) {
885
+					echo '
841 886
 				<td><a href="mailto:' . $member['email'] . '" rel="nofollow"><span class="generic_icons mail icon" title="' . $txt['email'] . ' ' . $member['name'] . '"></span></a></td>';
887
+		}
842 888
 		echo '
843 889
 				<td><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons delete" title="', $txt['ignore_remove'], '"></span></a></td>
844 890
 			</tr>';
@@ -865,9 +911,10 @@  discard block
 block discarded – undo
865 911
 			</dl>
866 912
 		</div>';
867 913
 
868
-	if (!empty($context['token_check']))
869
-		echo '
914
+	if (!empty($context['token_check'])) {
915
+			echo '
870 916
 		<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
917
+	}
871 918
 
872 919
 	echo '
873 920
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -912,9 +959,10 @@  discard block
 block discarded – undo
912 959
 					<a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
913 960
 
914 961
 	// Second address detected?
915
-	if (!empty($context['last_ip2']))
916
-		echo '
962
+	if (!empty($context['last_ip2'])) {
963
+			echo '
917 964
 					, <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
965
+	}
918 966
 
919 967
 	echo '
920 968
 				</dd>';
@@ -979,9 +1027,10 @@  discard block
 block discarded – undo
979 1027
 				<h3 class="catbg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
980 1028
 			</div>
981 1029
 			<div class="windowbg2 noup">';
982
-			foreach ($context['whois_servers'] as $server)
983
-			echo '
1030
+			foreach ($context['whois_servers'] as $server) {
1031
+						echo '
984 1032
 				<a href="', $server['url'], '" target="_blank"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br>';
1033
+			}
985 1034
 			echo '
986 1035
 			</div>
987 1036
 			<br>';
@@ -992,10 +1041,10 @@  discard block
 block discarded – undo
992 1041
 		<div class="cat_bar">
993 1042
 			<h3 class="catbg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
994 1043
 		</div>';
995
-	if (empty($context['ips']))
996
-		echo '
1044
+	if (empty($context['ips'])) {
1045
+			echo '
997 1046
 		<p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
998
-	else
1047
+	} else
999 1048
 	{
1000 1049
 		echo '
1001 1050
 		<table class="table_grid">
@@ -1008,12 +1057,13 @@  discard block
 block discarded – undo
1008 1057
 			<tbody>';
1009 1058
 
1010 1059
 		// Loop through each of the members and display them.
1011
-		foreach ($context['ips'] as $ip => $memberlist)
1012
-			echo '
1060
+		foreach ($context['ips'] as $ip => $memberlist) {
1061
+					echo '
1013 1062
 				<tr class="windowbg">
1014 1063
 					<td><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
1015 1064
 					<td>', implode(', ', $memberlist), '</td>
1016 1065
 				</tr>';
1066
+		}
1017 1067
 
1018 1068
 		echo '
1019 1069
 			</tbody>
@@ -1059,8 +1109,7 @@  discard block
 block discarded – undo
1059 1109
 	{
1060 1110
 		echo '
1061 1111
 		<div class="information">', $txt['showPermissions_all'], '</div>';
1062
-	}
1063
-	else
1112
+	} else
1064 1113
 	{
1065 1114
 		echo '
1066 1115
 		<div class="information">',$txt['showPermissions_help'], '</div>
@@ -1074,9 +1123,10 @@  discard block
 block discarded – undo
1074 1123
 				</div>
1075 1124
 				<div class="windowbg smalltext">
1076 1125
 					', $txt['showPermissions_restricted_boards_desc'], ':<br>';
1077
-				foreach ($context['no_access_boards'] as $no_access_board)
1078
-					echo '
1126
+				foreach ($context['no_access_boards'] as $no_access_board) {
1127
+									echo '
1079 1128
 						<a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
1129
+				}
1080 1130
 				echo '
1081 1131
 				</div>';
1082 1132
 		}
@@ -1108,12 +1158,13 @@  discard block
 block discarded – undo
1108 1158
 								</td>
1109 1159
 								<td class="smalltext">';
1110 1160
 
1111
-				if ($permission['is_denied'])
1112
-					echo '
1161
+				if ($permission['is_denied']) {
1162
+									echo '
1113 1163
 									<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1114
-				else
1115
-					echo '
1164
+				} else {
1165
+									echo '
1116 1166
 									', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
1167
+				}
1117 1168
 
1118 1169
 					echo '
1119 1170
 								</td>
@@ -1123,10 +1174,10 @@  discard block
 block discarded – undo
1123 1174
 						</tbody>
1124 1175
 					</table>
1125 1176
 				</div><br>';
1126
-		}
1127
-		else
1128
-			echo '
1177
+		} else {
1178
+					echo '
1129 1179
 			<p class="windowbg2">', $txt['showPermissions_none_general'], '</p>';
1180
+		}
1130 1181
 
1131 1182
 		// Board permission section.
1132 1183
 		echo '
@@ -1136,14 +1187,16 @@  discard block
 block discarded – undo
1136 1187
 						<a id="board_permissions"></a>', $txt['showPermissions_select'], ':
1137 1188
 						<select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
1138 1189
 							<option value="0"', $context['board'] == 0 ? ' selected' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
1139
-				if (!empty($context['boards']))
1140
-					echo '
1190
+				if (!empty($context['boards'])) {
1191
+									echo '
1141 1192
 							<option value="" disabled>---------------------------</option>';
1193
+				}
1142 1194
 
1143 1195
 				// Fill the box with any local permission boards.
1144
-				foreach ($context['boards'] as $board)
1145
-					echo '
1196
+				foreach ($context['boards'] as $board) {
1197
+									echo '
1146 1198
 							<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
1199
+				}
1147 1200
 
1148 1201
 				echo '
1149 1202
 						</select>
@@ -1174,8 +1227,7 @@  discard block
 block discarded – undo
1174 1227
 				{
1175 1228
 					echo '
1176 1229
 							<span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
1177
-				}
1178
-				else
1230
+				} else
1179 1231
 				{
1180 1232
 					echo '
1181 1233
 							', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
@@ -1187,10 +1239,10 @@  discard block
 block discarded – undo
1187 1239
 			echo '
1188 1240
 				</tbody>
1189 1241
 			</table>';
1190
-		}
1191
-		else
1192
-			echo '
1242
+		} else {
1243
+					echo '
1193 1244
 			<p class="windowbg2">', $txt['showPermissions_none_board'], '</p>';
1245
+		}
1194 1246
 	echo '
1195 1247
 			</div>
1196 1248
 		</div>';
@@ -1232,9 +1284,10 @@  discard block
 block discarded – undo
1232 1284
 			</div>';
1233 1285
 
1234 1286
 	// If they haven't post at all, don't draw the graph.
1235
-	if (empty($context['posts_by_time']))
1236
-		echo '
1287
+	if (empty($context['posts_by_time'])) {
1288
+			echo '
1237 1289
 			<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1290
+	}
1238 1291
 	// Otherwise do!
1239 1292
 	else
1240 1293
 	{
@@ -1273,11 +1326,10 @@  discard block
 block discarded – undo
1273 1326
 					</h3>
1274 1327
 				</div>';
1275 1328
 
1276
-	if (empty($context['popular_boards']))
1277
-		echo '
1329
+	if (empty($context['popular_boards'])) {
1330
+			echo '
1278 1331
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1279
-
1280
-	else
1332
+	} else
1281 1333
 	{
1282 1334
 		echo '
1283 1335
 				<dl class="stats">';
@@ -1308,10 +1360,10 @@  discard block
 block discarded – undo
1308 1360
 					</h3>
1309 1361
 				</div>';
1310 1362
 
1311
-	if (empty($context['board_activity']))
1312
-		echo '
1363
+	if (empty($context['board_activity'])) {
1364
+			echo '
1313 1365
 				<p class="centertext padding">', $txt['statPanel_noPosts'], '</p>';
1314
-	else
1366
+	} else
1315 1367
 	{
1316 1368
 		echo '
1317 1369
 				<dl class="stats">';
@@ -1359,41 +1411,46 @@  discard block
 block discarded – undo
1359 1411
 				<h3 class="catbg profile_hd">';
1360 1412
 
1361 1413
 		// Don't say "Profile" if this isn't the profile...
1362
-		if (!empty($context['profile_header_text']))
1363
-			echo '
1414
+		if (!empty($context['profile_header_text'])) {
1415
+					echo '
1364 1416
 					', $context['profile_header_text'];
1365
-		else
1366
-			echo '
1417
+		} else {
1418
+					echo '
1367 1419
 					', $txt['profile'];
1420
+		}
1368 1421
 
1369 1422
 		echo '
1370 1423
 				</h3>
1371 1424
 			</div>';
1372 1425
 
1373 1426
 	// Have we some description?
1374
-	if ($context['page_desc'])
1375
-		echo '
1427
+	if ($context['page_desc']) {
1428
+			echo '
1376 1429
 			<p class="information">', $context['page_desc'], '</p>';
1430
+	}
1377 1431
 
1378 1432
 	echo '
1379 1433
 			<div class="roundframe">';
1380 1434
 
1381 1435
 	// Any bits at the start?
1382
-	if (!empty($context['profile_prehtml']))
1383
-		echo '
1436
+	if (!empty($context['profile_prehtml'])) {
1437
+			echo '
1384 1438
 				<div>', $context['profile_prehtml'], '</div>';
1439
+	}
1385 1440
 
1386
-	if (!empty($context['profile_fields']))
1387
-		echo '
1441
+	if (!empty($context['profile_fields'])) {
1442
+			echo '
1388 1443
 				<dl class="settings">';
1444
+	}
1389 1445
 
1390 1446
 	// Start the big old loop 'of love.
1391 1447
 	$lastItem = 'hr';
1392 1448
 	foreach ($context['profile_fields'] as $key => $field)
1393 1449
 	{
1394 1450
 		// We add a little hack to be sure we never get more than one hr in a row!
1395
-		if ($lastItem == 'hr' && $field['type'] == 'hr')
1396
-			continue;
1451
+		if ($lastItem == 'hr' && $field['type'] == 'hr') {
1452
+					continue;
1453
+		}
1397 1454
 
1398 1455
 		$lastItem = $field['type'];
1399 1456
 		if ($field['type'] == 'hr')
@@ -1402,48 +1459,50 @@  discard block
 block discarded – undo
1402 1459
 				</dl>
1403 1460
 				<hr>
1404 1461
 				<dl class="settings">';
1405
-		}
1406
-		elseif ($field['type'] == 'callback')
1462
+		} elseif ($field['type'] == 'callback')
1407 1463
 		{
1408 1464
 			if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
1409 1465
 			{
1410 1466
 				$callback_func = 'template_profile_' . $field['callback_func'];
1411 1467
 				$callback_func();
1412 1468
 			}
1413
-		}
1414
-		else
1469
+		} else
1415 1470
 		{
1416 1471
 			echo '
1417 1472
 					<dt>
1418 1473
 						<strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
1419 1474
 
1420 1475
 			// Does it have any subtext to show?
1421
-			if (!empty($field['subtext']))
1422
-				echo '
1476
+			if (!empty($field['subtext'])) {
1477
+							echo '
1423 1478
 						<br>
1424 1479
 						<span class="smalltext">', $field['subtext'], '</span>';
1480
+			}
1425 1481
 
1426 1482
 			echo '
1427 1483
 					</dt>
1428 1484
 					<dd>';
1429 1485
 
1430 1486
 			// Want to put something infront of the box?
1431
-			if (!empty($field['preinput']))
1432
-				echo '
1487
+			if (!empty($field['preinput'])) {
1488
+							echo '
1433 1489
 						', $field['preinput'];
1490
+			}
1434 1491
 
1435 1492
 			// What type of data are we showing?
1436
-			if ($field['type'] == 'label')
1437
-				echo '
1493
+			if ($field['type'] == 'label') {
1494
+							echo '
1438 1495
 						', $field['value'];
1496
+			}
1439 1497
 
1440 1498
 			// Maybe it's a text box - very likely!
1441 1499
 			elseif (in_array($field['type'], array('int', 'float', 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'time', 'url')))
1442 1500
 			{
1443
-				if ($field['type'] == 'int' || $field['type'] == 'float')
1444
-					$type = 'number';
1445
-				else
1446
-					$type = $field['type'];
1501
+				if ($field['type'] == 'int' || $field['type'] == 'float') {
1502
+									$type = 'number';
1503
+				} else {
1504
+									$type = $field['type'];
1505
+				}
1447 1506
 				$step = $field['type'] == 'float' ? ' step="0.1"' : '';
1448 1507
 
1449 1508
 
@@ -1451,9 +1510,10 @@  discard block
 block discarded – undo
1451 1510
 						<input type="', $type, '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' ', $step, '>';
1452 1511
 			}
1453 1512
 			// You "checking" me out? ;)
1454
-			elseif ($field['type'] == 'check')
1455
-				echo '
1513
+			elseif ($field['type'] == 'check') {
1514
+							echo '
1456 1515
 						<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>';
1516
+			}
1457 1517
 
1458 1518
 			// Always fun - select boxes!
1459 1519
 			elseif ($field['type'] == 'select')
@@ -1464,13 +1524,15 @@  discard block
 block discarded – undo
1464 1524
 				if (isset($field['options']))
1465 1525
 				{
1466 1526
 					// Is this some code to generate the options?
1467
-					if (!is_array($field['options']))
1468
-						$field['options'] = $field['options']();
1527
+					if (!is_array($field['options'])) {
1528
+											$field['options'] = $field['options']();
1529
+					}
1469 1530
 					// Assuming we now have some!
1470
-					if (is_array($field['options']))
1471
-						foreach ($field['options'] as $value => $name)
1531
+					if (is_array($field['options'])) {
1532
+											foreach ($field['options'] as $value => $name)
1472 1533
 							echo '
1473 1534
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
1535
+					}
1474 1536
 				}
1475 1537
 
1476 1538
 				echo '
@@ -1478,25 +1540,28 @@  discard block
 block discarded – undo
1478 1540
 			}
1479 1541
 
1480 1542
 			// Something to end with?
1481
-			if (!empty($field['postinput']))
1482
-				echo '
1543
+			if (!empty($field['postinput'])) {
1544
+							echo '
1483 1545
 							', $field['postinput'];
1546
+			}
1484 1547
 
1485 1548
 			echo '
1486 1549
 					</dd>';
1487 1550
 		}
1488 1551
 	}
1489 1552
 
1490
-	if (!empty($context['profile_fields']))
1491
-		echo '
1553
+	if (!empty($context['profile_fields'])) {
1554
+			echo '
1492 1555
 				</dl>';
1556
+	}
1493 1557
 
1494 1558
 	// Are there any custom profile fields - if so print them!
1495 1559
 	if (!empty($context['custom_fields']))
1496 1560
 	{
1497
-		if ($lastItem != 'hr')
1498
-			echo '
1561
+		if ($lastItem != 'hr') {
1562
+					echo '
1499 1563
 				<hr>';
1564
+		}
1500 1565
 
1501 1566
 		echo '
1502 1567
 				<dl class="settings">';
@@ -1519,13 +1584,14 @@  discard block
 block discarded – undo
1519 1584
 	}
1520 1585
 
1521 1586
 	// Any closing HTML?
1522
-	if (!empty($context['profile_posthtml']))
1523
-		echo '
1587
+	if (!empty($context['profile_posthtml'])) {
1588
+			echo '
1524 1589
 				<div>', $context['profile_posthtml'], '</div>';
1590
+	}
1525 1591
 
1526 1592
 	// Only show the password box if it's actually needed.
1527
-	if ($context['require_password'])
1528
-		echo '
1593
+	if ($context['require_password']) {
1594
+			echo '
1529 1595
 				<dl class="settings">
1530 1596
 					<dt>
1531 1597
 						<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br>
@@ -1535,18 +1601,21 @@  discard block
 block discarded – undo
1535 1601
 						<input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;">
1536 1602
 					</dd>
1537 1603
 				</dl>';
1604
+	}
1538 1605
 
1539 1606
 	// The button shouldn't say "Change profile" unless we're changing the profile...
1540
-	if (!empty($context['submit_button_text']))
1541
-		echo '
1607
+	if (!empty($context['submit_button_text'])) {
1608
+			echo '
1542 1609
 				<input type="submit" name="save" value="', $context['submit_button_text'], '" class="button">';
1543
-	else
1544
-		echo '
1610
+	} else {
1611
+			echo '
1545 1612
 				<input type="submit" name="save" value="', $txt['change_profile'], '" class="button">';
1613
+	}
1546 1614
 
1547
-	if (!empty($context['token_check']))
1548
-		echo '
1615
+	if (!empty($context['token_check'])) {
1616
+			echo '
1549 1617
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
1618
+	}
1550 1619
 
1551 1620
 	echo '
1552 1621
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1556,10 +1625,11 @@  discard block
 block discarded – undo
1556 1625
 		</form>';
1557 1626
 
1558 1627
 	// Any final spellchecking stuff?
1559
-	if (!empty($context['show_spellchecking']))
1560
-		echo '
1628
+	if (!empty($context['show_spellchecking'])) {
1629
+			echo '
1561 1630
 		<form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value=""></form>';
1562
-}
1631
+	}
1632
+	}
1563 1633
 
1564 1634
 /**
1565 1635
  * Personal Message settings.
@@ -1596,10 +1666,11 @@  discard block
 block discarded – undo
1596 1666
 										<select name="pm_receive_from" id="pm_receive_from">
1597 1667
 												<option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
1598 1668
 
1599
-	if (!empty($modSettings['enable_buddylist']))
1600
-		echo '
1669
+	if (!empty($modSettings['enable_buddylist'])) {
1670
+			echo '
1601 1671
 												<option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected' : '', '>', $txt['pm_receive_from_ignore'], '</option>
1602 1672
 												<option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
1673
+	}
1603 1674
 
1604 1675
 	echo '
1605 1676
 												<option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected' : '', '>', $txt['pm_receive_from_admins'], '</option>
@@ -1642,11 +1713,12 @@  discard block
 block discarded – undo
1642 1713
 		if (empty($setting) || !is_array($setting))
1643 1714
 		{
1644 1715
 			// Insert a separator (unless this is the first item in the list)
1645
-			if ($i !== $first_option_key)
1646
-				echo '
1716
+			if ($i !== $first_option_key) {
1717
+							echo '
1647 1718
 				</dl>
1648 1719
 				<hr>
1649 1720
 				<dl class="settings">';
1721
+			}
1650 1722
 
1651 1723
 			// Should we give a name to this section?
1652 1724
 			if (is_string($setting) && !empty($setting))
@@ -1654,48 +1726,52 @@  discard block
 block discarded – undo
1654 1726
 				$titled_section = true;
1655 1727
 				echo '
1656 1728
 					<dt><strong>' . $setting . '</strong></dt><dd></dd>';
1729
+			} else {
1730
+							$titled_section = false;
1657 1731
 			}
1658
-			else
1659
-				$titled_section = false;
1660 1732
 
1661 1733
 			continue;
1662 1734
 		}
1663 1735
 
1664 1736
 		// Is this disabled?
1665
-		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled']))
1666
-			continue;
1667
-		elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage']))
1668
-			continue;
1669
-		elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored']))
1670
-			continue;
1671
-		elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist']))
1672
-			continue;
1673
-		elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg']))
1674
-			continue;
1675
-		elseif ($setting['id'] == 'topics_per_page' && !empty($modSettings['disableCustomPerPage']))
1676
-			continue;
1677
-		elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1678
-			continue;
1679
-		elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled']))))
1680
-			continue;
1737
+		if ($setting['id'] == 'calendar_start_day' && empty($modSettings['cal_enabled'])) {
1738
+					continue;
1739
+		} elseif (($setting['id'] == 'topics_per_page' || $setting['id'] == 'messages_per_page') && !empty($modSettings['disableCustomPerPage'])) {
1740
+					continue;
1741
+		} elseif ($setting['id'] == 'show_no_censored' && empty($modSettings['allow_no_censored'])) {
1742
+					continue;
1743
+		} elseif ($setting['id'] == 'posts_apply_ignore_list' && empty($modSettings['enable_buddylist'])) {
1744
+					continue;
1745
+		} elseif ($setting['id'] == 'wysiwyg_default' && !empty($modSettings['disable_wysiwyg'])) {
1746
+					continue;
1747
+		} elseif ($setting['id'] == 'topics_per_page' && !empty($modSettings['disableCustomPerPage'])) {
1748
+					continue;
1749
+		} elseif ($setting['id'] == 'drafts_autosave_enabled' && (empty($modSettings['drafts_autosave_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1750
+					continue;
1751
+		} elseif ($setting['id'] == 'drafts_show_saved_enabled' && (empty($modSettings['drafts_show_saved_enabled']) || (empty($modSettings['drafts_post_enabled']) && empty($modSettings['drafts_pm_enabled'])))) {
1752
+					continue;
1753
+		}
1681 1754
 
1682
-		if (!isset($setting['type']) || $setting['type'] == 'bool')
1683
-			$setting['type'] = 'checkbox';
1684
-		elseif ($setting['type'] == 'int' || $setting['type'] == 'integer')
1685
-			$setting['type'] = 'number';
1686
-		elseif ($setting['type'] == 'string')
1687
-			$setting['type'] = 'text';
1755
+		if (!isset($setting['type']) || $setting['type'] == 'bool') {
1756
+					$setting['type'] = 'checkbox';
1757
+		} elseif ($setting['type'] == 'int' || $setting['type'] == 'integer') {
1758
+					$setting['type'] = 'number';
1759
+		} elseif ($setting['type'] == 'string') {
1760
+					$setting['type'] = 'text';
1761
+		}
1688 1762
 
1689
-		if (isset($setting['options']))
1690
-			$setting['type'] = 'list';
1763
+		if (isset($setting['options'])) {
1764
+					$setting['type'] = 'list';
1765
+		}
1691 1766
 
1692 1767
 		echo '
1693 1768
 					<dt>
1694 1769
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
1695 1770
 
1696
-		if (isset($setting['description']))
1697
-			echo '
1771
+		if (isset($setting['description'])) {
1772
+					echo '
1698 1773
 						<br><span class="smalltext">', $setting['description'], '</span>';
1774
+		}
1699 1775
 		echo '
1700 1776
 					</dt>
1701 1777
 					<dd>';
@@ -1733,13 +1809,11 @@  discard block
 block discarded – undo
1733 1809
 
1734 1810
 				echo '
1735 1811
 						<input type="number"', $min . $max . $step;
1736
-			}
1737
-			else if (isset($setting['type']) && $setting['type'] == 'url')
1812
+			} else if (isset($setting['type']) && $setting['type'] == 'url')
1738 1813
 			{
1739 1814
 				echo'
1740 1815
 						<input type="url"';
1741
-			}
1742
-			else
1816
+			} else
1743 1817
 			{
1744 1818
 				echo '
1745 1819
 						<input type="text"';
@@ -1778,8 +1852,8 @@  discard block
 block discarded – undo
1778 1852
 				<dl class="settings">';
1779 1853
 
1780 1854
 	// Allow notification on announcements to be disabled?
1781
-	if (!empty($modSettings['allow_disableAnnounce']))
1782
-		echo '
1855
+	if (!empty($modSettings['allow_disableAnnounce'])) {
1856
+			echo '
1783 1857
 					<dt>
1784 1858
 						<label for="notify_announcements">', $txt['notify_important_email'], '</label>
1785 1859
 					</dt>
@@ -1787,9 +1861,10 @@  discard block
 block discarded – undo
1787 1861
 						<input type="hidden" name="notify_announcements" value="0">
1788 1862
 						<input type="checkbox" id="notify_announcements" name="notify_announcements" value="1"', !empty($context['member']['notify_announcements']) ? ' checked' : '', '>
1789 1863
 					</dd>';
1864
+	}
1790 1865
 
1791
-	if (!empty($modSettings['enable_ajax_alerts']))
1792
-		echo '
1866
+	if (!empty($modSettings['enable_ajax_alerts'])) {
1867
+			echo '
1793 1868
 					<dt>
1794 1869
 						<label for="notify_send_body">', $txt['notify_alert_timeout'], '</label>
1795 1870
 					</dt>
@@ -1797,6 +1872,7 @@  discard block
 block discarded – undo
1797 1872
 						<input type="number" size="4" id="notify_alert_timeout" name="opt_alert_timeout" min="0" value="', $context['member']['alert_timeout'], '">
1798 1873
 					</dd>
1799 1874
 		';
1875
+	}
1800 1876
 
1801 1877
 	echo '
1802 1878
 				</dl>
@@ -1826,9 +1902,10 @@  discard block
 block discarded – undo
1826 1902
 					<td colspan="3">';
1827 1903
 				$label = $txt['alert_opt_' . $opts[1]];
1828 1904
 				$label_pos = isset($opts['label']) ? $opts['label'] : '';
1829
-				if ($label_pos == 'before')
1830
-					echo '
1905
+				if ($label_pos == 'before') {
1906
+									echo '
1831 1907
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1908
+				}
1832 1909
 
1833 1910
 				$this_value = isset($context['alert_prefs'][$opts[1]]) ? $context['alert_prefs'][$opts[1]] : 0;
1834 1911
 				switch ($opts[0])
@@ -1840,17 +1917,19 @@  discard block
 block discarded – undo
1840 1917
 					case 'select':
1841 1918
 						echo '
1842 1919
 						<select name="opt_', $opts[1], '" id="opt_', $opts[1], '">';
1843
-						foreach ($opts['opts'] as $k => $v)
1844
-							echo '
1920
+						foreach ($opts['opts'] as $k => $v) {
1921
+													echo '
1845 1922
 							<option value="', $k, '"', $this_value == $k ? ' selected' : '', '>', $v, '</option>';
1923
+						}
1846 1924
 						echo '
1847 1925
 						</select>';
1848 1926
 						break;
1849 1927
 				}
1850 1928
 
1851
-				if ($label_pos == 'after')
1852
-					echo '
1929
+				if ($label_pos == 'after') {
1930
+									echo '
1853 1931
 					<label for="opt_', $opts[1], '">', $label, '</label>';
1932
+				}
1854 1933
 
1855 1934
 				echo '
1856 1935
 					</td>
@@ -1964,11 +2043,12 @@  discard block
 block discarded – undo
1964 2043
 			<p class="information">', $txt['groupMembership_info'], '</p>';
1965 2044
 
1966 2045
 	// Do we have an update message?
1967
-	if (!empty($context['update_message']))
1968
-		echo '
2046
+	if (!empty($context['update_message'])) {
2047
+			echo '
1969 2048
 			<div class="infobox">
1970 2049
 				', $context['update_message'], '.
1971 2050
 			</div>';
2051
+	}
1972 2052
 
1973 2053
 	echo '
1974 2054
 		<div id="groups">';
@@ -1990,8 +2070,7 @@  discard block
 block discarded – undo
1990 2070
 					</div>
1991 2071
 				</div>
1992 2072
 			</div>';
1993
-	}
1994
-	else
2073
+	} else
1995 2074
 	{
1996 2075
 		echo '
1997 2076
 			<div class="title_bar">
@@ -2003,27 +2082,30 @@  discard block
 block discarded – undo
2003 2082
 			echo '
2004 2083
 					<div class="windowbg" id="primdiv_', $group['id'], '">';
2005 2084
 
2006
-				if ($context['can_edit_primary'])
2007
-					echo '
2085
+				if ($context['can_edit_primary']) {
2086
+									echo '
2008 2087
 						<input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '"', $group['is_primary'] ? ' checked' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"', $group['can_be_primary'] ? '' : ' disabled', '>';
2088
+				}
2009 2089
 
2010 2090
 				echo '
2011 2091
 						<label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>';
2012 2092
 
2013 2093
 				// Can they leave their group?
2014
-				if ($group['can_leave'])
2015
-					echo '
2094
+				if ($group['can_leave']) {
2095
+									echo '
2016 2096
 						<a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>';
2097
+				}
2017 2098
 
2018 2099
 				echo '
2019 2100
 					</div>';
2020 2101
 		}
2021 2102
 
2022
-		if ($context['can_edit_primary'])
2023
-			echo '
2103
+		if ($context['can_edit_primary']) {
2104
+					echo '
2024 2105
 			<div class="padding righttext">
2025 2106
 				<input type="submit" value="', $txt['make_primary'], '" class="button">
2026 2107
 			</div>';
2108
+		}
2027 2109
 
2028 2110
 		// Any groups they can join?
2029 2111
 		if (!empty($context['groups']['available']))
@@ -2039,15 +2121,16 @@  discard block
 block discarded – undo
2039 2121
 					<div class="windowbg">
2040 2122
 						<strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br><span class="smalltext">' . $group['desc'] . '</span>' : ''), '';
2041 2123
 
2042
-				if ($group['type'] == 3)
2043
-					echo '
2124
+				if ($group['type'] == 3) {
2125
+									echo '
2044 2126
 						<a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '" class="button floatright">', $txt['join_group'], '</a>';
2045
-				elseif ($group['type'] == 2 && $group['pending'])
2046
-					echo '
2127
+				} elseif ($group['type'] == 2 && $group['pending']) {
2128
+									echo '
2047 2129
 						<span class="floatright">', $txt['approval_pending'], '</span>';
2048
-				elseif ($group['type'] == 2)
2049
-					echo '
2130
+				} elseif ($group['type'] == 2) {
2131
+									echo '
2050 2132
 						<a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '" class="button floatright">', $txt['request_group'], '</a>';
2133
+				}
2051 2134
 
2052 2135
 				echo '
2053 2136
 					</div>';
@@ -2070,9 +2153,10 @@  discard block
 block discarded – undo
2070 2153
 
2071 2154
 			prevDiv.className = "windowbg";
2072 2155
 		}';
2073
-		if (isset($context['groups']['member'][$context['primary_group']]))
2074
-			echo '
2156
+		if (isset($context['groups']['member'][$context['primary_group']])) {
2157
+					echo '
2075 2158
 		highlightSelected("primdiv_' . $context['primary_group'] . '");';
2159
+		}
2076 2160
 		echo '
2077 2161
 	</script>';
2078 2162
 	}
@@ -2080,9 +2164,10 @@  discard block
 block discarded – undo
2080 2164
 	echo '
2081 2165
 		</div>';
2082 2166
 
2083
-	if (!empty($context['token_check']))
2084
-		echo '
2167
+	if (!empty($context['token_check'])) {
2168
+			echo '
2085 2169
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2170
+	}
2086 2171
 
2087 2172
 	echo '
2088 2173
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2129,14 +2214,15 @@  discard block
 block discarded – undo
2129 2214
 
2130 2215
 		foreach ($category['boards'] as $board)
2131 2216
 		{
2132
-			if ($i == $limit)
2133
-				echo '
2217
+			if ($i == $limit) {
2218
+							echo '
2134 2219
 						</ul>
2135 2220
 					</li>
2136 2221
 				</ul>
2137 2222
 				<ul class="ignoreboards floatright">
2138 2223
 					<li class="category">
2139 2224
 						<ul>';
2225
+			}
2140 2226
 
2141 2227
 			echo '
2142 2228
 							<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
@@ -2182,10 +2268,11 @@  discard block
 block discarded – undo
2182 2268
 
2183 2269
 	// Work out the starting color.
2184 2270
 	$context['current_color'] = $context['colors'][0];
2185
-	foreach ($context['colors'] as $limit => $color)
2186
-		if ($context['member']['warning'] >= $limit)
2271
+	foreach ($context['colors'] as $limit => $color) {
2272
+			if ($context['member']['warning'] >= $limit)
2187 2273
 			$context['current_color'] = $color;
2188
-}
2274
+	}
2275
+	}
2189 2276
 
2190 2277
 // Show all warnings of a user?
2191 2278
 function template_viewWarning()
@@ -2224,14 +2311,15 @@  discard block
 block discarded – undo
2224 2311
 				</dd>';
2225 2312
 
2226 2313
 		// There's some impact of this?
2227
-		if (!empty($context['level_effects'][$context['current_level']]))
2228
-			echo '
2314
+		if (!empty($context['level_effects'][$context['current_level']])) {
2315
+					echo '
2229 2316
 				<dt>
2230 2317
 					<strong>', $txt['profile_viewwarning_impact'], ':</strong>
2231 2318
 				</dt>
2232 2319
 				<dd>
2233 2320
 					', $context['level_effects'][$context['current_level']], '
2234 2321
 				</dd>';
2322
+		}
2235 2323
 
2236 2324
 		echo '
2237 2325
 			</dl>
@@ -2269,10 +2357,11 @@  discard block
 block discarded – undo
2269 2357
 
2270 2358
 			// Otherwise see what we can do...';
2271 2359
 
2272
-	foreach ($context['notification_templates'] as $k => $type)
2273
-		echo '
2360
+	foreach ($context['notification_templates'] as $k => $type) {
2361
+			echo '
2274 2362
 			if (index == ', $k, ')
2275 2363
 				document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
2364
+	}
2276 2365
 
2277 2366
 	echo '
2278 2367
 		}
@@ -2282,10 +2371,11 @@  discard block
 block discarded – undo
2282 2371
 			// Also set the right effect.
2283 2372
 			effectText = "";';
2284 2373
 
2285
-	foreach ($context['level_effects'] as $limit => $text)
2286
-		echo '
2374
+	foreach ($context['level_effects'] as $limit => $text) {
2375
+			echo '
2287 2376
 			if (slideAmount >= ', $limit, ')
2288 2377
 				effectText = "', $text, '";';
2378
+	}
2289 2379
 
2290 2380
 	echo '
2291 2381
 			setInnerHTML(document.getElementById(\'cur_level_div\'), slideAmount + \'% (\' + effectText + \')\');
@@ -2300,31 +2390,34 @@  discard block
 block discarded – undo
2300 2390
 			</h3>
2301 2391
 		</div>';
2302 2392
 
2303
-	if (!$context['user']['is_owner'])
2304
-		echo '
2393
+	if (!$context['user']['is_owner']) {
2394
+			echo '
2305 2395
 		<p class="information">', $txt['profile_warning_desc'], '</p>';
2396
+	}
2306 2397
 
2307 2398
 	echo '
2308 2399
 		<div class="windowbg">
2309 2400
 			<dl class="settings">';
2310 2401
 
2311
-	if (!$context['user']['is_owner'])
2312
-		echo '
2402
+	if (!$context['user']['is_owner']) {
2403
+			echo '
2313 2404
 				<dt>
2314 2405
 					<strong>', $txt['profile_warning_name'], ':</strong>
2315 2406
 				</dt>
2316 2407
 				<dd>
2317 2408
 					<strong>', $context['member']['name'], '</strong>
2318 2409
 				</dd>';
2410
+	}
2319 2411
 
2320 2412
 	echo '
2321 2413
 				<dt>
2322 2414
 					<strong>', $txt['profile_warning_level'], ':</strong>';
2323 2415
 
2324 2416
 	// Is there only so much they can apply?
2325
-	if ($context['warning_limit'])
2326
-		echo '
2417
+	if ($context['warning_limit']) {
2418
+			echo '
2327 2419
 					<br><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
2420
+	}
2328 2421
 
2329 2422
 	echo '
2330 2423
 				</dt>
@@ -2377,9 +2470,10 @@  discard block
 block discarded – undo
2377 2470
 						<option value="-1">', $txt['profile_warning_notify_template'], '</option>
2378 2471
 						<option value="-1" disabled>------------------------------</option>';
2379 2472
 
2380
-		foreach ($context['notification_templates'] as $id_template => $template)
2381
-			echo '
2473
+		foreach ($context['notification_templates'] as $id_template => $template) {
2474
+					echo '
2382 2475
 						<option value="', $id_template, '">', $template['title'], '</option>';
2476
+		}
2383 2477
 
2384 2478
 		echo '
2385 2479
 					</select>
@@ -2391,9 +2485,10 @@  discard block
 block discarded – undo
2391 2485
 			</dl>
2392 2486
 			<div class="righttext">';
2393 2487
 
2394
-	if (!empty($context['token_check']))
2395
-		echo '
2488
+	if (!empty($context['token_check'])) {
2489
+			echo '
2396 2490
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2491
+	}
2397 2492
 
2398 2493
 	echo '
2399 2494
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2409,8 +2504,8 @@  discard block
 block discarded – undo
2409 2504
 	echo '
2410 2505
 	<script>';
2411 2506
 
2412
-	if (!$context['user']['is_owner'])
2413
-		echo '
2507
+	if (!$context['user']['is_owner']) {
2508
+			echo '
2414 2509
 		modifyWarnNotify();
2415 2510
 		$(document).ready(function() {
2416 2511
 			$("#preview_button").click(function() {
@@ -2449,6 +2544,7 @@  discard block
 block discarded – undo
2449 2544
 			});
2450 2545
 			return false;
2451 2546
 		}';
2547
+	}
2452 2548
 
2453 2549
 	echo '
2454 2550
 	</script>';
@@ -2471,16 +2567,18 @@  discard block
 block discarded – undo
2471 2567
 			</div>';
2472 2568
 
2473 2569
 	// If deleting another account give them a lovely info box.
2474
-	if (!$context['user']['is_owner'])
2475
-		echo '
2570
+	if (!$context['user']['is_owner']) {
2571
+			echo '
2476 2572
 			<p class="information">', $txt['deleteAccount_desc'], '</p>';
2573
+	}
2477 2574
 	echo '
2478 2575
 			<div class="windowbg2">';
2479 2576
 
2480 2577
 	// If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
2481
-	if ($context['needs_approval'])
2482
-		echo '
2578
+	if ($context['needs_approval']) {
2579
+			echo '
2483 2580
 				<div class="errorbox">', $txt['deleteAccount_approval'], '</div>';
2581
+	}
2484 2582
 
2485 2583
 	// If the user is deleting their own account warn them first - and require a password!
2486 2584
 	if ($context['user']['is_owner'])
@@ -2492,9 +2590,10 @@  discard block
 block discarded – undo
2492 2590
 					<input type="password" name="oldpasswrd" size="20">&nbsp;&nbsp;&nbsp;&nbsp;
2493 2591
 					<input type="submit" value="', $txt['yes'], '" class="button">';
2494 2592
 
2495
-		if (!empty($context['token_check']))
2496
-			echo '
2593
+		if (!empty($context['token_check'])) {
2594
+					echo '
2497 2595
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2596
+		}
2498 2597
 
2499 2598
 		echo '
2500 2599
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2520,9 +2619,10 @@  discard block
 block discarded – undo
2520 2619
 						<option value="topics">', $txt['deleteAccount_topics'], '</option>
2521 2620
 					</select>';
2522 2621
 
2523
-			if ($context['show_perma_delete'])
2524
-				echo '
2622
+			if ($context['show_perma_delete']) {
2623
+							echo '
2525 2624
 					<br><label for="perma_delete"><input type="checkbox" name="perma_delete" id="perma_delete" value="1">', $txt['deleteAccount_permanent'], ':</label>';
2625
+			}
2526 2626
 
2527 2627
 			echo '
2528 2628
 				</div>';
@@ -2535,9 +2635,10 @@  discard block
 block discarded – undo
2535 2635
 				<div>
2536 2636
 					<input type="submit" value="', $txt['delete'], '" class="button">';
2537 2637
 
2538
-		if (!empty($context['token_check']))
2539
-			echo '
2638
+		if (!empty($context['token_check'])) {
2639
+					echo '
2540 2640
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2641
+		}
2541 2642
 
2542 2643
 		echo '
2543 2644
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -2563,8 +2664,8 @@  discard block
 block discarded – undo
2563 2664
 					<hr>';
2564 2665
 
2565 2666
 	// Only show the password box if it's actually needed.
2566
-	if ($context['require_password'])
2567
-		echo '
2667
+	if ($context['require_password']) {
2668
+			echo '
2568 2669
 					<dl class="settings">
2569 2670
 						<dt>
2570 2671
 							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br>
@@ -2574,13 +2675,15 @@  discard block
 block discarded – undo
2574 2675
 							<input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;">
2575 2676
 						</dd>
2576 2677
 					</dl>';
2678
+	}
2577 2679
 
2578 2680
 	echo '
2579 2681
 					<div class="righttext">';
2580 2682
 
2581
-		if (!empty($context['token_check']))
2582
-			echo '
2683
+		if (!empty($context['token_check'])) {
2684
+					echo '
2583 2685
 				<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '">';
2686
+		}
2584 2687
 
2585 2688
 	echo '
2586 2689
 						<input type="submit" value="', $txt['change_profile'], '" class="button">
@@ -2607,9 +2710,10 @@  discard block
 block discarded – undo
2607 2710
 			<ul id="list_errors">';
2608 2711
 
2609 2712
 		// Cycle through each error and display an error message.
2610
-		foreach ($context['post_errors'] as $error)
2611
-			echo '
2713
+		foreach ($context['post_errors'] as $error) {
2714
+					echo '
2612 2715
 				<li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '</li>';
2716
+		}
2613 2717
 
2614 2718
 		echo '
2615 2719
 			</ul>';
@@ -2635,12 +2739,13 @@  discard block
 block discarded – undo
2635 2739
 								<select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 &amp;&amp; !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>';
2636 2740
 
2637 2741
 		// Fill the select box with all primary member groups that can be assigned to a member.
2638
-		foreach ($context['member_groups'] as $member_group)
2639
-			if (!empty($member_group['can_be_primary']))
2742
+		foreach ($context['member_groups'] as $member_group) {
2743
+					if (!empty($member_group['can_be_primary']))
2640 2744
 				echo '
2641 2745
 									<option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected' : '', '>
2642 2746
 										', $member_group['name'], '
2643 2747
 									</option>';
2748
+		}
2644 2749
 		echo '
2645 2750
 								</select>
2646 2751
 							</dd>
@@ -2652,10 +2757,11 @@  discard block
 block discarded – undo
2652 2757
 									<input type="hidden" name="additional_groups[]" value="0">';
2653 2758
 
2654 2759
 		// For each membergroup show a checkbox so members can be assigned to more than one group.
2655
-		foreach ($context['member_groups'] as $member_group)
2656
-			if ($member_group['can_be_additional'])
2760
+		foreach ($context['member_groups'] as $member_group) {
2761
+					if ($member_group['can_be_additional'])
2657 2762
 				echo '
2658 2763
 									<label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked' : '', '> ', $member_group['name'], '</label><br>';
2764
+		}
2659 2765
 		echo '
2660 2766
 								</span>
2661 2767
 								<a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;" class="toggle_down">', $txt['additional_membergroups_show'], '</a>
@@ -2715,9 +2821,10 @@  discard block
 block discarded – undo
2715 2821
 								<span class="smalltext">', $txt['sig_info'], '</span><br>
2716 2822
 								<br>';
2717 2823
 
2718
-	if ($context['show_spellchecking'])
2719
-		echo '
2824
+	if ($context['show_spellchecking']) {
2825
+			echo '
2720 2826
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button">';
2827
+	}
2721 2828
 
2722 2829
 		echo '
2723 2830
 							</dt>
@@ -2725,17 +2832,20 @@  discard block
 block discarded – undo
2725 2832
 								<textarea class="editor" onkeyup="calcCharLeft();" id="signature" name="signature" rows="5" cols="50" style="min-width: 50%; max-width: 99%;">', $context['member']['signature'], '</textarea><br>';
2726 2833
 
2727 2834
 	// If there is a limit at all!
2728
-	if (!empty($context['signature_limits']['max_length']))
2729
-		echo '
2835
+	if (!empty($context['signature_limits']['max_length'])) {
2836
+			echo '
2730 2837
 								<span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br>';
2838
+	}
2731 2839
 
2732
-	if (!empty($context['show_preview_button']))
2733
-		echo '
2840
+	if (!empty($context['show_preview_button'])) {
2841
+			echo '
2734 2842
 								<input type="button" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button">';
2843
+	}
2735 2844
 
2736
-	if ($context['signature_warning'])
2737
-		echo '
2845
+	if ($context['signature_warning']) {
2846
+			echo '
2738 2847
 								<span class="smalltext">', $context['signature_warning'], '</span>';
2848
+	}
2739 2849
 
2740 2850
 	// Some javascript used to count how many characters have been used so far in the signature.
2741 2851
 	echo '
@@ -2779,9 +2889,10 @@  discard block
 block discarded – undo
2779 2889
 									<div>
2780 2890
 										<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
2781 2891
 		// This lists all the file categories.
2782
-		foreach ($context['avatars'] as $avatar)
2783
-			echo '
2892
+		foreach ($context['avatars'] as $avatar) {
2893
+					echo '
2784 2894
 											<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected' : ''), '>', $avatar['name'], '</option>';
2895
+		}
2785 2896
 		echo '
2786 2897
 										</select>
2787 2898
 									</div>
@@ -2836,16 +2947,17 @@  discard block
 block discarded – undo
2836 2947
 								<div id="avatar_gravatar">
2837 2948
 									<img src="' . $context['member']['avatar']['href'] . '" alt="" />';
2838 2949
 
2839
-		if (empty($modSettings['gravatarAllowExtraEmail']))
2840
-			echo '
2950
+		if (empty($modSettings['gravatarAllowExtraEmail'])) {
2951
+					echo '
2841 2952
 									<div class="smalltext">', $txt['gravatar_noAlternateEmail'], '</div>';
2842
-		else
2953
+		} else
2843 2954
 		{
2844 2955
 			// Depending on other stuff, the stored value here might have some odd things in it from other areas.
2845
-			if ($context['member']['avatar']['external'] == $context['member']['email'])
2846
-				$textbox_value = '';
2847
-			else
2848
-				$textbox_value = $context['member']['avatar']['external'];
2956
+			if ($context['member']['avatar']['external'] == $context['member']['email']) {
2957
+							$textbox_value = '';
2958
+			} else {
2959
+							$textbox_value = $context['member']['avatar']['external'];
2960
+			}
2849 2961
 
2850 2962
 			echo '
2851 2963
 									<div class="smalltext">', $txt['gravatar_alternateEmail'], '</div>
@@ -2917,8 +3029,9 @@  discard block
 block discarded – undo
2917 3029
 	$h = !empty($modSettings['avatar_max_height_' . $type]) ? comma_format($modSettings['avatar_max_height_' . $type]) : 0;
2918 3030
 
2919 3031
 	$suffix = (!empty($w) ? 'w' : '') . (!empty($h) ? 'h' : '');
2920
-	if (empty($suffix))
2921
-		return;
3032
+	if (empty($suffix)) {
3033
+			return;
3034
+	}
2922 3035
 
2923 3036
 	echo '
2924 3037
 									<div class="smalltext">', sprintf($txt['avatar_max_size_' . $suffix], $w, $h), '</div>';
@@ -2940,9 +3053,10 @@  discard block
 block discarded – undo
2940 3053
 							<dd>
2941 3054
 								<select name="easyformat" id="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
2942 3055
 	// Help the user by showing a list of common time formats.
2943
-	foreach ($context['easy_timeformats'] as $time_format)
2944
-		echo '
3056
+	foreach ($context['easy_timeformats'] as $time_format) {
3057
+			echo '
2945 3058
 									<option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected' : '', '>', $time_format['title'], '</option>';
3059
+	}
2946 3060
 	echo '
2947 3061
 								</select><br>
2948 3062
 								<input type="text" name="time_format" id="time_format" value="', $context['member']['time_format'], '" size="30">
@@ -2978,9 +3092,10 @@  discard block
 block discarded – undo
2978 3092
 							</dt>
2979 3093
 							<dd>
2980 3094
 								<select name="smiley_set" id="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.png\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
2981
-	foreach ($context['smiley_sets'] as $set)
2982
-		echo '
3095
+	foreach ($context['smiley_sets'] as $set) {
3096
+			echo '
2983 3097
 									<option value="', $set['id'], '"', $set['selected'] ? ' selected' : '', '>', $set['name'], '</option>';
3098
+	}
2984 3099
 	echo '
2985 3100
 								</select> <img id="smileypr" class="centericon" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.png', '" alt=":)"  style="padding-left: 20px;">
2986 3101
 							</dd>';
@@ -3031,10 +3146,11 @@  discard block
 block discarded – undo
3031 3146
 									</div>
3032 3147
 									<div class="clear"></div>';
3033 3148
 
3034
-	if (!empty($context['from_ajax']))
3035
-		echo '
3149
+	if (!empty($context['from_ajax'])) {
3150
+			echo '
3036 3151
 									<br>
3037 3152
 									<a href="javascript:self.close();"></a>';
3153
+	}
3038 3154
 
3039 3155
 	echo '
3040 3156
 								</div>
@@ -3073,15 +3189,16 @@  discard block
 block discarded – undo
3073 3189
 								<br><div class="smalltext">', $txt['tfa_profile_desc'], '</div>
3074 3190
 							</dt>
3075 3191
 							<dd>';
3076
-	if (!$context['tfa_enabled'] && $context['user']['is_owner'])
3077
-		echo '
3192
+	if (!$context['tfa_enabled'] && $context['user']['is_owner']) {
3193
+			echo '
3078 3194
 								<a href="', !empty($modSettings['force_ssl']) && $modSettings['force_ssl'] < 2 ? strtr($scripturl, array('http://' => 'https://')) : $scripturl, '?action=profile;area=tfasetup" id="enable_tfa">', $txt['tfa_profile_enable'], '</a>';
3079
-	elseif (!$context['tfa_enabled'])
3080
-		echo '
3195
+	} elseif (!$context['tfa_enabled']) {
3196
+			echo '
3081 3197
 								', $txt['tfa_profile_disabled'];
3082
-	else
3083
-		echo '
3198
+	} else {
3199
+			echo '
3084 3200
 							', sprintf($txt['tfa_profile_enabled'], $scripturl . '?action=profile;u=' . $context['id_member'] . ';area=tfasetup;disable');
3201
+	}
3085 3202
 	echo '
3086 3203
 							</dd>';
3087 3204
 }
Please login to merge, or discard this patch.
Themes/default/ManageCalendar.template.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,9 +39,10 @@  discard block
 block discarded – undo
39 39
 						<select name="year" id="year" onchange="generateDays();">
40 40
 							<option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>';
41 41
 	// Show a list of all the years we allow...
42
-	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
43
-		echo '
42
+	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
43
+			echo '
44 44
 							<option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>';
45
+	}
45 46
 
46 47
 	echo '
47 48
 						</select>&nbsp;
@@ -49,9 +50,10 @@  discard block
 block discarded – undo
49 50
 						<select name="month" id="month" onchange="generateDays();">';
50 51
 
51 52
 	// There are 12 months per year - ensure that they all get listed.
52
-	for ($month = 1; $month <= 12; $month++)
53
-		echo '
53
+	for ($month = 1; $month <= 12; $month++) {
54
+			echo '
54 55
 							<option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
56
+	}
55 57
 
56 58
 	echo '
57 59
 						</select>&nbsp;
@@ -59,23 +61,25 @@  discard block
 block discarded – undo
59 61
 						<select name="day" id="day" onchange="generateDays();">';
60 62
 
61 63
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
62
-	for ($day = 1; $day <= $context['holiday']['last_day']; $day++)
63
-		echo '
64
+	for ($day = 1; $day <= $context['holiday']['last_day']; $day++) {
65
+			echo '
64 66
 							<option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>';
67
+	}
65 68
 
66 69
 	echo '
67 70
 						</select>
68 71
 					</dd>
69 72
 				</dl>';
70 73
 
71
-	if ($context['is_new'])
72
-		echo '
74
+	if ($context['is_new']) {
75
+			echo '
73 76
 				<input type="submit" value="', $txt['holidays_button_add'], '" class="button">';
74
-	else
75
-		echo '
77
+	} else {
78
+			echo '
76 79
 				<input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button">
77 80
 				<input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button">
78 81
 				<input type="hidden" name="holiday" value="', $context['holiday']['id'], '">';
82
+	}
79 83
 	echo '
80 84
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
81 85
 			</div>
Please login to merge, or discard this patch.
Themes/default/PersonalMessage.template.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 			foreach ($message['custom_fields']['above_member'] as $custom)
233 233
 				echo '
234
-					<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
234
+					<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
235 235
 
236 236
 			echo '
237 237
 				</ul>
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		if (!empty($message['custom_fields']['below_avatar']))
269 269
 			foreach ($message['custom_fields']['below_avatar'] as $custom)
270 270
 				echo '
271
-				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
271
+				<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
272 272
 
273 273
 			if (!$message['member']['is_guest'])
274 274
 				echo '
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 					foreach ($message['custom_fields']['icons'] as $custom)
312 312
 						echo '
313
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
313
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
314 314
 
315 315
 					echo '
316 316
 					</ol>
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 				if (!empty($message['custom_fields']['standard']))
369 369
 					foreach ($message['custom_fields']['standard'] as $custom)
370 370
 						echo '
371
-				<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
371
+				<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
372 372
 
373 373
 				// Are we showing the warning status?
374 374
 				if ($message['member']['can_see_warning'])
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				if (!empty($message['custom_fields']['bottom_poster']))
380 380
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
381 381
 						echo '
382
-				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
382
+				<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
383 383
 			}
384 384
 
385 385
 			// Done with the information about the poster... on to the post itself.
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 
478 478
 				foreach ($message['custom_fields']['above_signature'] as $custom)
479 479
 					echo '
480
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
480
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
481 481
 
482 482
 				echo '
483 483
 						</ul>
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
 				foreach ($message['custom_fields']['below_signature'] as $custom)
500 500
 					echo '
501
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
501
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
502 502
 
503 503
 				echo '
504 504
 						</ul>
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 	while ($message = $context['get_pmessage']('subject'))
631 631
 	{
632 632
 		echo '
633
-		<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
633
+		<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
634 634
 			<td class="table_icon">
635 635
 			<script>
636 636
 				currentLabels[', $message['id'], '] = {';
@@ -902,12 +902,12 @@  discard block
 block discarded – undo
902 902
 					// You can only reply if they are not a guest...
903 903
 					if (!$message['member']['is_guest'])
904 904
 						echo '
905
-							<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'], '
906
-							<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'];
905
+							<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'], '
906
+							<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'];
907 907
 					// This is for "forwarding" - even if the member is gone.
908 908
 					else
909 909
 						echo '
910
-							<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'];
910
+							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
911 911
 				}
912 912
 
913 913
 				echo '
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 			<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1008 1008
 				<dl>
1009 1009
 					<dt>
1010
-						<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1010
+						<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1011 1011
 					</dt>
1012 1012
 					<dd class="error" id="error_list">
1013 1013
 						', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 					<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1064 1064
 				</dt>
1065 1065
 				<dd id="pm_subject">
1066
-					<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/>
1066
+					<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/>
1067 1067
 				</dd>
1068 1068
 			</dl><hr>';
1069 1069
 
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
 		echo '
1427 1427
 		<div class="padding">
1428 1428
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1429
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1429
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1430 1430
 		</div>';
1431 1431
 
1432 1432
 	echo '
@@ -1590,7 +1590,7 @@  discard block
 block discarded – undo
1590 1590
 	if (!empty($context['rules']))
1591 1591
 		echo '
1592 1592
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1593
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1593
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1594 1594
 
1595 1595
 	echo '
1596 1596
 		</div>
@@ -1831,9 +1831,9 @@  discard block
 block discarded – undo
1831 1831
 
1832 1832
 		echo '
1833 1833
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1834
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1835
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1836
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1834
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1835
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1836
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1837 1837
 				</select>
1838 1838
 				<span id="labdiv', $k, '">
1839 1839
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
 					</div>
1946 1946
 					<ul class="quickbuttons">
1947 1947
 						<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li>
1948
-						<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1948
+						<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1949 1949
 					</ul>
1950 1950
 				</div>';
1951 1951
 		}
Please login to merge, or discard this patch.
Braces   +262 added lines, -181 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 	<div id="personal_messages">';
22 22
 
23 23
 	// Show the capacity bar, if available.
24
-	if (!empty($context['limit_bar']))
25
-		echo '
24
+	if (!empty($context['limit_bar'])) {
25
+			echo '
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['pm_capacity'], ':</span>
@@ -32,14 +32,16 @@  discard block
 block discarded – undo
32 32
 				<span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span>
33 33
 			</h3>
34 34
 		</div>';
35
+	}
35 36
 
36 37
 	// Message sent? Show a small indication.
37
-	if (isset($context['pm_sent']))
38
-		echo '
38
+	if (isset($context['pm_sent'])) {
39
+			echo '
39 40
 		<div class="infobox">
40 41
 			', $txt['pm_sent'], '
41 42
 		</div>';
42
-}
43
+	}
44
+	}
43 45
 
44 46
 /**
45 47
  * Just the end of the index bar, nothing special.
@@ -72,8 +74,7 @@  discard block
 block discarded – undo
72 74
 	{
73 75
 		echo '
74 76
 			<div class="no_unread">', $txt['pm_no_unread'], '</div>';
75
-	}
76
-	else
77
+	} else
77 78
 	{
78 79
 		foreach ($context['unread_pms'] as $id_pm => $pm_details)
79 80
 		{
@@ -193,14 +194,15 @@  discard block
 block discarded – undo
193 194
 	if ($context['get_pmessage']('message', true))
194 195
 	{
195 196
 		// Show the helpful titlebar - generally.
196
-		if ($context['display_mode'] != 1)
197
-			echo '
197
+		if ($context['display_mode'] != 1) {
198
+					echo '
198 199
 				<div class="cat_bar">
199 200
 					<h3 class="catbg">
200 201
 						<span id="author">', $txt['author'], '</span>
201 202
 						<span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span>
202 203
 					</h3>
203 204
 				</div>';
205
+		}
204 206
 
205 207
 		// Show a few buttons if we are in conversation mode and outputting the first message.
206 208
 		if ($context['display_mode'] == 2)
@@ -229,9 +231,10 @@  discard block
 block discarded – undo
229 231
 			<div class="custom_fields_above_member">
230 232
 				<ul class="nolist">';
231 233
 
232
-			foreach ($message['custom_fields']['above_member'] as $custom)
233
-				echo '
234
+			foreach ($message['custom_fields']['above_member'] as $custom) {
235
+							echo '
234 236
 					<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
237
+			}
235 238
 
236 239
 			echo '
237 240
 				</ul>
@@ -243,9 +246,10 @@  discard block
 block discarded – undo
243 246
 				<a id="msg', $message['id'], '"></a>';
244 247
 
245 248
 		// Show online and offline buttons?
246
-		if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
247
-			echo '
249
+		if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
250
+					echo '
248 251
 				<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>';
252
+		}
249 253
 
250 254
 		// Show a link to the member's profile (but only if the sender isn't a guest).
251 255
 				echo '
@@ -258,48 +262,56 @@  discard block
 block discarded – undo
258 262
 			<ul class="user_info">';
259 263
 
260 264
 			// Show the user's avatar.
261
-			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
262
-				echo '
265
+			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
266
+							echo '
263 267
 				<li class="avatar">
264 268
 					<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a>
265 269
 				</li>';
270
+			}
266 271
 
267 272
 		// Are there any custom fields below the avatar?
268
-		if (!empty($message['custom_fields']['below_avatar']))
269
-			foreach ($message['custom_fields']['below_avatar'] as $custom)
273
+		if (!empty($message['custom_fields']['below_avatar'])) {
274
+					foreach ($message['custom_fields']['below_avatar'] as $custom)
270 275
 				echo '
271 276
 				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
277
+		}
272 278
 
273
-			if (!$message['member']['is_guest'])
274
-				echo '
279
+			if (!$message['member']['is_guest']) {
280
+							echo '
275 281
 				<li class="icons">', $message['member']['group_icons'], '</li>';
282
+			}
276 283
 			// Show the member's primary group (like 'Administrator') if they have one.
277
-			if (isset($message['member']['group']) && $message['member']['group'] != '')
278
-				echo '
284
+			if (isset($message['member']['group']) && $message['member']['group'] != '') {
285
+							echo '
279 286
 				<li class="membergroup">', $message['member']['group'], '</li>';
287
+			}
280 288
 
281 289
 			// Show the member's custom title, if they have one.
282
-			if (isset($message['member']['title']) && $message['member']['title'] != '')
283
-				echo '
290
+			if (isset($message['member']['title']) && $message['member']['title'] != '') {
291
+							echo '
284 292
 				<li class="title">', $message['member']['title'], '</li>';
293
+			}
285 294
 
286 295
 			// Don't show these things for guests.
287 296
 			if (!$message['member']['is_guest'])
288 297
 			{
289 298
 				// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
290
-				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
291
-					echo '
299
+				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
300
+									echo '
292 301
 				<li class="postgroup">', $message['member']['post_group'], '</li>';
302
+				}
293 303
 
294 304
 				// Show how many posts they have made.
295
-				if (!isset($context['disabled_fields']['posts']))
296
-					echo '
305
+				if (!isset($context['disabled_fields']['posts'])) {
306
+									echo '
297 307
 				<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
308
+				}
298 309
 
299 310
 				// Show their personal text?
300
-				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '')
301
-					echo '
311
+				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') {
312
+									echo '
302 313
 				<li class="blurb">', $message['member']['blurb'], '</li>';
314
+				}
303 315
 
304 316
 				// Any custom fields to show as icons?
305 317
 				if (!empty($message['custom_fields']['icons']))
@@ -308,9 +320,10 @@  discard block
 block discarded – undo
308 320
 				<li class="im_icons">
309 321
 					<ol>';
310 322
 
311
-					foreach ($message['custom_fields']['icons'] as $custom)
312
-						echo '
323
+					foreach ($message['custom_fields']['icons'] as $custom) {
324
+											echo '
313 325
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
326
+					}
314 327
 
315 328
 					echo '
316 329
 					</ol>
@@ -318,19 +331,22 @@  discard block
 block discarded – undo
318 331
 				}
319 332
 
320 333
 		// Show the IP to this user for this post - because you can moderate?
321
-		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
322
-			echo '
334
+		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
335
+					echo '
323 336
 				<li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>';
337
+		}
324 338
 
325 339
 		// Or, should we show it because this is you?
326
-		elseif ($message['can_see_ip'])
327
-			echo '
340
+		elseif ($message['can_see_ip']) {
341
+					echo '
328 342
 				<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>';
343
+		}
329 344
 
330 345
 		// Okay, you are logged in, then we can show something about why IPs are logged...
331
-		else
332
-			echo '
346
+		else {
347
+					echo '
333 348
 				<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
349
+		}
334 350
 
335 351
 				// Show the profile, website, email address, and personal message buttons.
336 352
 				if ($message['member']['show_profile_buttons'])
@@ -340,24 +356,28 @@  discard block
 block discarded – undo
340 356
 					<ol class="profile_icons">';
341 357
 
342 358
 					// Show the profile button
343
-					if ($message['member']['can_view_profile'])
344
-						echo '
359
+					if ($message['member']['can_view_profile']) {
360
+											echo '
345 361
 						<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>';
362
+					}
346 363
 
347 364
 					// Don't show an icon if they haven't specified a website.
348
-					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
349
-						echo '
365
+					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
366
+											echo '
350 367
 						<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($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,24 +421,28 @@  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; ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' &#187;</span>';
445
+			}
419 446
 
420 447
 			echo '
421 448
 				</div>
@@ -423,13 +450,15 @@  discard block
 block discarded – undo
423 450
 			<div class="post">
424 451
 				<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>';
425 452
 
426
-			if ($message['can_report'] || $context['can_send_pm'])
427
-			echo '
453
+			if ($message['can_report'] || $context['can_send_pm']) {
454
+						echo '
428 455
 				<div class="under_message">';
456
+			}
429 457
 
430
-				if ($message['can_report'])
431
-				echo '
458
+				if ($message['can_report']) {
459
+								echo '
432 460
 					<a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>';
461
+				}
433 462
 
434 463
 				echo '
435 464
 					<ul class="quickbuttons">';
@@ -441,32 +470,36 @@  discard block
 block discarded – undo
441 470
 					if (!$message['member']['is_guest'])
442 471
 					{
443 472
 						// Is there than more than one recipient you can reply to?
444
-						if ($message['number_recipients'] > 1)
445
-							echo '
473
+						if ($message['number_recipients'] > 1) {
474
+													echo '
446 475
 						<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>';
476
+						}
447 477
 
448 478
 						echo '
449 479
 						<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>
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'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
451 481
 					}
452 482
 					// This is for "forwarding" - even if the member is gone.
453
-					else
454
-						echo '
483
+					else {
484
+											echo '
455 485
 						<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>';
486
+					}
456 487
 				}
457 488
 				echo '
458 489
 						<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>';
459 490
 
460
-				if (empty($context['display_mode']))
461
-					echo '
491
+				if (empty($context['display_mode'])) {
492
+									echo '
462 493
 						<li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>';
494
+				}
463 495
 
464 496
 				echo '
465 497
 					</ul>';
466 498
 
467
-			if ($message['can_report'] || $context['can_send_pm'])
468
-			echo '
499
+			if ($message['can_report'] || $context['can_send_pm']) {
500
+						echo '
469 501
 				</div>';
502
+			}
470 503
 
471 504
 			// Are there any custom profile fields for above the signature?
472 505
 			if (!empty($message['custom_fields']['above_signature']))
@@ -475,9 +508,10 @@  discard block
 block discarded – undo
475 508
 					<div class="custom_fields_above_signature">
476 509
 						<ul class="nolist">';
477 510
 
478
-				foreach ($message['custom_fields']['above_signature'] as $custom)
479
-					echo '
511
+				foreach ($message['custom_fields']['above_signature'] as $custom) {
512
+									echo '
480 513
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
514
+				}
481 515
 
482 516
 				echo '
483 517
 						</ul>
@@ -485,9 +519,10 @@  discard block
 block discarded – undo
485 519
 			}
486 520
 
487 521
 			// Show the member's signature?
488
-			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
489
-				echo '
522
+			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
523
+							echo '
490 524
 				<div class="signature">', $message['member']['signature'], '</div>';
525
+			}
491 526
 
492 527
 			// Are there any custom profile fields for below the signature?
493 528
 			if (!empty($message['custom_fields']['below_signature']))
@@ -496,9 +531,10 @@  discard block
 block discarded – undo
496 531
 					<div class="custom_fields_below_signature">
497 532
 						<ul class="nolist">';
498 533
 
499
-				foreach ($message['custom_fields']['below_signature'] as $custom)
500
-					echo '
534
+				foreach ($message['custom_fields']['below_signature'] as $custom) {
535
+									echo '
501 536
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
537
+				}
502 538
 
503 539
 				echo '
504 540
 						</ul>
@@ -523,19 +559,21 @@  discard block
 block discarded – undo
523 559
 					{
524 560
 						echo '
525 561
 						<option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>';
526
-						foreach ($context['labels'] as $label)
527
-							if (!isset($message['labels'][$label['id']]))
562
+						foreach ($context['labels'] as $label) {
563
+													if (!isset($message['labels'][$label['id']]))
528 564
 								echo '
529 565
 							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
566
+						}
530 567
 					}
531 568
 					// ... and are there any that can be removed?
532 569
 					if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1])))
533 570
 					{
534 571
 						echo '
535 572
 						<option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>';
536
-						foreach ($message['labels'] as $label)
537
-							echo '
573
+						foreach ($message['labels'] as $label) {
574
+													echo '
538 575
 							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
576
+						}
539 577
 					}
540 578
 					echo '
541 579
 					</select>
@@ -555,13 +593,14 @@  discard block
 block discarded – undo
555 593
 	</div>';
556 594
 		}
557 595
 
558
-		if (empty($context['display_mode']))
559
-			echo '
596
+		if (empty($context['display_mode'])) {
597
+					echo '
560 598
 
561 599
 	<div class="pagesection">
562 600
 		<div class="floatleft">', $context['page_index'], '</div>
563 601
 		<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"></div>
564 602
 	</div>';
603
+		}
565 604
 
566 605
 		// Show a few buttons if we are in conversation mode and outputting the first message.
567 606
 		elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons']))
@@ -621,11 +660,12 @@  discard block
 block discarded – undo
621 660
 		</tr>
622 661
 	</thead>
623 662
 	<tbody>';
624
-	if (!$context['show_delete'])
625
-		echo '
663
+	if (!$context['show_delete']) {
664
+			echo '
626 665
 		<tr class="windowbg">
627 666
 			<td colspan="5">', $txt['pm_alert_none'], '</td>
628 667
 		</tr>';
668
+	}
629 669
 
630 670
 	while ($message = $context['get_pmessage']('subject'))
631 671
 	{
@@ -678,9 +718,10 @@  discard block
 block discarded – undo
678 718
 
679 719
 			foreach ($context['labels'] as $label)
680 720
 			{
681
-				if ($label['id'] != $context['current_label_id'])
682
-					echo '
721
+				if ($label['id'] != $context['current_label_id']) {
722
+									echo '
683 723
 					<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
724
+				}
684 725
 			}
685 726
 
686 727
 			echo '
@@ -765,9 +806,10 @@  discard block
 block discarded – undo
765 806
 					<dt class="between">', $txt['pm_search_post_age'], ':</dt>
766 807
 					<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" 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" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd>
767 808
 				</dl>';
768
-	if (!$context['currently_using_labels'])
769
-		echo '
809
+	if (!$context['currently_using_labels']) {
810
+			echo '
770 811
 				<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">';
812
+	}
771 813
 		echo '
772 814
 				<br class="clear_right">
773 815
 			</div>
@@ -787,12 +829,13 @@  discard block
 block discarded – undo
787 829
 				<div id="advanced_panel_div">
788 830
 					<ul id="searchLabelsExpand">';
789 831
 
790
-		foreach ($context['search_labels'] as $label)
791
-			echo '
832
+		foreach ($context['search_labels'] as $label) {
833
+					echo '
792 834
 						<li>
793 835
 							<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '>
794 836
 							', $label['name'], '</label>
795 837
 						</li>';
838
+		}
796 839
 
797 840
 		echo '
798 841
 					</ul>
@@ -852,8 +895,8 @@  discard block
 block discarded – undo
852 895
 		</div>';
853 896
 
854 897
 	// complete results ?
855
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
856
-		echo '
898
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
899
+			echo '
857 900
 	<table class="table_grid">
858 901
 	<thead>
859 902
 		<tr class="title_bar">
@@ -863,6 +906,7 @@  discard block
 block discarded – undo
863 906
 		</tr>
864 907
 	</thead>
865 908
 	<tbody>';
909
+	}
866 910
 
867 911
 	// Print each message out...
868 912
 	foreach ($context['personal_messages'] as $message)
@@ -882,11 +926,13 @@  discard block
 block discarded – undo
882 926
 
883 927
 				// Show the recipients.
884 928
 				// @todo This doesn't deal with the sent item searching quite right for bcc.
885
-				if (!empty($message['recipients']['to']))
886
-					echo implode(', ', $message['recipients']['to']);
929
+				if (!empty($message['recipients']['to'])) {
930
+									echo implode(', ', $message['recipients']['to']);
931
+				}
887 932
 				// Otherwise, we're just going to say "some people"...
888
-				elseif ($context['folder'] != 'sent')
889
-					echo '(', $txt['pm_undisclosed_recipients'], ')';
933
+				elseif ($context['folder'] != 'sent') {
934
+									echo '(', $txt['pm_undisclosed_recipients'], ')';
935
+				}
890 936
 
891 937
 					echo '
892 938
 				</h3>
@@ -900,14 +946,16 @@  discard block
 block discarded – undo
900 946
 					$quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"');
901 947
 					$reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"');
902 948
 					// You can only reply if they are not a guest...
903
-					if (!$message['member']['is_guest'])
904
-						echo '
949
+					if (!$message['member']['is_guest']) {
950
+											echo '
905 951
 							<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'], '
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'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
953
+					}
907 954
 					// This is for "forwarding" - even if the member is gone.
908
-					else
909
-						echo '
955
+					else {
956
+											echo '
910 957
 							<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'];
958
+					}
911 959
 				}
912 960
 
913 961
 				echo '
@@ -928,17 +976,19 @@  discard block
 block discarded – undo
928 976
 	}
929 977
 
930 978
 	// Finish off the page...
931
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
932
-		echo '
979
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
980
+			echo '
933 981
 		</tbody>
934 982
 		</table>';
983
+	}
935 984
 
936 985
 	// No results?
937
-	if (empty($context['personal_messages']))
938
-		echo '
986
+	if (empty($context['personal_messages'])) {
987
+			echo '
939 988
 		<div class="windowbg">
940 989
 			<p class="centertext">', $txt['pm_search_none_found'], '</p>
941 990
 		</div>';
991
+	}
942 992
 
943 993
 	echo '
944 994
 		<div class="pagesection">
@@ -962,12 +1012,14 @@  discard block
 block discarded – undo
962 1012
 				<h3 class="catbg">', $txt['pm_send_report'], '</h3>
963 1013
 			</div>
964 1014
 			<div class="windowbg">';
965
-				if (!empty($context['send_log']['sent']))
966
-					foreach ($context['send_log']['sent'] as $log_entry)
1015
+				if (!empty($context['send_log']['sent'])) {
1016
+									foreach ($context['send_log']['sent'] as $log_entry)
967 1017
 						echo '<span class="error">', $log_entry, '</span><br>';
968
-				if (!empty($context['send_log']['failed']))
969
-					foreach ($context['send_log']['failed'] as $log_entry)
1018
+				}
1019
+				if (!empty($context['send_log']['failed'])) {
1020
+									foreach ($context['send_log']['failed'] as $log_entry)
970 1021
 						echo '<span class="error">', $log_entry, '</span><br>';
1022
+				}
971 1023
 				echo '
972 1024
 			</div>
973 1025
 			<br>';
@@ -1015,12 +1067,13 @@  discard block
 block discarded – undo
1015 1067
 				</dl>
1016 1068
 			</div>';
1017 1069
 
1018
-	if (!empty($modSettings['drafts_pm_enabled']))
1019
-		echo '
1070
+	if (!empty($modSettings['drafts_pm_enabled'])) {
1071
+			echo '
1020 1072
 			<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
1021 1073
 				sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), '
1022 1074
 				', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
1023 1075
 			</div>';
1076
+	}
1024 1077
 
1025 1078
 	echo '
1026 1079
 			<dl id="post_header">';
@@ -1075,9 +1128,10 @@  discard block
 block discarded – undo
1075 1128
 	}
1076 1129
 
1077 1130
 	// What about smileys?
1078
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
1079
-		echo '
1131
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
1132
+			echo '
1080 1133
 			<div id="smileyBox_message"></div>';
1134
+	}
1081 1135
 
1082 1136
 	// Show BBC buttons, smileys and textbox.
1083 1137
 	echo '
@@ -1124,10 +1178,11 @@  discard block
 block discarded – undo
1124 1178
 					<dt><strong>', $txt['subject'], '</strong></dt>
1125 1179
 					<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
1126 1180
 
1127
-		foreach ($context['drafts'] as $draft)
1128
-			echo '
1181
+		foreach ($context['drafts'] as $draft) {
1182
+					echo '
1129 1183
 					<dt>', $draft['link'], '</dt>
1130 1184
 					<dd>', $draft['poster_time'], '</dd>';
1185
+		}
1131 1186
 		echo '
1132 1187
 				</dl>
1133 1188
 			</div>';
@@ -1233,8 +1288,8 @@  discard block
 block discarded – undo
1233 1288
 			}';
1234 1289
 
1235 1290
 	// Code for showing and hiding drafts
1236
-	if (!empty($context['drafts']))
1237
-		echo '
1291
+	if (!empty($context['drafts'])) {
1292
+			echo '
1238 1293
 			var oSwapDraftOptions = new smc_Toggle({
1239 1294
 				bToggleEnabled: true,
1240 1295
 				bCurrentlyCollapsed: true,
@@ -1256,13 +1311,14 @@  discard block
 block discarded – undo
1256 1311
 					}
1257 1312
 				]
1258 1313
 			});';
1314
+	}
1259 1315
 
1260 1316
 	echo '
1261 1317
 		</script>';
1262 1318
 
1263 1319
 	// Show the message you're replying to.
1264
-	if ($context['reply'])
1265
-		echo '
1320
+	if ($context['reply']) {
1321
+			echo '
1266 1322
 	<br>
1267 1323
 	<br>
1268 1324
 	<div class="cat_bar">
@@ -1276,6 +1332,7 @@  discard block
 block discarded – undo
1276 1332
 		<hr>
1277 1333
 		', $context['quoted_message']['body'], '
1278 1334
 	</div><br class="clear">';
1335
+	}
1279 1336
 
1280 1337
 	echo '
1281 1338
 		<script>
@@ -1286,22 +1343,24 @@  discard block
 block discarded – undo
1286 1343
 				sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
1287 1344
 				sToControlId: \'to_control\',
1288 1345
 				aToRecipients: [';
1289
-	foreach ($context['recipients']['to'] as $i => $member)
1290
-		echo '
1346
+	foreach ($context['recipients']['to'] as $i => $member) {
1347
+			echo '
1291 1348
 					{
1292 1349
 						sItemId: ', JavaScriptEscape($member['id']), ',
1293 1350
 						sItemName: ', JavaScriptEscape($member['name']), '
1294 1351
 					}', $i == count($context['recipients']['to']) - 1 ? '' : ',';
1352
+	}
1295 1353
 
1296 1354
 	echo '
1297 1355
 				],
1298 1356
 				aBccRecipients: [';
1299
-	foreach ($context['recipients']['bcc'] as $i => $member)
1300
-		echo '
1357
+	foreach ($context['recipients']['bcc'] as $i => $member) {
1358
+			echo '
1301 1359
 					{
1302 1360
 						sItemId: ', JavaScriptEscape($member['id']), ',
1303 1361
 						sItemName: ', JavaScriptEscape($member['name']), '
1304 1362
 					}', $i == count($context['recipients']['bcc']) - 1 ? '' : ',';
1363
+	}
1305 1364
 
1306 1365
 	echo '
1307 1366
 				],
@@ -1388,26 +1447,28 @@  discard block
 block discarded – undo
1388 1447
 				</th>
1389 1448
 				<th class="centertext table_icon">';
1390 1449
 
1391
-	if (count($context['labels']) > 2)
1392
-		echo '
1450
+	if (count($context['labels']) > 2) {
1451
+			echo '
1393 1452
 					<input type="checkbox" onclick="invertAll(this, this.form);">';
1453
+	}
1394 1454
 
1395 1455
 	echo '
1396 1456
 				</th>
1397 1457
 			</tr>
1398 1458
 		</thead>
1399 1459
 		<tbody>';
1400
-	if (count($context['labels']) < 2)
1401
-		echo '
1460
+	if (count($context['labels']) < 2) {
1461
+			echo '
1402 1462
 			<tr class="windowbg">
1403 1463
 				<td colspan="2">', $txt['pm_labels_no_exist'], '</td>
1404 1464
 			</tr>';
1405
-	else
1465
+	} else
1406 1466
 	{
1407 1467
 		foreach ($context['labels'] as $label)
1408 1468
 		{
1409
-			if ($label['id'] == -1)
1410
-				continue;
1469
+			if ($label['id'] == -1) {
1470
+							continue;
1471
+			}
1411 1472
 
1412 1473
 				echo '
1413 1474
 			<tr class="windowbg">
@@ -1422,12 +1483,13 @@  discard block
 block discarded – undo
1422 1483
 		</tbody>
1423 1484
 		</table>';
1424 1485
 
1425
-	if (!count($context['labels']) < 2)
1426
-		echo '
1486
+	if (!count($context['labels']) < 2) {
1487
+			echo '
1427 1488
 		<div class="padding">
1428 1489
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1429 1490
 			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1430 1491
 		</div>';
1492
+	}
1431 1493
 
1432 1494
 	echo '
1433 1495
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1482,9 +1544,10 @@  discard block
 block discarded – undo
1482 1544
 				<dd>
1483 1545
 					<select name="id_admin">
1484 1546
 						<option value="0">', $txt['pm_report_all_admins'], '</option>';
1485
-		foreach ($context['admins'] as $id => $name)
1486
-			echo '
1547
+		foreach ($context['admins'] as $id => $name) {
1548
+					echo '
1487 1549
 						<option value="', $id, '">', $name, '</option>';
1550
+		}
1488 1551
 		echo '
1489 1552
 					</select>
1490 1553
 				</dd>';
@@ -1546,9 +1609,10 @@  discard block
 block discarded – undo
1546 1609
 				</th>
1547 1610
 				<th class="centertext table_icon">';
1548 1611
 
1549
-	if (!empty($context['rules']))
1550
-		echo '
1612
+	if (!empty($context['rules'])) {
1613
+			echo '
1551 1614
 					<input type="checkbox" onclick="invertAll(this, this.form);">';
1615
+	}
1552 1616
 
1553 1617
 	echo '
1554 1618
 				</th>
@@ -1556,13 +1620,14 @@  discard block
 block discarded – undo
1556 1620
 		</thead>
1557 1621
 		<tbody>';
1558 1622
 
1559
-	if (empty($context['rules']))
1560
-		echo '
1623
+	if (empty($context['rules'])) {
1624
+			echo '
1561 1625
 			<tr class="windowbg">
1562 1626
 				<td colspan="2">
1563 1627
 					', $txt['pm_rules_none'], '
1564 1628
 				</td>
1565 1629
 			</tr>';
1630
+	}
1566 1631
 
1567 1632
 	foreach ($context['rules'] as $rule)
1568 1633
 	{
@@ -1583,14 +1648,16 @@  discard block
 block discarded – undo
1583 1648
 		<div class="righttext">
1584 1649
 			<a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>';
1585 1650
 
1586
-	if (!empty($context['rules']))
1587
-		echo '
1651
+	if (!empty($context['rules'])) {
1652
+			echo '
1588 1653
 			[<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>]';
1654
+	}
1589 1655
 
1590
-	if (!empty($context['rules']))
1591
-		echo '
1656
+	if (!empty($context['rules'])) {
1657
+			echo '
1592 1658
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1593 1659
 			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1660
+	}
1594 1661
 
1595 1662
 	echo '
1596 1663
 		</div>
@@ -1612,14 +1679,16 @@  discard block
 block discarded – undo
1612 1679
 			var groups = new Array()
1613 1680
 			var labels = new Array()';
1614 1681
 
1615
-	foreach ($context['groups'] as $id => $title)
1616
-		echo '
1682
+	foreach ($context['groups'] as $id => $title) {
1683
+			echo '
1617 1684
 			groups[', $id, '] = "', addslashes($title), '";';
1685
+	}
1618 1686
 
1619
-	foreach ($context['labels'] as $label)
1620
-		if ($label['id'] != -1)
1687
+	foreach ($context['labels'] as $label) {
1688
+			if ($label['id'] != -1)
1621 1689
 			echo '
1622 1690
 			labels[', ($label['id']), '] = "', addslashes($label['name']), '";';
1691
+	}
1623 1692
 
1624 1693
 	echo '
1625 1694
 			function addCriteriaOption()
@@ -1634,8 +1703,9 @@  discard block
 block discarded – undo
1634 1703
 
1635 1704
 				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=""><\' + \'/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>';
1636 1705
 
1637
-	foreach ($context['groups'] as $id => $group)
1638
-		echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1706
+	foreach ($context['groups'] as $id => $group) {
1707
+			echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1708
+	}
1639 1709
 
1640 1710
 	echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\');
1641 1711
 			}
@@ -1652,9 +1722,10 @@  discard block
 block discarded – undo
1652 1722
 
1653 1723
 				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>';
1654 1724
 
1655
-	foreach ($context['labels'] as $label)
1656
-		if ($label['id'] != -1)
1725
+	foreach ($context['labels'] as $label) {
1726
+			if ($label['id'] != -1)
1657 1727
 			echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>';
1728
+	}
1658 1729
 
1659 1730
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
1660 1731
 			}
@@ -1768,18 +1839,20 @@  discard block
 block discarded – undo
1768 1839
 	$isFirst = true;
1769 1840
 	foreach ($context['rule']['criteria'] as $k => $criteria)
1770 1841
 	{
1771
-		if (!$isFirst && $criteria['t'] == '')
1772
-			echo '<div id="removeonjs1">';
1773
-		elseif (!$isFirst)
1774
-			echo '<br>';
1842
+		if (!$isFirst && $criteria['t'] == '') {
1843
+					echo '<div id="removeonjs1">';
1844
+		} elseif (!$isFirst) {
1845
+					echo '<br>';
1846
+		}
1775 1847
 
1776 1848
 		echo '
1777 1849
 				<select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();">
1778 1850
 					<option value="">', $txt['pm_rule_criteria_pick'], ':</option>';
1779 1851
 
1780
-		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr)
1781
-			echo '
1852
+		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) {
1853
+					echo '
1782 1854
 					<option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>';
1855
+		}
1783 1856
 
1784 1857
 		echo '
1785 1858
 				</select>
@@ -1790,18 +1863,20 @@  discard block
 block discarded – undo
1790 1863
 					<select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();">
1791 1864
 						<option value="">', $txt['pm_rule_sel_group'], '</option>';
1792 1865
 
1793
-		foreach ($context['groups'] as $id => $group)
1794
-			echo '
1866
+		foreach ($context['groups'] as $id => $group) {
1867
+					echo '
1795 1868
 						<option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>';
1869
+		}
1796 1870
 		echo '
1797 1871
 					</select>
1798 1872
 				</span>';
1799 1873
 
1800 1874
 		// If this is the dummy we add a means to hide for non js users.
1801
-		if ($isFirst)
1802
-			$isFirst = false;
1803
-		elseif ($criteria['t'] == '')
1804
-			echo '</div>';
1875
+		if ($isFirst) {
1876
+					$isFirst = false;
1877
+		} elseif ($criteria['t'] == '') {
1878
+					echo '</div>';
1879
+		}
1805 1880
 	}
1806 1881
 
1807 1882
 	echo '
@@ -1824,10 +1899,11 @@  discard block
 block discarded – undo
1824 1899
 	$isFirst = true;
1825 1900
 	foreach ($context['rule']['actions'] as $k => $action)
1826 1901
 	{
1827
-		if (!$isFirst && $action['t'] == '')
1828
-			echo '<div id="removeonjs2">';
1829
-		elseif (!$isFirst)
1830
-			echo '<br>';
1902
+		if (!$isFirst && $action['t'] == '') {
1903
+					echo '<div id="removeonjs2">';
1904
+		} elseif (!$isFirst) {
1905
+					echo '<br>';
1906
+		}
1831 1907
 
1832 1908
 		echo '
1833 1909
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
@@ -1838,20 +1914,22 @@  discard block
 block discarded – undo
1838 1914
 				<span id="labdiv', $k, '">
1839 1915
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
1840 1916
 						<option value="">', $txt['pm_rule_sel_label'], '</option>';
1841
-		foreach ($context['labels'] as $label)
1842
-			if ($label['id'] != -1)
1917
+		foreach ($context['labels'] as $label) {
1918
+					if ($label['id'] != -1)
1843 1919
 				echo '
1844 1920
 						<option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>';
1921
+		}
1845 1922
 
1846 1923
 		echo '
1847 1924
 					</select>
1848 1925
 				</span>';
1849 1926
 
1850
-		if ($isFirst)
1851
-			$isFirst = false;
1852
-		elseif ($action['t'] == '')
1853
-			echo '
1927
+		if ($isFirst) {
1928
+					$isFirst = false;
1929
+		} elseif ($action['t'] == '') {
1930
+					echo '
1854 1931
 			</div>';
1932
+		}
1855 1933
 	}
1856 1934
 
1857 1935
 	echo '
@@ -1875,22 +1953,25 @@  discard block
 block discarded – undo
1875 1953
 		echo '
1876 1954
 	<script>';
1877 1955
 
1878
-	foreach ($context['rule']['criteria'] as $k => $c)
1879
-		echo '
1956
+	foreach ($context['rule']['criteria'] as $k => $c) {
1957
+			echo '
1880 1958
 			updateRuleDef(', $k, ');';
1959
+	}
1881 1960
 
1882
-	foreach ($context['rule']['actions'] as $k => $c)
1883
-		echo '
1961
+	foreach ($context['rule']['actions'] as $k => $c) {
1962
+			echo '
1884 1963
 			updateActionDef(', $k, ');';
1964
+	}
1885 1965
 
1886 1966
 	echo '
1887 1967
 			rebuildRuleDesc();';
1888 1968
 
1889 1969
 	// If this isn't a new rule and we have JS enabled remove the JS compatibility stuff.
1890
-	if ($context['rid'])
1891
-		echo '
1970
+	if ($context['rid']) {
1971
+			echo '
1892 1972
 			document.getElementById("removeonjs1").style.display = "none";
1893 1973
 			document.getElementById("removeonjs2").style.display = "none";';
1974
+	}
1894 1975
 
1895 1976
 	echo '
1896 1977
 			document.getElementById("addonjs1").style.display = "";
@@ -1918,12 +1999,12 @@  discard block
 block discarded – undo
1918 1999
 		</div>';
1919 2000
 
1920 2001
 	// No drafts? Just show an informative message.
1921
-	if (empty($context['drafts']))
1922
-		echo '
2002
+	if (empty($context['drafts'])) {
2003
+			echo '
1923 2004
 		<div class="windowbg2 centertext">
1924 2005
 			', $txt['draft_none'], '
1925 2006
 		</div>';
1926
-	else
2007
+	} else
1927 2008
 	{
1928 2009
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
1929 2010
 		foreach ($context['drafts'] as $draft)
Please login to merge, or discard this patch.
Themes/default/MessageIndex.template.php 1 patch
Braces   +94 added lines, -65 removed lines patch added patch discarded remove patch
@@ -48,17 +48,19 @@  discard block
 block discarded – undo
48 48
 						</a>';
49 49
 
50 50
 			// Has it outstanding posts for approval?
51
-			if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
52
-				echo '
51
+			if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
52
+							echo '
53 53
 						<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>';
54
+			}
54 55
 
55 56
 			echo '
56 57
 						<p class="board_description">', $board['description'], '</p>';
57 58
 
58 59
 			// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
59
-			if (!empty($board['moderators']) || !empty($board['moderator_groups']))
60
-				echo '
60
+			if (!empty($board['moderators']) || !empty($board['moderator_groups'])) {
61
+							echo '
61 62
 						<p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
63
+			}
62 64
 
63 65
 			// Show some basic information about the number of posts, etc.
64 66
 			echo '
@@ -70,9 +72,10 @@  discard block
 block discarded – undo
70 72
 					</div>
71 73
 					<div class="lastpost lpr_border">';
72 74
 
73
-			if (!empty($board['last_post']['id']))
74
-				echo '
75
+			if (!empty($board['last_post']['id'])) {
76
+							echo '
75 77
 						<p>', $board['last_post']['last_post_message'], '</p>';
78
+			}
76 79
 			echo '
77 80
 					</div>';
78 81
 
@@ -85,14 +88,16 @@  discard block
 block discarded – undo
85 88
 						id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
86 89
 				foreach ($board['children'] as $child)
87 90
 				{
88
-					if (!$child['is_redirect'])
89
-						$child['link'] = ''. ($child['new'] ? '<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>' : '') . '<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'] . '</a>';
90
-					else
91
-						$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
91
+					if (!$child['is_redirect']) {
92
+											$child['link'] = ''. ($child['new'] ? '<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>' : '') . '<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'] . '</a>';
93
+					} else {
94
+											$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
95
+					}
92 96
 
93 97
 					// Has it posts awaiting approval?
94
-					if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
95
-						$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>';
98
+					if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) {
99
+											$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>';
100
+					}
96 101
 
97 102
 					$children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>';
98 103
 				}
@@ -111,8 +116,9 @@  discard block
 block discarded – undo
111 116
 	}
112 117
 
113 118
 	// They can only mark read if they are logged in and it's enabled!
114
-	if (!$context['user']['is_logged'])
115
-		unset($context['normal_buttons']['markread']);
119
+	if (!$context['user']['is_logged']) {
120
+			unset($context['normal_buttons']['markread']);
121
+	}
116 122
 
117 123
 	if (!$context['no_topic_listing'])
118 124
 	{
@@ -138,13 +144,15 @@  discard block
 block discarded – undo
138 144
 	<div id="description_board" class="generic_list_wrapper">
139 145
 		<h3>', $context['name'], '</h3>
140 146
 		<p>';
141
-	if ($context['description'] != '')
142
-	echo '
147
+	if ($context['description'] != '') {
148
+		echo '
143 149
 		', $context['description'], '&nbsp;';
150
+	}
144 151
 
145
-	if (!empty($context['moderators']))
146
-	echo '
152
+	if (!empty($context['moderators'])) {
153
+		echo '
147 154
 		', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.';
155
+	}
148 156
 
149 157
 	echo '
150 158
 		</p>
@@ -152,9 +160,10 @@  discard block
 block discarded – undo
152 160
 		}
153 161
 
154 162
 		// If Quick Moderation is enabled start the form.
155
-		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
156
-			echo '
163
+		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
164
+					echo '
157 165
 	<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
166
+		}
158 167
 
159 168
 		echo '
160 169
 		<div id="messageindex">';
@@ -162,10 +171,11 @@  discard block
 block discarded – undo
162 171
 		{
163 172
 		echo '
164 173
 			<div class="information">';
165
-			if ($settings['display_who_viewing'] == 1)
166
-				echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
167
-		else
168
-				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'] . ')');
174
+			if ($settings['display_who_viewing'] == 1) {
175
+							echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
176
+			} else {
177
+						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'] . ')');
178
+		}
169 179
 			echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'];
170 180
 
171 181
 		echo '
@@ -184,19 +194,22 @@  discard block
 block discarded – undo
184 194
 					<div class="lastpost">', $context['topics_headers']['last_post'], '</div>';
185 195
 
186 196
 			// Show a "select all" box for quick moderation?
187
-			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
188
-				echo '
197
+			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) {
198
+							echo '
189 199
 					<div class="moderation"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"></div>';
200
+			}
190 201
 
191 202
 			// If it's on in "image" mode, don't show anything but the column.
192
-			elseif (!empty($context['can_quick_mod']))
193
-				echo '
203
+			elseif (!empty($context['can_quick_mod'])) {
204
+							echo '
194 205
 					<div class="moderation">&nbsp;</div>';
206
+			}
195 207
 		}
196 208
 		// No topics.... just say, "sorry bub".
197
-		else
198
-			echo '
209
+		else {
210
+					echo '
199 211
 					<h3 class="titlebg">', $txt['topic_alert_none'], '</h3>';
212
+		}
200 213
 
201 214
 		echo '
202 215
 		</div>';
@@ -228,21 +241,26 @@  discard block
 block discarded – undo
228 241
 			// Now we handle the icons
229 242
 			echo '
230 243
 							<div class="icons floatright">';
231
-			if ($topic['is_watched'])
232
-				echo '
244
+			if ($topic['is_watched']) {
245
+							echo '
233 246
 								<span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>';
234
-			if ($topic['is_locked'])
235
-				echo '
247
+			}
248
+			if ($topic['is_locked']) {
249
+							echo '
236 250
 								<span class="generic_icons lock"></span>';
237
-			if ($topic['is_sticky'])
238
-				echo '
251
+			}
252
+			if ($topic['is_sticky']) {
253
+							echo '
239 254
 								<span class="generic_icons sticky"></span>';
240
-			if ($topic['is_redirect'])
241
-				echo '
255
+			}
256
+			if ($topic['is_redirect']) {
257
+							echo '
242 258
 								<span class="generic_icons move"></span>';
243
-			if ($topic['is_poll'])
244
-				echo '
259
+			}
260
+			if ($topic['is_poll']) {
261
+							echo '
245 262
 								<span class="generic_icons poll"></span>';
263
+			}
246 264
 			echo '
247 265
 							</div>';
248 266
 
@@ -268,26 +286,31 @@  discard block
 block discarded – undo
268 286
 			{
269 287
 				echo '
270 288
 					<div class="moderation">';
271
-				if ($options['display_quick_mod'] == 1)
272
-					echo '
289
+				if ($options['display_quick_mod'] == 1) {
290
+									echo '
273 291
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '">';
274
-				else
292
+				} else
275 293
 				{
276 294
 					// Check permissions on each and show only the ones they are allowed to use.
277
-					if ($topic['quick_mod']['remove'])
278
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
295
+					if ($topic['quick_mod']['remove']) {
296
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
297
+					}
279 298
 
280
-					if ($topic['quick_mod']['lock'])
281
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
299
+					if ($topic['quick_mod']['lock']) {
300
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
301
+					}
282 302
 
283
-					if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
284
-						echo '<br>';
303
+					if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
304
+											echo '<br>';
305
+					}
285 306
 
286
-					if ($topic['quick_mod']['sticky'])
287
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
307
+					if ($topic['quick_mod']['sticky']) {
308
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
309
+					}
288 310
 
289
-					if ($topic['quick_mod']['move'])
290
-						echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
311
+					if ($topic['quick_mod']['move']) {
312
+											echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
313
+					}
291 314
 				}
292 315
 				echo '
293 316
 					</div>';
@@ -305,18 +328,20 @@  discard block
 block discarded – undo
305 328
 					<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
306 329
 						<option value="">--------</option>';
307 330
 
308
-			foreach ($context['qmod_actions'] as $qmod_action)
309
-				if ($context['can_' . $qmod_action])
331
+			foreach ($context['qmod_actions'] as $qmod_action) {
332
+							if ($context['can_' . $qmod_action])
310 333
 					echo '
311 334
 						<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
335
+			}
312 336
 
313 337
 			echo '
314 338
 					</select>';
315 339
 
316 340
 			// Show a list of boards they can move the topic to.
317
-			if ($context['can_move'])
318
-				echo '
341
+			if ($context['can_move']) {
342
+							echo '
319 343
 			<span id="quick_mod_jump_to">&nbsp;</span>';
344
+			}
320 345
 
321 346
 			echo '
322 347
 					<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction">
@@ -327,10 +352,11 @@  discard block
 block discarded – undo
327 352
 	</div>';
328 353
 
329 354
 		// Finish off the form - again.
330
-		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
331
-			echo '
355
+		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
356
+					echo '
332 357
 	<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
333 358
 	</form>';
359
+		}
334 360
 
335 361
 	// Mobile action buttons (bottom)
336 362
 	echo '
@@ -352,8 +378,8 @@  discard block
 block discarded – undo
352 378
 	// Show breadcrumbs at the bottom too.
353 379
 	theme_linktree();
354 380
 
355
-	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
356
-		echo '
381
+	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
382
+			echo '
357 383
 			<script>
358 384
 				if (typeof(window.XMLHttpRequest) != "undefined")
359 385
 					aJumpTo[aJumpTo.length] = new JumpTo({
@@ -372,6 +398,7 @@  discard block
 block discarded – undo
372 398
 						sCustomName: "move_to"
373 399
 					});
374 400
 			</script>';
401
+	}
375 402
 
376 403
 	// Javascript for inline editing.
377 404
 	echo '
@@ -407,8 +434,8 @@  discard block
 block discarded – undo
407 434
 		<div class="information">
408 435
 			<p class="floatright" id="message_index_jump_to">&nbsp;</p>';
409 436
 
410
-	if (empty($context['no_topic_listing']))
411
-		echo '
437
+	if (empty($context['no_topic_listing'])) {
438
+			echo '
412 439
 			<p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
413 440
 				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', '
414 441
 				'. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br>
@@ -418,9 +445,10 @@  discard block
 block discarded – undo
418 445
 				<span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br>
419 446
 				<span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br>
420 447
 			</p>';
448
+	}
421 449
 
422
-	if (!empty($context['jump_to']))
423
-		echo '
450
+	if (!empty($context['jump_to'])) {
451
+			echo '
424 452
 			<script>
425 453
 				if (typeof(window.XMLHttpRequest) != "undefined")
426 454
 					aJumpTo[aJumpTo.length] = new JumpTo({
@@ -436,6 +464,7 @@  discard block
 block discarded – undo
436 464
 						sGoButtonLabel: "', $txt['quick_mod_go'], '"
437 465
 					});
438 466
 			</script>';
467
+	}
439 468
 
440 469
 	echo '
441 470
 			<br class="clear">
Please login to merge, or discard this patch.
Themes/default/index.template.php 1 patch
Braces   +89 added lines, -61 removed lines patch added patch discarded remove patch
@@ -72,9 +72,10 @@  discard block
 block discarded – undo
72 72
 
73 73
 	// Allow css/js files to be disable for this specific theme.
74 74
 	// Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference.
75
-	if (!isset($settings['disable_files']))
76
-		$settings['disable_files'] = array();
77
-}
75
+	if (!isset($settings['disable_files'])) {
76
+			$settings['disable_files'] = array();
77
+	}
78
+	}
78 79
 
79 80
 /**
80 81
  * The main sub template above the content.
@@ -111,8 +112,9 @@  discard block
 block discarded – undo
111 112
 		echo '
112 113
 	<meta';
113 114
 
114
-		foreach ($meta_tag as $meta_key => $meta_value)
115
-			echo ' ', $meta_key, '="', $meta_value, '"';
115
+		foreach ($meta_tag as $meta_key => $meta_value) {
116
+					echo ' ', $meta_key, '="', $meta_value, '"';
117
+		}
116 118
 
117 119
 		echo '>';
118 120
 	}
@@ -123,14 +125,16 @@  discard block
 block discarded – undo
123 125
 	<meta name="theme-color" content="#557EA0">';
124 126
 
125 127
 	// Please don't index these Mr Robot.
126
-	if (!empty($context['robot_no_index']))
127
-		echo '
128
+	if (!empty($context['robot_no_index'])) {
129
+			echo '
128 130
 	<meta name="robots" content="noindex">';
131
+	}
129 132
 
130 133
 	// Present a canonical url for search engines to prevent duplicate content in their indices.
131
-	if (!empty($context['canonical_url']))
132
-		echo '
134
+	if (!empty($context['canonical_url'])) {
135
+			echo '
133 136
 	<link rel="canonical" href="', $context['canonical_url'], '">';
137
+	}
134 138
 
135 139
 	// Show all the relative links, such as help, search, contents, and the like.
136 140
 	echo '
@@ -139,10 +143,11 @@  discard block
 block discarded – undo
139 143
 	<link rel="search" href="' . $scripturl . '?action=search">' : '');
140 144
 
141 145
 	// If RSS feeds are enabled, advertise the presence of one.
142
-	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
143
-		echo '
146
+	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) {
147
+			echo '
144 148
 	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">
145 149
 	<link rel="alternate" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">';
150
+	}
146 151
 
147 152
 	// If we're viewing a topic, these should be the previous and next topics, respectively.
148 153
 	if (!empty($context['links']['next']))
@@ -158,9 +163,10 @@  discard block
 block discarded – undo
158 163
 	}
159 164
 
160 165
 	// If we're in a board, or a topic for that matter, the index will be the board's index.
161
-	if (!empty($context['current_board']))
162
-		echo '
166
+	if (!empty($context['current_board'])) {
167
+			echo '
163 168
 	<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">';
169
+	}
164 170
 
165 171
 	// Output any remaining HTML headers. (from mods, maybe?)
166 172
 	echo $context['html_headers'];
@@ -191,8 +197,9 @@  discard block
 block discarded – undo
191 197
 		<ul class="floatleft" id="top_info">
192 198
 			<li>
193 199
 				<a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
194
-					if (!empty($context['user']['avatar']))
195
-						echo $context['user']['avatar']['image'];
200
+					if (!empty($context['user']['avatar'])) {
201
+											echo $context['user']['avatar']['image'];
202
+					}
196 203
 					echo $context['user']['name'], '</a>
197 204
 				<div id="profile_menu" class="top_menu"></div>
198 205
 			</li>';
@@ -220,17 +227,18 @@  discard block
 block discarded – undo
220 227
 	}
221 228
 	// Otherwise they're a guest. Ask them to either register or login.
222 229
 	else
223
-		if (empty($maintenance))
224
-			echo '
230
+		if (empty($maintenance)) {
231
+					echo '
225 232
 			<ul class="floatleft welcome">
226 233
 				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li>
227 234
 			</ul>';
228
-		else
229
-			//In maintenance mode, only login is allowed and don't show OverlayDiv
235
+		} else {
236
+					//In maintenance mode, only login is allowed and don't show OverlayDiv
230 237
 			echo '
231 238
 			<ul class="floatleft welcome">
232 239
 				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
233 240
 			</ul>';
241
+		}
234 242
 
235 243
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
236 244
 	{
@@ -238,9 +246,10 @@  discard block
 block discarded – undo
238 246
 		<form id="languages_form" method="get" class="floatright">
239 247
 			<select id="language_select" name="language" onchange="this.form.submit()">';
240 248
 
241
-		foreach ($context['languages'] as $language)
242
-			echo '
249
+		foreach ($context['languages'] as $language) {
250
+					echo '
243 251
 				<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
252
+		}
244 253
 
245 254
 		echo '
246 255
 			</select>
@@ -264,31 +273,36 @@  discard block
 block discarded – undo
264 273
 				<option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>';
265 274
 
266 275
 		// Can't limit it to a specific topic if we are not in one
267
-		if (!empty($context['current_topic']))
268
-			echo '
276
+		if (!empty($context['current_topic'])) {
277
+					echo '
269 278
 				<option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>';
279
+		}
270 280
 
271 281
 		// Can't limit it to a specific board if we are not in one
272
-		if (!empty($context['current_board']))
273
-			echo '
282
+		if (!empty($context['current_board'])) {
283
+					echo '
274 284
 				<option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>';
285
+		}
275 286
 
276 287
 		// Can't search for members if we can't see the memberlist
277
-		if (!empty($context['allow_memberlist']))
278
-			echo '
288
+		if (!empty($context['allow_memberlist'])) {
289
+					echo '
279 290
 				<option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>';
291
+		}
280 292
 
281 293
 		echo '
282 294
 			</select>';
283 295
 
284 296
 		// Search within current topic?
285
-		if (!empty($context['current_topic']))
286
-			echo '
297
+		if (!empty($context['current_topic'])) {
298
+					echo '
287 299
 			<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
300
+		}
288 301
 		// If we're on a certain board, limit it to this board ;).
289
-		elseif (!empty($context['current_board']))
290
-			echo '
302
+		elseif (!empty($context['current_board'])) {
303
+					echo '
291 304
 			<input type="hidden" name="sd_brd" value="', $context['current_board'], '">';
305
+		}
292 306
 
293 307
 		echo '
294 308
 			<input type="submit" name="search2" value="', $txt['search'], '" class="button">
@@ -318,12 +332,13 @@  discard block
 block discarded – undo
318 332
 						', $context['current_time'], '
319 333
 					</div>';
320 334
 	// Show a random news item? (or you could pick one from news_lines...)
321
-	if (!empty($settings['enable_news']) && !empty($context['random_news_line']))
322
-		echo '
335
+	if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
336
+			echo '
323 337
 					<div class="news">
324 338
 						<h2>', $txt['news'], ': </h2>
325 339
 						<p>', $context['random_news_line'], '</p>
326 340
 					</div>';
341
+	}
327 342
 
328 343
 	echo '
329 344
 					<hr class="clear">
@@ -386,9 +401,10 @@  discard block
 block discarded – undo
386 401
 		</ul>';
387 402
 
388 403
 	// Show the load time?
389
-	if ($context['show_load_time'])
390
-		echo '
404
+	if ($context['show_load_time']) {
405
+			echo '
391 406
 		<p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>';
407
+	}
392 408
 
393 409
 	echo '
394 410
 	</div>';
@@ -418,19 +434,21 @@  discard block
 block discarded – undo
418 434
 	global $context, $shown_linktree, $scripturl, $txt;
419 435
 
420 436
 	// If linktree is empty, just return - also allow an override.
421
-	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
422
-		return;
437
+	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) {
438
+			return;
439
+	}
423 440
 
424 441
 	echo '
425 442
 				<div class="navigate_section">
426 443
 					<ul>';
427 444
 
428
-	if ($context['user']['is_logged'])
429
-	echo '
445
+	if ($context['user']['is_logged']) {
446
+		echo '
430 447
 						<li class="unread_links">
431 448
 							<a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a>
432 449
 							<a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a>
433 450
 						</li>';
451
+	}
434 452
 
435 453
 	// Each tree item has a URL and name. Some may have extra_before and extra_after.
436 454
 	foreach ($context['linktree'] as $link_num => $tree)
@@ -441,25 +459,29 @@  discard block
 block discarded – undo
441 459
 		// Don't show a separator for the first one.
442 460
 		// Better here. Always points to the next level when the linktree breaks to a second line.
443 461
 		// Picked a better looking HTML entity, and added support for RTL plus a span for styling.
444
-		if ($link_num != 0)
445
-			echo '
462
+		if ($link_num != 0) {
463
+					echo '
446 464
 							<span class="dividers">', $context['right_to_left'] ? ' &#9668; ' : ' &#9658; ', '</span>';
465
+		}
447 466
 
448 467
 		// Show something before the link?
449
-		if (isset($tree['extra_before']))
450
-			echo $tree['extra_before'], ' ';
468
+		if (isset($tree['extra_before'])) {
469
+					echo $tree['extra_before'], ' ';
470
+		}
451 471
 
452 472
 		// Show the link, including a URL if it should have one.
453
-		if (isset($tree['url']))
454
-			echo '
473
+		if (isset($tree['url'])) {
474
+					echo '
455 475
 					<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>';
456
-		else
457
-			echo '
476
+		} else {
477
+					echo '
458 478
 					<span>' . $tree['name'] . '</span>';
479
+		}
459 480
 
460 481
 		// Show something after the link...?
461
-		if (isset($tree['extra_after']))
462
-			echo ' ', $tree['extra_after'];
482
+		if (isset($tree['extra_after'])) {
483
+					echo ' ', $tree['extra_after'];
484
+		}
463 485
 
464 486
 		echo '
465 487
 						</li>';
@@ -509,13 +531,14 @@  discard block
 block discarded – undo
509 531
 					echo '
510 532
 									<ul>';
511 533
 
512
-					foreach ($childbutton['sub_buttons'] as $grandchildbutton)
513
-						echo '
534
+					foreach ($childbutton['sub_buttons'] as $grandchildbutton) {
535
+											echo '
514 536
 										<li>
515 537
 											<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
516 538
 												', $grandchildbutton['title'], '
517 539
 											</a>
518 540
 										</li>';
541
+					}
519 542
 
520 543
 					echo '
521 544
 									</ul>';
@@ -546,8 +569,9 @@  discard block
 block discarded – undo
546 569
 {
547 570
 	global $context, $txt;
548 571
 
549
-	if (!is_array($strip_options))
550
-		$strip_options = array();
572
+	if (!is_array($strip_options)) {
573
+			$strip_options = array();
574
+	}
551 575
 
552 576
 	// Create the buttons...
553 577
 	$buttons = array();
@@ -556,8 +580,9 @@  discard block
 block discarded – undo
556 580
 		// As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!)
557 581
 		if (!isset($value['test']) || !empty($context[$value['test']]))
558 582
 		{
559
-			if (!isset($value['id']))
560
-				$value['id'] = $key;
583
+			if (!isset($value['id'])) {
584
+							$value['id'] = $key;
585
+			}
561 586
 
562 587
 			$button = '
563 588
 				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
@@ -570,13 +595,15 @@  discard block
 block discarded – undo
570 595
 							<div class="overview">';
571 596
 				foreach ($value['sub_buttons'] as $element)
572 597
 				{
573
-					if (isset($element['test']) && empty($context[$element['test']]))
574
-						continue;
598
+					if (isset($element['test']) && empty($context[$element['test']])) {
599
+											continue;
600
+					}
575 601
 
576 602
 					$button .= '
577 603
 								<a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>';
578
-					if (isset($txt[$element['text'] . '_desc']))
579
-						$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
604
+					if (isset($txt[$element['text'] . '_desc'])) {
605
+											$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
606
+					}
580 607
 					$button .= '</a>';
581 608
 				}
582 609
 				$button .= '
@@ -590,8 +617,9 @@  discard block
 block discarded – undo
590 617
 	}
591 618
 
592 619
 	// No buttons? No button strip either.
593
-	if (empty($buttons))
594
-		return;
620
+	if (empty($buttons)) {
621
+			return;
622
+	}
595 623
 
596 624
 	echo '
597 625
 		<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '>
Please login to merge, or discard this patch.
Themes/default/Post.template.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -416,8 +416,8 @@  discard block
 block discarded – undo
416 416
 									</div>
417 417
 									<div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
418 418
 									<div class="attach-ui">
419
-										<a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a>
420
-										<a class="button upload">', $txt['upload'] ,'</a>
419
+										<a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a>
420
+										<a class="button upload">', $txt['upload'], '</a>
421 421
 									</div>
422 422
 								</div>
423 423
 							</div>
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
 							</dt>
436 436
 							<dd class="smalltext fallback">
437 437
 								<div id="attachUpload" class="descbox">
438
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
439
-									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
440
-									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
441
-									<a class="button fileinput-button">', $txt['attach_add'] ,'</a>
438
+									<h5>', $txt['attach_drop_zone'], '</h5>
439
+									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
440
+									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
441
+									<a class="button fileinput-button">', $txt['attach_add'], '</a>
442 442
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
443 443
 									<div class="fallback">
444 444
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	// Option to delete an event if user is editing one.
546 546
 	if ($context['make_event'] && !$context['event']['new'])
547 547
 		echo '
548
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
548
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">';
549 549
 
550 550
 	echo '
551 551
 					</span>
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 			});';
800 800
 
801 801
 	echo '
802
-			var oEditorID = "', $context['post_box_name'] ,'";
802
+			var oEditorID = "', $context['post_box_name'], '";
803 803
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
804 804
 		</script>';
805 805
 
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 			{
832 832
 				echo '
833 833
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
834
-						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
834
+						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>
835 835
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
836 836
 					</ul>';
837 837
 			}
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 	<head>
919 919
 		<meta charset="', $context['character_set'], '">
920 920
 		<title>', $txt['spell_check'], '</title>
921
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
921
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
922 922
 		<style>
923 923
 			body, td
924 924
 			{
@@ -951,8 +951,8 @@  discard block
 block discarded – undo
951 951
 			var spell_formname = window.opener.spell_formname;
952 952
 			var spell_fieldname = window.opener.spell_fieldname;
953 953
 		</script>
954
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
955
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
954
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
955
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
956 956
 		<script>
957 957
 			', $context['spell_js'], '
958 958
 		</script>
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 	<head>
995 995
 		<meta charset="', $context['character_set'], '">
996 996
 		<title>', $txt['retrieving_quote'], '</title>
997
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
997
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
998 998
 	</head>
999 999
 	<body>
1000 1000
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Braces   +89 added lines, -61 removed lines patch added patch discarded remove patch
@@ -22,22 +22,24 @@  discard block
 block discarded – undo
22 22
 		<script>';
23 23
 
24 24
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
25
-	if (isBrowser('is_firefox'))
26
-		echo '
25
+	if (isBrowser('is_firefox')) {
26
+			echo '
27 27
 			window.addEventListener("pageshow", reActivate, false);';
28
+	}
28 29
 
29 30
 	// Start with message icons - and any missing from this theme.
30 31
 	echo '
31 32
 			var icon_urls = {';
32
-	foreach ($context['icons'] as $icon)
33
-		echo '
33
+	foreach ($context['icons'] as $icon) {
34
+			echo '
34 35
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
36
+	}
35 37
 	echo '
36 38
 			};';
37 39
 
38 40
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
39
-	if ($context['make_poll'])
40
-		echo '
41
+	if ($context['make_poll']) {
42
+			echo '
41 43
 			var pollOptionNum = 0, pollTabIndex;
42 44
 			var pollOptionId = ', $context['last_choice_id'], ';
43 45
 			function addPollOption()
@@ -56,11 +58,13 @@  discard block
 block discarded – undo
56 58
 
57 59
 				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), ');
58 60
 			}';
61
+	}
59 62
 
60 63
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
61
-	if ($context['make_event'])
62
-		echo '
64
+	if ($context['make_event']) {
65
+			echo '
63 66
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
67
+	}
64 68
 
65 69
 	// End of the javascript, start the form and display the link tree.
66 70
 	echo '
@@ -80,9 +84,10 @@  discard block
 block discarded – undo
80 84
 				</div>
81 85
 			</div><br>';
82 86
 
83
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
84
-		echo '
87
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
88
+			echo '
85 89
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
90
+	}
86 91
 
87 92
 	// Start the main table.
88 93
 	echo '
@@ -117,18 +122,20 @@  discard block
 block discarded – undo
117 122
 	}
118 123
 
119 124
 	// If it's locked, show a message to warn the replier.
120
-	if (!empty($context['locked']))
121
-	echo '
125
+	if (!empty($context['locked'])) {
126
+		echo '
122 127
 					<p class="errorbox">
123 128
 						', $txt['topic_locked_no_reply'], '
124 129
 					</p>';
130
+	}
125 131
 
126
-	if (!empty($modSettings['drafts_post_enabled']))
127
-		echo '
132
+	if (!empty($modSettings['drafts_post_enabled'])) {
133
+			echo '
128 134
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
129 135
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
130 136
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
131 137
 					</div>';
138
+	}
132 139
 
133 140
 	// The post header... important stuff
134 141
 	echo '
@@ -180,9 +187,10 @@  discard block
 block discarded – undo
180 187
 				{
181 188
 					echo '
182 189
 										<optgroup label="', $category['name'], '">';
183
-					foreach ($category['boards'] as $board)
184
-						echo '
190
+					foreach ($category['boards'] as $board) {
191
+											echo '
185 192
 											<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
193
+					}
186 194
 					echo '
187 195
 										</optgroup>';
188 196
 				}
@@ -218,9 +226,10 @@  discard block
 block discarded – undo
218 226
 									<span class="label">', $txt['calendar_timezone'], '</span>
219 227
 									<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
220 228
 
221
-			foreach ($context['all_timezones'] as $tz => $tzname)
222
-				echo '
229
+			foreach ($context['all_timezones'] as $tz => $tzname) {
230
+							echo '
223 231
 										<option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
232
+			}
224 233
 
225 234
 			echo '
226 235
 									</select>
@@ -286,14 +295,15 @@  discard block
 block discarded – undo
286 295
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
287 296
 								</dd>';
288 297
 
289
-		if ($context['poll_options']['guest_vote_enabled'])
290
-			echo '
298
+		if ($context['poll_options']['guest_vote_enabled']) {
299
+					echo '
291 300
 								<dt>
292 301
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
293 302
 								</dt>
294 303
 								<dd>
295 304
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '>
296 305
 								</dd>';
306
+		}
297 307
 
298 308
 		echo '
299 309
 								<dt>
@@ -314,8 +324,8 @@  discard block
 block discarded – undo
314 324
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
315 325
 
316 326
 	// If we're editing and displaying edit details, show a box where they can say why
317
-	if (isset($context['editing']) && $modSettings['show_modify'])
318
-		echo '
327
+	if (isset($context['editing']) && $modSettings['show_modify']) {
328
+			echo '
319 329
 					<dl>
320 330
 						<dt class="clear">
321 331
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -324,20 +334,23 @@  discard block
 block discarded – undo
324 334
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80">
325 335
 						</dd>
326 336
 					</dl>';
337
+	}
327 338
 
328 339
 	// If this message has been edited in the past - display when it was.
329
-	if (isset($context['last_modified']))
330
-		echo '
340
+	if (isset($context['last_modified'])) {
341
+			echo '
331 342
 					<div class="padding smalltext">
332 343
 						', $context['last_modified_text'], '
333 344
 					</div>';
345
+	}
334 346
 
335 347
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
336
-	if (!empty($modSettings['additional_options_collapsable']))
337
-		echo '
348
+	if (!empty($modSettings['additional_options_collapsable'])) {
349
+			echo '
338 350
 					<div id="postAdditionalOptionsHeader">
339 351
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
340 352
 					</div>';
353
+	}
341 354
 
342 355
 	echo '
343 356
 					<div id="postAdditionalOptions">';
@@ -369,19 +382,21 @@  discard block
 block discarded – undo
369 382
 								<input type="hidden" name="attach_del[]" value="0">
370 383
 								', $txt['uncheck_unwatchd_attach'], ':
371 384
 							</dd>';
372
-		foreach ($context['current_attachments'] as $attachment)
373
-			echo '
385
+		foreach ($context['current_attachments'] as $attachment) {
386
+					echo '
374 387
 							<dd class="smalltext">
375 388
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
376 389
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label>
377 390
 							</dd>';
391
+		}
378 392
 
379 393
 		echo '
380 394
 						</dl>';
381 395
 
382
-		if (!empty($context['files_in_session_warning']))
383
-			echo '
396
+		if (!empty($context['files_in_session_warning'])) {
397
+					echo '
384 398
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
399
+		}
385 400
 	}
386 401
 
387 402
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -445,8 +460,8 @@  discard block
 block discarded – undo
445 460
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">');
446 461
 
447 462
 		// Show more boxes if they aren't approaching that limit.
448
-		if ($context['num_allowed_attachments'] > 1)
449
-			echo '
463
+		if ($context['num_allowed_attachments'] > 1) {
464
+					echo '
450 465
 										<script>
451 466
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
452 467
 											var current_attachment = 1;
@@ -467,9 +482,10 @@  discard block
 block discarded – undo
467 482
 									</div>
468 483
 								</div>
469 484
 							</dd>';
470
-		else
471
-			echo '
485
+		} else {
486
+					echo '
472 487
 							</dd>';
488
+		}
473 489
 
474 490
 		// Add any template changes for an alternative upload system here.
475 491
 		call_integration_hook('integrate_upload_template');
@@ -478,21 +494,25 @@  discard block
 block discarded – undo
478 494
 							<dd class="smalltext">';
479 495
 
480 496
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
481
-		if (!empty($modSettings['attachmentCheckExtensions']))
482
-			echo '
497
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
498
+					echo '
483 499
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
500
+		}
484 501
 
485
-		if (!empty($context['attachment_restrictions']))
486
-			echo '
502
+		if (!empty($context['attachment_restrictions'])) {
503
+					echo '
487 504
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
505
+		}
488 506
 
489
-		if ($context['num_allowed_attachments'] == 0)
490
-			echo '
507
+		if ($context['num_allowed_attachments'] == 0) {
508
+					echo '
491 509
 								', $txt['attach_limit_nag'], '<br>';
510
+		}
492 511
 
493
-		if (!$context['can_post_attachment_unapproved'])
494
-			echo '
512
+		if (!$context['can_post_attachment_unapproved']) {
513
+					echo '
495 514
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
515
+		}
496 516
 
497 517
 		echo '
498 518
 							</dd>
@@ -515,10 +535,11 @@  discard block
 block discarded – undo
515 535
 							<dt><strong>', $txt['subject'], '</strong></dt>
516 536
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
517 537
 
518
-		foreach ($context['drafts'] as $draft)
519
-			echo '
538
+		foreach ($context['drafts'] as $draft) {
539
+					echo '
520 540
 							<dt>', $draft['link'], '</dt>
521 541
 							<dd>', $draft['poster_time'], '</dd>';
542
+		}
522 543
 		echo '
523 544
 						</dl>
524 545
 					</div>';
@@ -543,9 +564,10 @@  discard block
 block discarded – undo
543 564
 						', template_control_richedit_buttons($context['post_box_name']);
544 565
 
545 566
 	// Option to delete an event if user is editing one.
546
-	if ($context['make_event'] && !$context['event']['new'])
547
-		echo '
567
+	if ($context['make_event'] && !$context['event']['new']) {
568
+			echo '
548 569
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
570
+	}
549 571
 
550 572
 	echo '
551 573
 					</span>
@@ -554,9 +576,10 @@  discard block
 block discarded – undo
554 576
 			<br class="clear">';
555 577
 
556 578
 	// Assuming this isn't a new topic pass across the last message id.
557
-	if (isset($context['topic_last_message']))
558
-		echo '
579
+	if (isset($context['topic_last_message'])) {
580
+			echo '
559 581
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
582
+	}
560 583
 
561 584
 	echo '
562 585
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -698,9 +721,10 @@  discard block
 block discarded – undo
698 721
 
699 722
 						newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \'&nbsp;&#187;</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';';
700 723
 
701
-	if ($context['can_quote'])
702
-		echo '
724
+	if ($context['can_quote']) {
725
+			echo '
703 726
 						newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';';
727
+	}
704 728
 
705 729
 	echo '
706 730
 						newPostsHTML += \'<br class="clear">\';
@@ -743,8 +767,8 @@  discard block
 block discarded – undo
743 767
 			}';
744 768
 
745 769
 	// Code for showing and hiding additional options.
746
-	if (!empty($modSettings['additional_options_collapsable']))
747
-		echo '
770
+	if (!empty($modSettings['additional_options_collapsable'])) {
771
+			echo '
748 772
 			var oSwapAdditionalOptions = new smc_Toggle({
749 773
 				bToggleEnabled: true,
750 774
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -772,10 +796,11 @@  discard block
 block discarded – undo
772 796
 					}
773 797
 				]
774 798
 			});';
799
+	}
775 800
 
776 801
 	// Code for showing and hiding drafts
777
-	if (!empty($context['drafts']))
778
-		echo '
802
+	if (!empty($context['drafts'])) {
803
+			echo '
779 804
 			var oSwapDraftOptions = new smc_Toggle({
780 805
 				bToggleEnabled: true,
781 806
 				bCurrentlyCollapsed: true,
@@ -797,6 +822,7 @@  discard block
 block discarded – undo
797 822
 					}
798 823
 				]
799 824
 			});';
825
+	}
800 826
 
801 827
 	echo '
802 828
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -817,8 +843,9 @@  discard block
 block discarded – undo
817 843
 		foreach ($context['previous_posts'] as $post)
818 844
 		{
819 845
 			$ignoring = false;
820
-			if (!empty($post['is_ignored']))
821
-				$ignored_posts[] = $ignoring = $post['id'];
846
+			if (!empty($post['is_ignored'])) {
847
+							$ignored_posts[] = $ignoring = $post['id'];
848
+			}
822 849
 
823 850
 			echo '
824 851
 			<div class="windowbg">
@@ -1001,10 +1028,10 @@  discard block
 block discarded – undo
1001 1028
 		<div id="temporary_posting_area" style="display: none;"></div>
1002 1029
 		<script>';
1003 1030
 
1004
-	if ($context['close_window'])
1005
-		echo '
1031
+	if ($context['close_window']) {
1032
+			echo '
1006 1033
 			window.close();';
1007
-	else
1034
+	} else
1008 1035
 	{
1009 1036
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;).
1010 1037
 		echo '
@@ -1058,11 +1085,12 @@  discard block
 block discarded – undo
1058 1085
 				</p>
1059 1086
 				<ul>';
1060 1087
 
1061
-	foreach ($context['groups'] as $group)
1062
-		echo '
1088
+	foreach ($context['groups'] as $group) {
1089
+			echo '
1063 1090
 					<li>
1064 1091
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1065 1092
 					</li>';
1093
+	}
1066 1094
 
1067 1095
 	echo '
1068 1096
 					<li>
Please login to merge, or discard this patch.