Completed
Pull Request — release-2.1 (#4375)
by Colin
08:21
created
Themes/default/Help.template.php 1 patch
Braces   +21 added lines, -16 removed lines patch added patch discarded remove patch
@@ -86,11 +86,12 @@  discard block
 block discarded – undo
86 86
 					<span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>';
87 87
 
88 88
 	// Only offer to search for buddies if we have some!
89
-	if (!empty($context['show_buddies']))
90
-		echo '
89
+	if (!empty($context['show_buddies'])) {
90
+			echo '
91 91
 					<span class="smalltext">
92 92
 						<label for="buddies"><input type="checkbox" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label>
93 93
 					</span><br>';
94
+	}
94 95
 
95 96
 	echo '
96 97
 					<div class="padding righttext">
@@ -105,20 +106,21 @@  discard block
 block discarded – undo
105 106
 					<h3 class="catbg">', $txt['find_results'], '</h3>
106 107
 				</div>';
107 108
 
108
-	if (empty($context['results']))
109
-		echo '
109
+	if (empty($context['results'])) {
110
+			echo '
110 111
 				<p class="error">', $txt['find_no_results'], '</p>';
111
-	else
112
+	} else
112 113
 	{
113 114
 		echo '
114 115
 				<ul class="padding">';
115 116
 
116
-		foreach ($context['results'] as $result)
117
-			echo '
117
+		foreach ($context['results'] as $result) {
118
+					echo '
118 119
 					<li class="windowbg">
119 120
 						<a href="', $result['href'], '" target="_blank"> <span class="generic_icons profile_sm"></span>
120 121
 						<a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a>
121 122
 					</li>';
123
+		}
122 124
 
123 125
 		echo '
124 126
 				</ul>
@@ -134,11 +136,12 @@  discard block
 block discarded – undo
134 136
 			<input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '">
135 137
 		</form>';
136 138
 
137
-	if (empty($context['results']))
138
-		echo '
139
+	if (empty($context['results'])) {
140
+			echo '
139 141
 		<script>
140 142
 			document.getElementById("search").focus();
141 143
 		</script>';
144
+	}
142 145
 
143 146
 	echo '
144 147
 	</body>
@@ -162,9 +165,10 @@  discard block
 block discarded – undo
162 165
 					<p>', $txt['manual_introduction'], '</p>
163 166
 					<ul>';
164 167
 
165
-	foreach ($context['manual_sections'] as $section_id => $wiki_id)
166
-		echo '
168
+	foreach ($context['manual_sections'] as $section_id => $wiki_id) {
169
+			echo '
167 170
 						<li><a href="', $context['wiki_url'], '/', $context['wiki_prefix'], $wiki_id, ($txt['lang_dictionary'] != 'en' ? '/' . $txt['lang_dictionary'] : ''), '" target="_blank">', $txt['manual_section_' . $section_id . '_title'], '</a> - ', $txt['manual_section_' . $section_id . '_desc'], '</li>';
171
+	}
168 172
 
169 173
 	echo '
170 174
 					</ul>
@@ -180,8 +184,8 @@  discard block
 block discarded – undo
180 184
 {
181 185
 	global $txt, $context, $modSettings;
182 186
 
183
-	if (!empty($modSettings['requireAgreement']))
184
-		echo '
187
+	if (!empty($modSettings['requireAgreement'])) {
188
+			echo '
185 189
 			<div class="cat_bar">
186 190
 				<h3 class="catbg">
187 191
 					', $txt['terms_and_rules'], ' - ', $context['forum_name_html_safe'], '
@@ -190,11 +194,12 @@  discard block
 block discarded – undo
190 194
 			<div class="roundframe">
191 195
 				', $context['agreement'], '
192 196
 			</div>';
193
-	else
194
-		echo '
197
+	} else {
198
+			echo '
195 199
 			<div class="noticebox">
196 200
 				', $txt['agreement_disabled'], '
197 201
 			</div>';
198
-}
202
+	}
203
+	}
199 204
 
200 205
 ?>
201 206
\ No newline at end of file
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>
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 			if (!empty($message['custom_fields']['below_avatar']))
267 267
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
268 268
 					echo '
269
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
269
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
270 270
 
271 271
 			if (!$message['member']['is_guest'])
272 272
 				echo '
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
 					foreach ($message['custom_fields']['icons'] as $custom)
310 310
 						echo '
311
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
311
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
312 312
 
313 313
 					echo '
314 314
 							</ol>
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 				if (!empty($message['custom_fields']['standard']))
373 373
 					foreach ($message['custom_fields']['standard'] as $custom)
374 374
 						echo '
375
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
375
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
376 376
 
377 377
 				// Are we showing the warning status?
378 378
 				if ($message['member']['can_see_warning'])
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 				if (!empty($message['custom_fields']['bottom_poster']))
384 384
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
385 385
 						echo '
386
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
386
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
387 387
 			}
388 388
 
389 389
 			// Done with the information about the poster... on to the post itself.
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 
485 485
 				foreach ($message['custom_fields']['above_signature'] as $custom)
486 486
 					echo '
487
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
487
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
488 488
 
489 489
 				echo '
490 490
 							</ul>
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 
508 508
 				foreach ($message['custom_fields']['below_signature'] as $custom)
509 509
 					echo '
510
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
510
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
511 511
 
512 512
 				echo '
513 513
 							</ul>
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 	while ($message = $context['get_pmessage']('subject'))
644 644
 	{
645 645
 		echo '
646
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
646
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
647 647
 				<td class="table_icon">
648 648
 					<script>
649 649
 						currentLabels[', $message['id'], '] = {';
@@ -922,13 +922,13 @@  discard block
 block discarded – undo
922 922
 				// You can only reply if they are not a guest...
923 923
 				if (!$message['member']['is_guest'])
924 924
 					echo '
925
-					<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'], '
926
-					<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'];
925
+					<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'], '
926
+					<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'];
927 927
 
928 928
 				// This is for "forwarding" - even if the member is gone.
929 929
 				else
930 930
 					echo '
931
-					<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'];
931
+					<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'];
932 932
 			}
933 933
 
934 934
 			echo '
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1032 1032
 					<dl>
1033 1033
 						<dt>
1034
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1034
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1035 1035
 						</dt>
1036 1036
 						<dd class="error" id="error_list">
1037 1037
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1088 1088
 					</dt>
1089 1089
 					<dd id="pm_subject">
1090
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1090
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1091 1091
 					</dd>
1092 1092
 				</dl>
1093 1093
 				<hr>';
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
 		echo '
1453 1453
 		<div class="padding">
1454 1454
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1455
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1455
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1456 1456
 		</div>';
1457 1457
 
1458 1458
 	echo '
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 	if (!empty($context['rules']))
1618 1618
 		echo '
1619 1619
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1620
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1620
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1621 1621
 
1622 1622
 	echo '
1623 1623
 		</div>
@@ -1860,9 +1860,9 @@  discard block
 block discarded – undo
1860 1860
 
1861 1861
 		echo '
1862 1862
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1863
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1864
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1865
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1863
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1864
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1865
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1866 1866
 				</select>
1867 1867
 				<span id="labdiv', $k, '">
1868 1868
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1974,7 +1974,7 @@  discard block
 block discarded – undo
1974 1974
 			</div>
1975 1975
 			<ul class="quickbuttons">
1976 1976
 				<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>
1977
-				<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>
1977
+				<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>
1978 1978
 			</ul>
1979 1979
 		</div><!-- .windowbg -->';
1980 1980
 		}
Please login to merge, or discard this patch.
Braces   +291 added lines, -203 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.
@@ -68,13 +70,13 @@  discard block
 block discarded – undo
68 70
 		</div>
69 71
 		<div class="pm_unread">';
70 72
 
71
-	if (empty($context['unread_pms']))
72
-		echo '
73
+	if (empty($context['unread_pms'])) {
74
+			echo '
73 75
 			<div class="no_unread">', $txt['pm_no_unread'], '</div>';
74
-	else
76
+	} else
75 77
 	{
76
-		foreach ($context['unread_pms'] as $id_pm => $pm_details)
77
-			echo '
78
+		foreach ($context['unread_pms'] as $id_pm => $pm_details) {
79
+					echo '
78 80
 			<div class="unread">
79 81
 				', !empty($pm_details['member']) ? $pm_details['member']['avatar']['image'] : '', '
80 82
 				<div class="details">
@@ -85,6 +87,7 @@  discard block
 block discarded – undo
85 87
 					</div>
86 88
 				</div>
87 89
 			</div>';
90
+		}
88 91
 	}
89 92
 
90 93
 	echo '
@@ -193,14 +196,15 @@  discard block
 block discarded – undo
193 196
 	if ($context['get_pmessage']('message', true))
194 197
 	{
195 198
 		// Show the helpful titlebar - generally.
196
-		if ($context['display_mode'] != 1)
197
-			echo '
199
+		if ($context['display_mode'] != 1) {
200
+					echo '
198 201
 			<div class="cat_bar">
199 202
 				<h3 class="catbg">
200 203
 					<span id="author">', $txt['author'], '</span>
201 204
 					<span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span>
202 205
 				</h3>
203 206
 			</div>';
207
+		}
204 208
 
205 209
 		// Show a few buttons if we are in conversation mode and outputting the first message.
206 210
 		if ($context['display_mode'] == 2)
@@ -229,9 +233,10 @@  discard block
 block discarded – undo
229 233
 					<div class="custom_fields_above_member">
230 234
 						<ul class="nolist">';
231 235
 
232
-				foreach ($message['custom_fields']['above_member'] as $custom)
233
-					echo '
236
+				foreach ($message['custom_fields']['above_member'] as $custom) {
237
+									echo '
234 238
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
239
+				}
235 240
 
236 241
 				echo '
237 242
 						</ul>
@@ -243,25 +248,28 @@  discard block
 block discarded – undo
243 248
 						<a id="msg', $message['id'], '"></a>';
244 249
 
245 250
 			// Show online and offline buttons?
246
-			if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
247
-				echo '
251
+			if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
252
+							echo '
248 253
 						<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>';
254
+			}
249 255
 
250 256
 			// Custom fields BEFORE the username?
251
-			if (!empty($message['custom_fields']['before_member']))
252
-				foreach ($message['custom_fields']['before_member'] as $custom)
257
+			if (!empty($message['custom_fields']['before_member'])) {
258
+							foreach ($message['custom_fields']['before_member'] as $custom)
253 259
 					echo '
254 260
 						<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
261
+			}
255 262
 
256 263
 			// Show a link to the member's profile.
257 264
 			echo '
258 265
 				', $message['member']['link'];
259 266
 
260 267
 				// Custom fields AFTER the username?
261
-				if (!empty($message['custom_fields']['after_member']))
262
-					foreach ($message['custom_fields']['after_member'] as $custom)
268
+				if (!empty($message['custom_fields']['after_member'])) {
269
+									foreach ($message['custom_fields']['after_member'] as $custom)
263 270
 						echo '
264 271
 						<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
272
+				}
265 273
 
266 274
 			echo '
267 275
 					</h4>';
@@ -270,48 +278,56 @@  discard block
 block discarded – undo
270 278
 					<ul class="user_info">';
271 279
 
272 280
 			// Show the user's avatar.
273
-			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
274
-				echo '
281
+			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
282
+							echo '
275 283
 						<li class="avatar">
276 284
 							<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a>
277 285
 						</li>';
286
+			}
278 287
 
279 288
 			// Are there any custom fields below the avatar?
280
-			if (!empty($message['custom_fields']['below_avatar']))
281
-				foreach ($message['custom_fields']['below_avatar'] as $custom)
289
+			if (!empty($message['custom_fields']['below_avatar'])) {
290
+							foreach ($message['custom_fields']['below_avatar'] as $custom)
282 291
 					echo '
283 292
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
293
+			}
284 294
 
285
-			if (!$message['member']['is_guest'])
286
-				echo '
295
+			if (!$message['member']['is_guest']) {
296
+							echo '
287 297
 						<li class="icons">', $message['member']['group_icons'], '</li>';
298
+			}
288 299
 			// Show the member's primary group (like 'Administrator') if they have one.
289
-			if (isset($message['member']['group']) && $message['member']['group'] != '')
290
-				echo '
300
+			if (isset($message['member']['group']) && $message['member']['group'] != '') {
301
+							echo '
291 302
 						<li class="membergroup">', $message['member']['group'], '</li>';
303
+			}
292 304
 
293 305
 			// Show the member's custom title, if they have one.
294
-			if (isset($message['member']['title']) && $message['member']['title'] != '')
295
-				echo '
306
+			if (isset($message['member']['title']) && $message['member']['title'] != '') {
307
+							echo '
296 308
 						<li class="title">', $message['member']['title'], '</li>';
309
+			}
297 310
 
298 311
 			// Don't show these things for guests.
299 312
 			if (!$message['member']['is_guest'])
300 313
 			{
301 314
 				// 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.
302
-				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
303
-					echo '
315
+				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
316
+									echo '
304 317
 						<li class="postgroup">', $message['member']['post_group'], '</li>';
318
+				}
305 319
 
306 320
 				// Show how many posts they have made.
307
-				if (!isset($context['disabled_fields']['posts']))
308
-					echo '
321
+				if (!isset($context['disabled_fields']['posts'])) {
322
+									echo '
309 323
 						<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
324
+				}
310 325
 
311 326
 				// Show their personal text?
312
-				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '')
313
-					echo '
327
+				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') {
328
+									echo '
314 329
 						<li class="blurb">', $message['member']['blurb'], '</li>';
330
+				}
315 331
 
316 332
 				// Any custom fields to show as icons?
317 333
 				if (!empty($message['custom_fields']['icons']))
@@ -320,9 +336,10 @@  discard block
 block discarded – undo
320 336
 						<li class="im_icons">
321 337
 							<ol>';
322 338
 
323
-					foreach ($message['custom_fields']['icons'] as $custom)
324
-						echo '
339
+					foreach ($message['custom_fields']['icons'] as $custom) {
340
+											echo '
325 341
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
342
+					}
326 343
 
327 344
 					echo '
328 345
 							</ol>
@@ -330,25 +347,28 @@  discard block
 block discarded – undo
330 347
 				}
331 348
 
332 349
 				// Show the IP to this user for this post - because you can moderate?
333
-				if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
334
-					echo '
350
+				if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
351
+									echo '
335 352
 						<li class="poster_ip">
336 353
 							<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>
337 354
 						</li>';
355
+				}
338 356
 
339 357
 				// Or, should we show it because this is you?
340
-				elseif ($message['can_see_ip'])
341
-					echo '
358
+				elseif ($message['can_see_ip']) {
359
+									echo '
342 360
 						<li class="poster_ip">
343 361
 							<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a>
344 362
 						</li>';
363
+				}
345 364
 
346 365
 				// Okay, you are logged in, then we can show something about why IPs are logged...
347
-				else
348
-					echo '
366
+				else {
367
+									echo '
349 368
 						<li class="poster_ip">
350 369
 							<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a>
351 370
 						</li>';
371
+				}
352 372
 
353 373
 				// Show the profile, website, email address, and personal message buttons.
354 374
 				if ($message['member']['show_profile_buttons'])
@@ -358,24 +378,28 @@  discard block
 block discarded – undo
358 378
 							<ol class="profile_icons">';
359 379
 
360 380
 					// Show the profile button
361
-					if ($message['member']['can_view_profile'])
362
-						echo '
381
+					if ($message['member']['can_view_profile']) {
382
+											echo '
363 383
 								<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>';
384
+					}
364 385
 
365 386
 					// Don't show an icon if they haven't specified a website.
366
-					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
367
-						echo '
387
+					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
388
+											echo '
368 389
 								<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>';
390
+					}
369 391
 
370 392
 					// Don't show the email address if they want it hidden.
371
-					if ($message['member']['show_email'])
372
-						echo '
393
+					if ($message['member']['show_email']) {
394
+											echo '
373 395
 								<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>';
396
+					}
374 397
 
375 398
 					// Since we know this person isn't a guest, you *can* message them.
376
-					if ($context['can_send_pm'])
377
-						echo '
399
+					if ($context['can_send_pm']) {
400
+											echo '
378 401
 								<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>';
402
+					}
379 403
 
380 404
 					echo '
381 405
 							</ol>
@@ -383,21 +407,24 @@  discard block
 block discarded – undo
383 407
 				}
384 408
 
385 409
 				// Any custom fields for standard placement?
386
-				if (!empty($message['custom_fields']['standard']))
387
-					foreach ($message['custom_fields']['standard'] as $custom)
410
+				if (!empty($message['custom_fields']['standard'])) {
411
+									foreach ($message['custom_fields']['standard'] as $custom)
388 412
 						echo '
389 413
 						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
414
+				}
390 415
 
391 416
 				// Are we showing the warning status?
392
-				if ($message['member']['can_see_warning'])
393
-					echo '
417
+				if ($message['member']['can_see_warning']) {
418
+									echo '
394 419
 						<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>';
420
+				}
395 421
 
396 422
 				// Are there any custom fields to show at the bottom of the poster info?
397
-				if (!empty($message['custom_fields']['bottom_poster']))
398
-					foreach ($message['custom_fields']['bottom_poster'] as $custom)
423
+				if (!empty($message['custom_fields']['bottom_poster'])) {
424
+									foreach ($message['custom_fields']['bottom_poster'] as $custom)
399 425
 						echo '
400 426
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
427
+				}
401 428
 			}
402 429
 
403 430
 			// Done with the information about the poster... on to the post itself.
@@ -416,25 +443,29 @@  discard block
 block discarded – undo
416 443
 							<span class="smalltext">&#171; <strong> ', $txt['sent_to'], ':</strong> ';
417 444
 
418 445
 			// People it was sent directly to....
419
-			if (!empty($message['recipients']['to']))
420
-				echo implode(', ', $message['recipients']['to']);
446
+			if (!empty($message['recipients']['to'])) {
447
+							echo implode(', ', $message['recipients']['to']);
448
+			}
421 449
 
422 450
 			// Otherwise, we're just going to say "some people"...
423
-			elseif ($context['folder'] != 'sent')
424
-				echo '(', $txt['pm_undisclosed_recipients'], ')';
451
+			elseif ($context['folder'] != 'sent') {
452
+							echo '(', $txt['pm_undisclosed_recipients'], ')';
453
+			}
425 454
 
426 455
 			echo '
427 456
 								<strong> ', $txt['on'], ':</strong> ', $message['time'], ' &#187;
428 457
 							</span>';
429 458
 
430 459
 			// If we're in the sent items, show who it was sent to besides the "To:" people.
431
-			if (!empty($message['recipients']['bcc']))
432
-				echo '<br>
460
+			if (!empty($message['recipients']['bcc'])) {
461
+							echo '<br>
433 462
 							<span class="smalltext">&#171; <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' &#187;</span>';
463
+			}
434 464
 
435
-			if (!empty($message['is_replied_to']))
436
-				echo '<br>
465
+			if (!empty($message['is_replied_to'])) {
466
+							echo '<br>
437 467
 							<span class="smalltext">&#171; ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' &#187;</span>';
468
+			}
438 469
 
439 470
 			echo '
440 471
 						</div><!-- .keyinfo -->
@@ -444,13 +475,15 @@  discard block
 block discarded – undo
444 475
 							', $message['body'], '
445 476
 						</div>';
446 477
 
447
-			if ($message['can_report'] || $context['can_send_pm'])
448
-				echo '
478
+			if ($message['can_report'] || $context['can_send_pm']) {
479
+							echo '
449 480
 						<div class="under_message">';
481
+			}
450 482
 
451
-			if ($message['can_report'])
452
-				echo '
483
+			if ($message['can_report']) {
484
+							echo '
453 485
 							<a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>';
486
+			}
454 487
 
455 488
 			echo '
456 489
 							<ul class="quickbuttons">';
@@ -462,32 +495,36 @@  discard block
 block discarded – undo
462 495
 				if (!$message['member']['is_guest'])
463 496
 				{
464 497
 					// Is there than more than one recipient you can reply to?
465
-					if ($message['number_recipients'] > 1)
466
-						echo '
498
+					if ($message['number_recipients'] > 1) {
499
+											echo '
467 500
 								<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>';
501
+					}
468 502
 
469 503
 					echo '
470 504
 								<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>
471 505
 								<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>';
472 506
 				}
473 507
 				// This is for "forwarding" - even if the member is gone.
474
-				else
475
-					echo '
508
+				else {
509
+									echo '
476 510
 								<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>';
511
+				}
477 512
 			}
478 513
 			echo '
479 514
 								<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>';
480 515
 
481
-			if (empty($context['display_mode']))
482
-				echo '
516
+			if (empty($context['display_mode'])) {
517
+							echo '
483 518
 								<li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>';
519
+			}
484 520
 
485 521
 			echo '
486 522
 							</ul>';
487 523
 
488
-			if ($message['can_report'] || $context['can_send_pm'])
489
-			echo '
524
+			if ($message['can_report'] || $context['can_send_pm']) {
525
+						echo '
490 526
 						</div><!-- .under_message -->';
527
+			}
491 528
 
492 529
 			// Are there any custom profile fields for above the signature?
493 530
 			if (!empty($message['custom_fields']['above_signature']))
@@ -496,9 +533,10 @@  discard block
 block discarded – undo
496 533
 						<div class="custom_fields_above_signature">
497 534
 							<ul class="nolist">';
498 535
 
499
-				foreach ($message['custom_fields']['above_signature'] as $custom)
500
-					echo '
536
+				foreach ($message['custom_fields']['above_signature'] as $custom) {
537
+									echo '
501 538
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
539
+				}
502 540
 
503 541
 				echo '
504 542
 							</ul>
@@ -506,11 +544,12 @@  discard block
 block discarded – undo
506 544
 			}
507 545
 
508 546
 			// Show the member's signature?
509
-			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
510
-				echo '
547
+			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
548
+							echo '
511 549
 						<div class="signature">
512 550
 							', $message['member']['signature'], '
513 551
 						</div>';
552
+			}
514 553
 
515 554
 			// Are there any custom profile fields for below the signature?
516 555
 			if (!empty($message['custom_fields']['below_signature']))
@@ -519,9 +558,10 @@  discard block
 block discarded – undo
519 558
 						<div class="custom_fields_below_signature">
520 559
 							<ul class="nolist">';
521 560
 
522
-				foreach ($message['custom_fields']['below_signature'] as $custom)
523
-					echo '
561
+				foreach ($message['custom_fields']['below_signature'] as $custom) {
562
+									echo '
524 563
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
564
+				}
525 565
 
526 566
 				echo '
527 567
 							</ul>
@@ -548,10 +588,11 @@  discard block
 block discarded – undo
548 588
 						echo '
549 589
 								<option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>';
550 590
 
551
-						foreach ($context['labels'] as $label)
552
-							if (!isset($message['labels'][$label['id']]))
591
+						foreach ($context['labels'] as $label) {
592
+													if (!isset($message['labels'][$label['id']]))
553 593
 								echo '
554 594
 								<option value="', $label['id'], '">', $label['name'], '</option>';
595
+						}
555 596
 					}
556 597
 
557 598
 					// ... and are there any that can be removed?
@@ -560,9 +601,10 @@  discard block
 block discarded – undo
560 601
 						echo '
561 602
 								<option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>';
562 603
 
563
-						foreach ($message['labels'] as $label)
564
-							echo '
604
+						foreach ($message['labels'] as $label) {
605
+													echo '
565 606
 								<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
607
+						}
566 608
 					}
567 609
 					echo '
568 610
 							</select>
@@ -581,14 +623,15 @@  discard block
 block discarded – undo
581 623
 			</div><!-- .windowbg -->';
582 624
 		}
583 625
 
584
-		if (empty($context['display_mode']))
585
-			echo '
626
+		if (empty($context['display_mode'])) {
627
+					echo '
586 628
 			<div class="pagesection">
587 629
 				<div class="floatleft">', $context['page_index'], '</div>
588 630
 				<div class="floatright">
589 631
 					<input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button">
590 632
 				</div>
591 633
 			</div>';
634
+		}
592 635
 
593 636
 		// Show a few buttons if we are in conversation mode and outputting the first message.
594 637
 		elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons']))
@@ -648,11 +691,12 @@  discard block
 block discarded – undo
648 691
 		</thead>
649 692
 		<tbody>';
650 693
 
651
-	if (!$context['show_delete'])
652
-		echo '
694
+	if (!$context['show_delete']) {
695
+			echo '
653 696
 			<tr class="windowbg">
654 697
 				<td colspan="5">', $txt['pm_alert_none'], '</td>
655 698
 			</tr>';
699
+	}
656 700
 
657 701
 	while ($message = $context['get_pmessage']('subject'))
658 702
 	{
@@ -710,17 +754,19 @@  discard block
 block discarded – undo
710 754
 
711 755
 			foreach ($context['labels'] as $label)
712 756
 			{
713
-				if ($label['id'] != $context['current_label_id'])
714
-					echo '
757
+				if ($label['id'] != $context['current_label_id']) {
758
+									echo '
715 759
 				<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
760
+				}
716 761
 			}
717 762
 
718 763
 			echo '
719 764
 				<option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>';
720 765
 
721
-			foreach ($context['labels'] as $label)
722
-				echo '
766
+			foreach ($context['labels'] as $label) {
767
+							echo '
723 768
 				<option value="rem_', $label['id'], '">&nbsp;', $label['name'], '</option>';
769
+			}
724 770
 
725 771
 			echo '
726 772
 			</select>
@@ -751,11 +797,12 @@  discard block
 block discarded – undo
751 797
 			<h3 class="catbg">', $txt['pm_search_title'], '</h3>
752 798
 		</div>';
753 799
 
754
-	if (!empty($context['search_errors']))
755
-		echo '
800
+	if (!empty($context['search_errors'])) {
801
+			echo '
756 802
 		<div class="errorbox">
757 803
 			', implode('<br>', $context['search_errors']['messages']), '
758 804
 		</div>';
805
+	}
759 806
 
760 807
 
761 808
 	echo '
@@ -804,9 +851,10 @@  discard block
 block discarded – undo
804 851
 					</dd>
805 852
 				</dl>';
806 853
 
807
-	if (!$context['currently_using_labels'])
808
-		echo '
854
+	if (!$context['currently_using_labels']) {
855
+			echo '
809 856
 				<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button">';
857
+	}
810 858
 
811 859
 	echo '
812 860
 				<br class="clear_right">
@@ -827,12 +875,13 @@  discard block
 block discarded – undo
827 875
 				<div id="advanced_panel_div">
828 876
 					<ul id="searchLabelsExpand">';
829 877
 
830
-		foreach ($context['search_labels'] as $label)
831
-			echo '
878
+		foreach ($context['search_labels'] as $label) {
879
+					echo '
832 880
 						<li>
833 881
 							<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '>
834 882
 							', $label['name'], '</label>
835 883
 						</li>';
884
+		}
836 885
 
837 886
 		echo '
838 887
 					</ul>
@@ -894,8 +943,8 @@  discard block
 block discarded – undo
894 943
 		</div>';
895 944
 
896 945
 	// Complete results?
897
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
898
-		echo '
946
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
947
+			echo '
899 948
 		<table class="table_grid">
900 949
 			<thead>
901 950
 				<tr class="title_bar">
@@ -905,6 +954,7 @@  discard block
 block discarded – undo
905 954
 				</tr>
906 955
 			</thead>
907 956
 			<tbody>';
957
+	}
908 958
 
909 959
 	// Print each message out...
910 960
 	foreach ($context['personal_messages'] as $message)
@@ -924,12 +974,14 @@  discard block
 block discarded – undo
924 974
 
925 975
 			// Show the recipients.
926 976
 			// @todo This doesn't deal with the sent item searching quite right for bcc.
927
-			if (!empty($message['recipients']['to']))
928
-				echo implode(', ', $message['recipients']['to']);
977
+			if (!empty($message['recipients']['to'])) {
978
+							echo implode(', ', $message['recipients']['to']);
979
+			}
929 980
 
930 981
 			// Otherwise, we're just going to say "some people"...
931
-			elseif ($context['folder'] != 'sent')
932
-				echo '(', $txt['pm_undisclosed_recipients'], ')';
982
+			elseif ($context['folder'] != 'sent') {
983
+							echo '(', $txt['pm_undisclosed_recipients'], ')';
984
+			}
933 985
 
934 986
 			echo '
935 987
 				</h3>
@@ -944,15 +996,17 @@  discard block
 block discarded – undo
944 996
 				$reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"');
945 997
 
946 998
 				// You can only reply if they are not a guest...
947
-				if (!$message['member']['is_guest'])
948
-					echo '
999
+				if (!$message['member']['is_guest']) {
1000
+									echo '
949 1001
 					<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'], '
950 1002
 					<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'];
1003
+				}
951 1004
 
952 1005
 				// This is for "forwarding" - even if the member is gone.
953
-				else
954
-					echo '
1006
+				else {
1007
+									echo '
955 1008
 					<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'];
1009
+				}
956 1010
 			}
957 1011
 
958 1012
 			echo '
@@ -961,27 +1015,30 @@  discard block
 block discarded – undo
961 1015
 		}
962 1016
 		// Otherwise just a simple list!
963 1017
 		// @todo No context at all of the search?
964
-		else
965
-			echo '
1018
+		else {
1019
+					echo '
966 1020
 				<tr class="windowbg">
967 1021
 					<td>', $message['time'], '</td>
968 1022
 					<td>', $message['link'], '</td>
969 1023
 					<td>', $message['member']['link'], '</td>
970 1024
 				</tr>';
1025
+		}
971 1026
 	}
972 1027
 
973 1028
 	// Finish off the page...
974
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
975
-		echo '
1029
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
1030
+			echo '
976 1031
 			</tbody>
977 1032
 		</table>';
1033
+	}
978 1034
 
979 1035
 	// No results?
980
-	if (empty($context['personal_messages']))
981
-		echo '
1036
+	if (empty($context['personal_messages'])) {
1037
+			echo '
982 1038
 		<div class="windowbg">
983 1039
 			<p class="centertext">', $txt['pm_search_none_found'], '</p>
984 1040
 		</div>';
1041
+	}
985 1042
 
986 1043
 	echo '
987 1044
 		<div class="pagesection">
@@ -1006,15 +1063,17 @@  discard block
 block discarded – undo
1006 1063
 		</div>
1007 1064
 		<div class="windowbg">';
1008 1065
 
1009
-		if (!empty($context['send_log']['sent']))
1010
-			foreach ($context['send_log']['sent'] as $log_entry)
1066
+		if (!empty($context['send_log']['sent'])) {
1067
+					foreach ($context['send_log']['sent'] as $log_entry)
1011 1068
 				echo '
1012 1069
 			<span class="error">', $log_entry, '</span><br>';
1070
+		}
1013 1071
 
1014
-		if (!empty($context['send_log']['failed']))
1015
-			foreach ($context['send_log']['failed'] as $log_entry)
1072
+		if (!empty($context['send_log']['failed'])) {
1073
+					foreach ($context['send_log']['failed'] as $log_entry)
1016 1074
 				echo '
1017 1075
 			<span class="error">', $log_entry, '</span><br>';
1076
+		}
1018 1077
 
1019 1078
 		echo '
1020 1079
 		</div>
@@ -1063,12 +1122,13 @@  discard block
 block discarded – undo
1063 1122
 					</dl>
1064 1123
 				</div>';
1065 1124
 
1066
-	if (!empty($modSettings['drafts_pm_enabled']))
1067
-		echo '
1125
+	if (!empty($modSettings['drafts_pm_enabled'])) {
1126
+			echo '
1068 1127
 				<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
1069 1128
 					sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), '
1070 1129
 					', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
1071 1130
 				</div>';
1131
+	}
1072 1132
 
1073 1133
 	echo '
1074 1134
 				<dl id="post_header">';
@@ -1117,26 +1177,29 @@  discard block
 block discarded – undo
1117 1177
 				<hr>';
1118 1178
 
1119 1179
 	// Showing BBC?
1120
-	if ($context['show_bbc'])
1121
-		echo '
1180
+	if ($context['show_bbc']) {
1181
+			echo '
1122 1182
 				<div id="bbcBox_message"></div>';
1183
+	}
1123 1184
 
1124 1185
 	// What about smileys?
1125
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
1126
-		echo '
1186
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
1187
+			echo '
1127 1188
 				<div id="smileyBox_message"></div>';
1189
+	}
1128 1190
 
1129 1191
 	// Show BBC buttons, smileys and textbox.
1130 1192
 	echo '
1131 1193
 				', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
1132 1194
 
1133 1195
 	// Require an image to be typed to save spamming?
1134
-	if ($context['require_verification'])
1135
-		echo '
1196
+	if ($context['require_verification']) {
1197
+			echo '
1136 1198
 				<div class="post_verification">
1137 1199
 					<strong>', $txt['pm_visual_verification_label'], ':</strong>
1138 1200
 					', template_control_verification($context['visual_verification_id'], 'all'), '
1139 1201
 				</div>';
1202
+	}
1140 1203
 
1141 1204
 	// Send, Preview, spellcheck buttons.
1142 1205
 	echo '
@@ -1169,10 +1232,11 @@  discard block
 block discarded – undo
1169 1232
 				<dt><strong>', $txt['subject'], '</strong></dt>
1170 1233
 				<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
1171 1234
 
1172
-		foreach ($context['drafts'] as $draft)
1173
-			echo '
1235
+		foreach ($context['drafts'] as $draft) {
1236
+					echo '
1174 1237
 				<dt>', $draft['link'], '</dt>
1175 1238
 				<dd>', $draft['poster_time'], '</dd>';
1239
+		}
1176 1240
 		echo '
1177 1241
 			</dl>
1178 1242
 		</div>';
@@ -1279,8 +1343,8 @@  discard block
 block discarded – undo
1279 1343
 			}';
1280 1344
 
1281 1345
 	// Code for showing and hiding drafts
1282
-	if (!empty($context['drafts']))
1283
-		echo '
1346
+	if (!empty($context['drafts'])) {
1347
+			echo '
1284 1348
 			var oSwapDraftOptions = new smc_Toggle({
1285 1349
 				bToggleEnabled: true,
1286 1350
 				bCurrentlyCollapsed: true,
@@ -1302,13 +1366,14 @@  discard block
 block discarded – undo
1302 1366
 					}
1303 1367
 				]
1304 1368
 			});';
1369
+	}
1305 1370
 
1306 1371
 	echo '
1307 1372
 		</script>';
1308 1373
 
1309 1374
 	// Show the message you're replying to.
1310
-	if ($context['reply'])
1311
-		echo '
1375
+	if ($context['reply']) {
1376
+			echo '
1312 1377
 		<br><br>
1313 1378
 		<div class="cat_bar">
1314 1379
 			<h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3>
@@ -1322,6 +1387,7 @@  discard block
 block discarded – undo
1322 1387
 			', $context['quoted_message']['body'], '
1323 1388
 		</div>
1324 1389
 		<br class="clear">';
1390
+	}
1325 1391
 
1326 1392
 	echo '
1327 1393
 		<script>
@@ -1333,23 +1399,25 @@  discard block
 block discarded – undo
1333 1399
 				sToControlId: \'to_control\',
1334 1400
 				aToRecipients: [';
1335 1401
 
1336
-	foreach ($context['recipients']['to'] as $i => $member)
1337
-		echo '
1402
+	foreach ($context['recipients']['to'] as $i => $member) {
1403
+			echo '
1338 1404
 					{
1339 1405
 						sItemId: ', JavaScriptEscape($member['id']), ',
1340 1406
 						sItemName: ', JavaScriptEscape($member['name']), '
1341 1407
 					}', $i == count($context['recipients']['to']) - 1 ? '' : ',';
1408
+	}
1342 1409
 
1343 1410
 	echo '
1344 1411
 				],
1345 1412
 				aBccRecipients: [';
1346 1413
 
1347
-	foreach ($context['recipients']['bcc'] as $i => $member)
1348
-		echo '
1414
+	foreach ($context['recipients']['bcc'] as $i => $member) {
1415
+			echo '
1349 1416
 					{
1350 1417
 						sItemId: ', JavaScriptEscape($member['id']), ',
1351 1418
 						sItemName: ', JavaScriptEscape($member['name']), '
1352 1419
 					}', $i == count($context['recipients']['bcc']) - 1 ? '' : ',';
1420
+	}
1353 1421
 
1354 1422
 	echo '
1355 1423
 				],
@@ -1438,26 +1506,28 @@  discard block
 block discarded – undo
1438 1506
 					</th>
1439 1507
 					<th class="centertext table_icon">';
1440 1508
 
1441
-	if (count($context['labels']) > 2)
1442
-		echo '
1509
+	if (count($context['labels']) > 2) {
1510
+			echo '
1443 1511
 						<input type="checkbox" onclick="invertAll(this, this.form);">';
1512
+	}
1444 1513
 
1445 1514
 	echo '
1446 1515
 					</th>
1447 1516
 				</tr>
1448 1517
 			</thead>
1449 1518
 			<tbody>';
1450
-	if (count($context['labels']) < 2)
1451
-		echo '
1519
+	if (count($context['labels']) < 2) {
1520
+			echo '
1452 1521
 				<tr class="windowbg">
1453 1522
 					<td colspan="2">', $txt['pm_labels_no_exist'], '</td>
1454 1523
 				</tr>';
1455
-	else
1524
+	} else
1456 1525
 	{
1457 1526
 		foreach ($context['labels'] as $label)
1458 1527
 		{
1459
-			if ($label['id'] == -1)
1460
-				continue;
1528
+			if ($label['id'] == -1) {
1529
+							continue;
1530
+			}
1461 1531
 
1462 1532
 				echo '
1463 1533
 				<tr class="windowbg">
@@ -1472,12 +1542,13 @@  discard block
 block discarded – undo
1472 1542
 			</tbody>
1473 1543
 		</table>';
1474 1544
 
1475
-	if (!count($context['labels']) < 2)
1476
-		echo '
1545
+	if (!count($context['labels']) < 2) {
1546
+			echo '
1477 1547
 		<div class="padding">
1478 1548
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1479 1549
 			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1480 1550
 		</div>';
1551
+	}
1481 1552
 
1482 1553
 	echo '
1483 1554
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1534,9 +1605,10 @@  discard block
 block discarded – undo
1534 1605
 					<select name="id_admin">
1535 1606
 						<option value="0">', $txt['pm_report_all_admins'], '</option>';
1536 1607
 
1537
-		foreach ($context['admins'] as $id => $name)
1538
-			echo '
1608
+		foreach ($context['admins'] as $id => $name) {
1609
+					echo '
1539 1610
 						<option value="', $id, '">', $name, '</option>';
1611
+		}
1540 1612
 
1541 1613
 		echo '
1542 1614
 					</select>
@@ -1599,9 +1671,10 @@  discard block
 block discarded – undo
1599 1671
 					</th>
1600 1672
 					<th class="centertext table_icon">';
1601 1673
 
1602
-	if (!empty($context['rules']))
1603
-		echo '
1674
+	if (!empty($context['rules'])) {
1675
+			echo '
1604 1676
 						<input type="checkbox" onclick="invertAll(this, this.form);">';
1677
+	}
1605 1678
 
1606 1679
 	echo '
1607 1680
 					</th>
@@ -1609,16 +1682,17 @@  discard block
 block discarded – undo
1609 1682
 			</thead>
1610 1683
 			<tbody>';
1611 1684
 
1612
-	if (empty($context['rules']))
1613
-		echo '
1685
+	if (empty($context['rules'])) {
1686
+			echo '
1614 1687
 				<tr class="windowbg">
1615 1688
 					<td colspan="2">
1616 1689
 						', $txt['pm_rules_none'], '
1617 1690
 					</td>
1618 1691
 				</tr>';
1692
+	}
1619 1693
 
1620
-	foreach ($context['rules'] as $rule)
1621
-		echo '
1694
+	foreach ($context['rules'] as $rule) {
1695
+			echo '
1622 1696
 				<tr class="windowbg">
1623 1697
 					<td>
1624 1698
 						<a href="', $scripturl, '?action=pm;sa=manrules;add;rid=', $rule['id'], '">', $rule['name'], '</a>
@@ -1627,6 +1701,7 @@  discard block
 block discarded – undo
1627 1701
 						<input type="checkbox" name="delrule[', $rule['id'], ']">
1628 1702
 					</td>
1629 1703
 				</tr>';
1704
+	}
1630 1705
 
1631 1706
 	echo '
1632 1707
 			</tbody>
@@ -1634,14 +1709,16 @@  discard block
 block discarded – undo
1634 1709
 		<div class="righttext">
1635 1710
 			<a class="button" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>';
1636 1711
 
1637
-	if (!empty($context['rules']))
1638
-		echo '
1712
+	if (!empty($context['rules'])) {
1713
+			echo '
1639 1714
 			[<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>]';
1715
+	}
1640 1716
 
1641
-	if (!empty($context['rules']))
1642
-		echo '
1717
+	if (!empty($context['rules'])) {
1718
+			echo '
1643 1719
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1644 1720
 			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1721
+	}
1645 1722
 
1646 1723
 	echo '
1647 1724
 		</div>
@@ -1663,14 +1740,16 @@  discard block
 block discarded – undo
1663 1740
 		var groups = new Array()
1664 1741
 		var labels = new Array()';
1665 1742
 
1666
-	foreach ($context['groups'] as $id => $title)
1667
-		echo '
1743
+	foreach ($context['groups'] as $id => $title) {
1744
+			echo '
1668 1745
 		groups[', $id, '] = "', addslashes($title), '";';
1746
+	}
1669 1747
 
1670
-	foreach ($context['labels'] as $label)
1671
-		if ($label['id'] != -1)
1748
+	foreach ($context['labels'] as $label) {
1749
+			if ($label['id'] != -1)
1672 1750
 			echo '
1673 1751
 		labels[', ($label['id']), '] = "', addslashes($label['name']), '";';
1752
+	}
1674 1753
 
1675 1754
 	echo '
1676 1755
 		function addCriteriaOption()
@@ -1685,8 +1764,9 @@  discard block
 block discarded – undo
1685 1764
 
1686 1765
 			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>';
1687 1766
 
1688
-	foreach ($context['groups'] as $id => $group)
1689
-		echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1767
+	foreach ($context['groups'] as $id => $group) {
1768
+			echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1769
+	}
1690 1770
 
1691 1771
 	echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\');
1692 1772
 			}
@@ -1703,9 +1783,10 @@  discard block
 block discarded – undo
1703 1783
 
1704 1784
 				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>';
1705 1785
 
1706
-	foreach ($context['labels'] as $label)
1707
-		if ($label['id'] != -1)
1786
+	foreach ($context['labels'] as $label) {
1787
+			if ($label['id'] != -1)
1708 1788
 			echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>';
1789
+	}
1709 1790
 
1710 1791
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
1711 1792
 			}
@@ -1819,19 +1900,20 @@  discard block
 block discarded – undo
1819 1900
 	$isFirst = true;
1820 1901
 	foreach ($context['rule']['criteria'] as $k => $criteria)
1821 1902
 	{
1822
-		if (!$isFirst && $criteria['t'] == '')
1823
-			echo '<div id="removeonjs1">';
1824
-
1825
-		elseif (!$isFirst)
1826
-			echo '<br>';
1903
+		if (!$isFirst && $criteria['t'] == '') {
1904
+					echo '<div id="removeonjs1">';
1905
+		} elseif (!$isFirst) {
1906
+					echo '<br>';
1907
+		}
1827 1908
 
1828 1909
 		echo '
1829 1910
 				<select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();">
1830 1911
 					<option value="">', $txt['pm_rule_criteria_pick'], ':</option>';
1831 1912
 
1832
-		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr)
1833
-			echo '
1913
+		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) {
1914
+					echo '
1834 1915
 					<option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>';
1916
+		}
1835 1917
 
1836 1918
 		echo '
1837 1919
 				</select>
@@ -1842,19 +1924,20 @@  discard block
 block discarded – undo
1842 1924
 					<select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();">
1843 1925
 						<option value="">', $txt['pm_rule_sel_group'], '</option>';
1844 1926
 
1845
-		foreach ($context['groups'] as $id => $group)
1846
-			echo '
1927
+		foreach ($context['groups'] as $id => $group) {
1928
+					echo '
1847 1929
 						<option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>';
1930
+		}
1848 1931
 		echo '
1849 1932
 					</select>
1850 1933
 				</span>';
1851 1934
 
1852 1935
 		// If this is the dummy we add a means to hide for non js users.
1853
-		if ($isFirst)
1854
-			$isFirst = false;
1855
-
1856
-		elseif ($criteria['t'] == '')
1857
-			echo '</div><!-- .removeonjs1 -->';
1936
+		if ($isFirst) {
1937
+					$isFirst = false;
1938
+		} elseif ($criteria['t'] == '') {
1939
+					echo '</div><!-- .removeonjs1 -->';
1940
+		}
1858 1941
 	}
1859 1942
 
1860 1943
 	echo '
@@ -1877,10 +1960,11 @@  discard block
 block discarded – undo
1877 1960
 	$isFirst = true;
1878 1961
 	foreach ($context['rule']['actions'] as $k => $action)
1879 1962
 	{
1880
-		if (!$isFirst && $action['t'] == '')
1881
-			echo '<div id="removeonjs2">';
1882
-		elseif (!$isFirst)
1883
-			echo '<br>';
1963
+		if (!$isFirst && $action['t'] == '') {
1964
+					echo '<div id="removeonjs2">';
1965
+		} elseif (!$isFirst) {
1966
+					echo '<br>';
1967
+		}
1884 1968
 
1885 1969
 		echo '
1886 1970
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
@@ -1892,20 +1976,21 @@  discard block
 block discarded – undo
1892 1976
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
1893 1977
 						<option value="">', $txt['pm_rule_sel_label'], '</option>';
1894 1978
 
1895
-		foreach ($context['labels'] as $label)
1896
-			if ($label['id'] != -1)
1979
+		foreach ($context['labels'] as $label) {
1980
+					if ($label['id'] != -1)
1897 1981
 				echo '
1898 1982
 						<option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>';
1983
+		}
1899 1984
 
1900 1985
 		echo '
1901 1986
 					</select>
1902 1987
 				</span>';
1903 1988
 
1904
-		if ($isFirst)
1905
-			$isFirst = false;
1906
-
1907
-		elseif ($action['t'] == '')
1908
-			echo '</div><!-- .removeonjs2 -->';
1989
+		if ($isFirst) {
1990
+					$isFirst = false;
1991
+		} elseif ($action['t'] == '') {
1992
+					echo '</div><!-- .removeonjs2 -->';
1993
+		}
1909 1994
 	}
1910 1995
 
1911 1996
 	echo '
@@ -1929,22 +2014,25 @@  discard block
 block discarded – undo
1929 2014
 		echo '
1930 2015
 	<script>';
1931 2016
 
1932
-	foreach ($context['rule']['criteria'] as $k => $c)
1933
-		echo '
2017
+	foreach ($context['rule']['criteria'] as $k => $c) {
2018
+			echo '
1934 2019
 			updateRuleDef(', $k, ');';
2020
+	}
1935 2021
 
1936
-	foreach ($context['rule']['actions'] as $k => $c)
1937
-		echo '
2022
+	foreach ($context['rule']['actions'] as $k => $c) {
2023
+			echo '
1938 2024
 			updateActionDef(', $k, ');';
2025
+	}
1939 2026
 
1940 2027
 	echo '
1941 2028
 			rebuildRuleDesc();';
1942 2029
 
1943 2030
 	// If this isn't a new rule and we have JS enabled remove the JS compatibility stuff.
1944
-	if ($context['rid'])
1945
-		echo '
2031
+	if ($context['rid']) {
2032
+			echo '
1946 2033
 			document.getElementById("removeonjs1").style.display = "none";
1947 2034
 			document.getElementById("removeonjs2").style.display = "none";';
2035
+	}
1948 2036
 
1949 2037
 	echo '
1950 2038
 			document.getElementById("addonjs1").style.display = "";
@@ -1972,12 +2060,12 @@  discard block
 block discarded – undo
1972 2060
 		</div>';
1973 2061
 
1974 2062
 	// No drafts? Just show an informative message.
1975
-	if (empty($context['drafts']))
1976
-		echo '
2063
+	if (empty($context['drafts'])) {
2064
+			echo '
1977 2065
 		<div class="windowbg2 centertext">
1978 2066
 			', $txt['draft_none'], '
1979 2067
 		</div>';
1980
-	else
2068
+	} else
1981 2069
 	{
1982 2070
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
1983 2071
 		foreach ($context['drafts'] as $draft)
Please login to merge, or discard this patch.
Themes/default/Themes.template.php 1 patch
Braces   +121 added lines, -92 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
 					<dd>
55 55
 						<div id="known_themes_list">';
56 56
 
57
-	foreach ($context['themes'] as $theme)
58
-		echo '
57
+	foreach ($context['themes'] as $theme) {
58
+			echo '
59 59
 							<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', '> ', $theme['name'], '</label><br>';
60
+	}
60 61
 
61 62
 	echo '
62 63
 						</div>
@@ -73,9 +74,10 @@  discard block
 block discarded – undo
73 74
 						<select name="options[theme_guests]" id="theme_guests">';
74 75
 
75 76
 	// Put an option for each theme in the select box.
76
-	foreach ($context['themes'] as $theme)
77
-		echo '
77
+	foreach ($context['themes'] as $theme) {
78
+			echo '
78 79
 							<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
80
+	}
79 81
 
80 82
 	echo '
81 83
 						</select>
@@ -90,9 +92,10 @@  discard block
 block discarded – undo
90 92
 							<option value="0">', $txt['theme_forum_default'], '</option>';
91 93
 
92 94
 	// Same thing, this time for changing the theme of everyone.
93
-	foreach ($context['themes'] as $theme)
94
-		echo '
95
+	foreach ($context['themes'] as $theme) {
96
+			echo '
95 97
 							<option value="', $theme['id'], '">', $theme['name'], '</option>';
98
+	}
96 99
 
97 100
 	echo '
98 101
 						</select>
@@ -187,11 +190,12 @@  discard block
 block discarded – undo
187 190
 	global $context, $scripturl, $txt;
188 191
 
189 192
 	// Show a nice confirmation message.
190
-	if (isset($_GET['done']))
191
-		echo '
193
+	if (isset($_GET['done'])) {
194
+			echo '
192 195
 	<div class="infobox">
193 196
 		', $txt['theme_confirmed_' . $_GET['done']], '
194 197
 	</div>';
198
+	}
195 199
 
196 200
 	echo '
197 201
 	<div id="admincenter">
@@ -354,11 +358,12 @@  discard block
 block discarded – undo
354 358
 		if (empty($setting) || !is_array($setting))
355 359
 		{
356 360
 			// Insert a separator (unless this is the first item in the list)
357
-			if ($i !== $first_option_key)
358
-				echo '
361
+			if ($i !== $first_option_key) {
362
+							echo '
359 363
 				</dl>
360 364
 				<hr>
361 365
 				<dl class="settings">';
366
+			}
362 367
 
363 368
 			// Should we give a name to this section?
364 369
 			if (is_string($setting) && !empty($setting))
@@ -367,9 +372,9 @@  discard block
 block discarded – undo
367 372
 				echo '
368 373
 					<dt><strong>' . $setting . '</strong></dt>
369 374
 					<dd></dd>';
375
+			} else {
376
+							$titled_section = false;
370 377
 			}
371
-			else
372
-				$titled_section = false;
373 378
 
374 379
 			continue;
375 380
 		}
@@ -378,8 +383,8 @@  discard block
 block discarded – undo
378 383
 					<dt>';
379 384
 
380 385
 		// Show the change option box?
381
-		if ($context['theme_options_reset'])
382
-			echo '
386
+		if ($context['theme_options_reset']) {
387
+					echo '
383 388
 						<span class="floatleft">
384 389
 							<select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;">
385 390
 								<option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option>
@@ -387,23 +392,26 @@  discard block
 block discarded – undo
387 392
 								<option value="2">', $txt['themeadmin_reset_options_default'], '</option>
388 393
 							</select>
389 394
 						</span>';
395
+		}
390 396
 
391 397
 		echo '
392 398
 						<label for="options_', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>';
393 399
 
394
-		if (isset($setting['description']))
395
-			echo '
400
+		if (isset($setting['description'])) {
401
+					echo '
396 402
 						<br>
397 403
 						<span class="smalltext">', $setting['description'], '</span>';
404
+		}
398 405
 		echo '
399 406
 					</dt>';
400 407
 
401 408
 		// Display checkbox options
402
-		if ($setting['type'] == 'checkbox')
403
-			echo '
409
+		if ($setting['type'] == 'checkbox') {
410
+					echo '
404 411
 					<dd>
405 412
 						<input type="hidden" name="' . (!empty($setting['default']) ? 'default_' : '') . 'options[' . $setting['id'] . ']" value="0">
406 413
 						<input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', $context['theme_options_reset'] ? ' disabled' : '', ' value="1" class="floatleft">';
414
+		}
407 415
 
408 416
 		// How about selection lists, we all love them
409 417
 		elseif ($setting['type'] == 'list')
@@ -412,9 +420,10 @@  discard block
 block discarded – undo
412 420
 					<dd>
413 421
 						<select class="floatleft" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '"', $context['theme_options_reset'] ? ' disabled' : '', '>';
414 422
 
415
-			foreach ($setting['options'] as $value => $label)
416
-				echo '
423
+			foreach ($setting['options'] as $value => $label) {
424
+							echo '
417 425
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
426
+			}
418 427
 
419 428
 			echo '
420 429
 						</select>';
@@ -433,14 +442,13 @@  discard block
 block discarded – undo
433 442
 
434 443
 				echo '
435 444
 						<input type="number"', $min . $max . $step;
436
-			}
437
-			elseif (isset($setting['type']) && $setting['type'] == 'url')
438
-				echo'
445
+			} elseif (isset($setting['type']) && $setting['type'] == 'url') {
446
+							echo'
439 447
 						<input type="url"';
440
-
441
-			else
442
-				echo '
448
+			} else {
449
+							echo '
443 450
 						<input type="text"';
451
+			}
444 452
 
445 453
 			echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : '', $context['theme_options_reset'] ? ' disabled' : '', '>';
446 454
 		}
@@ -479,8 +487,8 @@  discard block
 block discarded – undo
479 487
 			<br>';
480 488
 
481 489
 	// @todo Why can't I edit the default theme popup.
482
-	if ($context['theme_settings']['theme_id'] != 1)
483
-		echo '
490
+	if ($context['theme_settings']['theme_id'] != 1) {
491
+			echo '
484 492
 			<div class="cat_bar">
485 493
 				<h3 class="catbg config_hd">
486 494
 					', $txt['theme_edit'], '
@@ -496,6 +504,7 @@  discard block
 block discarded – undo
496 504
 					</li>
497 505
 				</ul>
498 506
 			</div>';
507
+	}
499 508
 
500 509
 	echo '
501 510
 			<div class="cat_bar">
@@ -549,9 +558,10 @@  discard block
 block discarded – undo
549 558
 					<dd>
550 559
 						<select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">';
551 560
 
552
-		foreach ($context['theme_variants'] as $key => $variant)
553
-			echo '
561
+		foreach ($context['theme_variants'] as $key => $variant) {
562
+					echo '
554 563
 							<option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
564
+		}
555 565
 
556 566
 		echo '
557 567
 						</select>
@@ -587,11 +597,12 @@  discard block
 block discarded – undo
587 597
 		if (empty($setting) || !is_array($setting))
588 598
 		{
589 599
 			// We don't need a separator before the first list element
590
-			if ($i !== $first_setting_key)
591
-				echo '
600
+			if ($i !== $first_setting_key) {
601
+							echo '
592 602
 				</dl>
593 603
 				<hr>
594 604
 				<dl class="settings">';
605
+			}
595 606
 
596 607
 			// Add a fake heading?
597 608
 			if (is_string($setting) && !empty($setting))
@@ -600,9 +611,9 @@  discard block
 block discarded – undo
600 611
 				echo '
601 612
 					<dt><strong>' . $setting . '</strong></dt>
602 613
 					<dd></dd>';
614
+			} else {
615
+							$titled_section = false;
603 616
 			}
604
-			else
605
-				$titled_section = false;
606 617
 
607 618
 			continue;
608 619
 		}
@@ -611,20 +622,22 @@  discard block
 block discarded – undo
611 622
 					<dt>
612 623
 						<label for="', $setting['id'], '">', !$titled_section ? '<strong>' : '', $setting['label'], !$titled_section ? '</strong>' : '', '</label>:';
613 624
 
614
-		if (isset($setting['description']))
615
-			echo '<br>
625
+		if (isset($setting['description'])) {
626
+					echo '<br>
616 627
 						<span class="smalltext">', $setting['description'], '</span>';
628
+		}
617 629
 
618 630
 		echo '
619 631
 					</dt>';
620 632
 
621 633
 		// A checkbox?
622
-		if ($setting['type'] == 'checkbox')
623
-			echo '
634
+		if ($setting['type'] == 'checkbox') {
635
+					echo '
624 636
 					<dd>
625 637
 						<input type="hidden" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" value="0">
626 638
 						<input type="checkbox" name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '"', !empty($setting['value']) ? ' checked' : '', ' value="1">
627 639
 					</dd>';
640
+		}
628 641
 
629 642
 		// A list with options?
630 643
 		elseif ($setting['type'] == 'list')
@@ -633,9 +646,10 @@  discard block
 block discarded – undo
633 646
 					<dd>
634 647
 						<select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">';
635 648
 
636
-			foreach ($setting['options'] as $value => $label)
637
-				echo '
649
+			foreach ($setting['options'] as $value => $label) {
650
+							echo '
638 651
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
652
+			}
639 653
 
640 654
 			echo '
641 655
 						</select>
@@ -663,14 +677,13 @@  discard block
 block discarded – undo
663 677
 
664 678
 				echo '
665 679
 						<input type="number"', $min . $max . $step;
666
-			}
667
-			elseif (isset($setting['type']) && $setting['type'] == 'url')
668
-				echo'
680
+			} elseif (isset($setting['type']) && $setting['type'] == 'url') {
681
+							echo'
669 682
 						<input type="url"';
670
-
671
-			else
672
-				echo '
683
+			} else {
684
+							echo '
673 685
 						<input type="text"';
686
+			}
674 687
 
675 688
 			echo ' name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="options_', $setting['id'], '" value="', $setting['value'], '"', $setting['type'] == 'number' ? ' size="5"' : (empty($settings['size']) ? ' size="40"' : ' size="' . $setting['size'] . '"'), '>
676 689
 					</dd>';
@@ -742,9 +755,10 @@  discard block
 block discarded – undo
742 755
 					<label for="variant', $theme['id'], '"><strong>', $theme['pick_label'], '</strong></label>:
743 756
 					<select id="variant', $theme['id'], '" name="vrt[', $theme['id'], ']" onchange="changeVariant', $theme['id'], '(this.value);">';
744 757
 
745
-			foreach ($theme['variants'] as $key => $variant)
746
-				echo '
758
+			foreach ($theme['variants'] as $key => $variant) {
759
+							echo '
747 760
 						<option value="', $key, '"', $theme['selected_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
761
+			}
748 762
 
749 763
 			echo '
750 764
 					</select>
@@ -822,21 +836,23 @@  discard block
 block discarded – undo
822 836
 		<div class="windowbg">';
823 837
 
824 838
 	// Oops! there was an error :(
825
-	if (!empty($context['error_message']))
826
-		echo '
839
+	if (!empty($context['error_message'])) {
840
+			echo '
827 841
 			<p>
828 842
 				', $context['error_message'], '
829 843
 			</p>';
844
+	}
830 845
 
831 846
 	// Not much to show except a link back...
832
-	else
833
-		echo '
847
+	else {
848
+			echo '
834 849
 			<p>
835 850
 				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_' . (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') . '_message'], '
836 851
 			</p>
837 852
 			<p>
838 853
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
839 854
 			</p>';
855
+	}
840 856
 
841 857
 	echo '
842 858
 		</div><!-- .windowbg -->
@@ -903,11 +919,12 @@  discard block
 block discarded – undo
903 919
 					<span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span>
904 920
 					<span class="floatright">';
905 921
 
906
-		if ($template['can_copy'])
907
-			echo '
922
+		if ($template['can_copy']) {
923
+					echo '
908 924
 						<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
909
-		else
910
-			echo $txt['themeadmin_edit_no_copy'];
925
+		} else {
926
+					echo $txt['themeadmin_edit_no_copy'];
927
+		}
911 928
 
912 929
 		echo '
913 930
 					</span>
@@ -930,11 +947,12 @@  discard block
 block discarded – undo
930 947
 	echo '
931 948
 	<div id="admincenter">';
932 949
 
933
-	if (!empty($context['browse_title']))
934
-		echo '
950
+	if (!empty($context['browse_title'])) {
951
+			echo '
935 952
 		<div class="cat_bar">
936 953
 			<h3 class="catbg">', $context['browse_title'], '</h3>
937 954
 		</div>';
955
+	}
938 956
 
939 957
 	echo '
940 958
 		<table class="table_grid tborder">
@@ -954,16 +972,15 @@  discard block
 block discarded – undo
954 972
 				<tr class="windowbg">
955 973
 					<td>';
956 974
 
957
-		if ($file['is_editable'])
958
-			echo '
975
+		if ($file['is_editable']) {
976
+					echo '
959 977
 						<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
960
-
961
-		elseif ($file['is_directory'])
962
-			echo '
978
+		} elseif ($file['is_directory']) {
979
+					echo '
963 980
 						<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
964
-
965
-		else
966
-			echo $file['filename'];
981
+		} else {
982
+					echo $file['filename'];
983
+		}
967 984
 
968 985
 		echo '
969 986
 					</td>
@@ -985,11 +1002,12 @@  discard block
 block discarded – undo
985 1002
 {
986 1003
 	global $context, $settings, $scripturl, $txt;
987 1004
 
988
-	if ($context['session_error'])
989
-		echo '
1005
+	if ($context['session_error']) {
1006
+			echo '
990 1007
 	<div class="errorbox">
991 1008
 		', $txt['error_session_timeout'], '
992 1009
 	</div>';
1010
+	}
993 1011
 
994 1012
 	// From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com.
995 1013
 	echo '
@@ -1053,17 +1071,18 @@  discard block
 block discarded – undo
1053 1071
 					{
1054 1072
 					';
1055 1073
 
1056
-	if (isBrowser('is_ie'))
1057
-		echo '
1074
+	if (isBrowser('is_ie')) {
1075
+			echo '
1058 1076
 						var sheets = frames["css_preview_box"].document.styleSheets;
1059 1077
 						for (var j = 0; j < sheets.length; j++)
1060 1078
 						{
1061 1079
 							if (sheets[j].id == "css_preview_box")
1062 1080
 								sheets[j].cssText = document.forms.stylesheetForm.entire_file.value;
1063 1081
 						}';
1064
-	else
1065
-		echo '
1082
+	} else {
1083
+			echo '
1066 1084
 						setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);';
1085
+	}
1067 1086
 	echo '
1068 1087
 					}
1069 1088
 					catch (e)
@@ -1115,9 +1134,10 @@  discard block
 block discarded – undo
1115 1134
 			</div>
1116 1135
 			<div class="windowbg">';
1117 1136
 
1118
-	if (!$context['allow_save'])
1119
-		echo '
1137
+	if (!$context['allow_save']) {
1138
+			echo '
1120 1139
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1140
+	}
1121 1141
 
1122 1142
 	echo '
1123 1143
 				<textarea class="edit_file" name="entire_file" cols="80" rows="20" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea>
@@ -1131,9 +1151,10 @@  discard block
 block discarded – undo
1131 1151
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1132 1152
 
1133 1153
 	// Hopefully it exists.
1134
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1135
-		echo '
1154
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1155
+			echo '
1136 1156
 			<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1157
+	}
1137 1158
 
1138 1159
 	echo '
1139 1160
 		</form>
@@ -1147,18 +1168,20 @@  discard block
 block discarded – undo
1147 1168
 {
1148 1169
 	global $context, $scripturl, $txt;
1149 1170
 
1150
-	if ($context['session_error'])
1151
-		echo '
1171
+	if ($context['session_error']) {
1172
+			echo '
1152 1173
 	<div class="errorbox">
1153 1174
 		', $txt['error_session_timeout'], '
1154 1175
 	</div>';
1176
+	}
1155 1177
 
1156
-	if (isset($context['parse_error']))
1157
-		echo '
1178
+	if (isset($context['parse_error'])) {
1179
+			echo '
1158 1180
 	<div class="errorbox">
1159 1181
 		', $txt['themeadmin_edit_error'], '
1160 1182
 		<div><pre>', $context['parse_error'], '</pre></div>
1161 1183
 	</div>';
1184
+	}
1162 1185
 
1163 1186
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1164 1187
 	echo '
@@ -1169,16 +1192,18 @@  discard block
 block discarded – undo
1169 1192
 			</div>
1170 1193
 			<div class="windowbg">';
1171 1194
 
1172
-	if (!$context['allow_save'])
1173
-		echo '
1195
+	if (!$context['allow_save']) {
1196
+			echo '
1174 1197
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1198
+	}
1175 1199
 
1176
-	foreach ($context['file_parts'] as $part)
1177
-		echo '
1200
+	foreach ($context['file_parts'] as $part) {
1201
+			echo '
1178 1202
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1179 1203
 				<div class="centertext">
1180 1204
 					<textarea id="on_line', $part['line'], '" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1181 1205
 				</div>';
1206
+	}
1182 1207
 
1183 1208
 	echo '
1184 1209
 				<div class="padding righttext">
@@ -1187,9 +1212,10 @@  discard block
 block discarded – undo
1187 1212
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1188 1213
 
1189 1214
 	// Hopefully it exists.
1190
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1191
-		echo '
1215
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1216
+			echo '
1192 1217
 					<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1218
+	}
1193 1219
 
1194 1220
 	echo '
1195 1221
 				</div><!-- .righttext -->
@@ -1205,18 +1231,20 @@  discard block
 block discarded – undo
1205 1231
 {
1206 1232
 	global $context, $scripturl, $txt;
1207 1233
 
1208
-	if ($context['session_error'])
1209
-		echo '
1234
+	if ($context['session_error']) {
1235
+			echo '
1210 1236
 	<div class="errorbox">
1211 1237
 		', $txt['error_session_timeout'], '
1212 1238
 	</div>';
1239
+	}
1213 1240
 
1214 1241
 	// Is this file writeable?
1215
-	if (!$context['allow_save'])
1216
-		echo '
1242
+	if (!$context['allow_save']) {
1243
+			echo '
1217 1244
 	<div class="errorbox">
1218 1245
 		', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '
1219 1246
 	</div>';
1247
+	}
1220 1248
 
1221 1249
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1222 1250
 	echo '
@@ -1232,9 +1260,10 @@  discard block
 block discarded – undo
1232 1260
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1233 1261
 
1234 1262
 	// Hopefully it exists.
1235
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1236
-		echo '
1263
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1264
+			echo '
1237 1265
 				<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1266
+	}
1238 1267
 
1239 1268
 	echo '
1240 1269
 			</div><!-- .windowbg -->
Please login to merge, or discard this patch.
Themes/default/GenericMenu.template.php 1 patch
Braces   +54 added lines, -39 removed lines patch added patch discarded remove patch
@@ -89,16 +89,18 @@  discard block
 block discarded – undo
89 89
 		foreach ($section['areas'] as $i => $area)
90 90
 		{
91 91
 			// Not supposed to be printed?
92
-			if (empty($area['label']))
93
-				continue;
92
+			if (empty($area['label'])) {
93
+							continue;
94
+			}
94 95
 
95 96
 			echo '
96 97
 								<li', !empty($area['subsections']) ? ' class="subsections"' : '', '>
97 98
 									<a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>';
98 99
 
99 100
 			// Is this the current area, or just some area?
100
-			if (!empty($area['selected']) && empty($context['tabs']))
101
-					$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
101
+			if (!empty($area['selected']) && empty($context['tabs'])) {
102
+								$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
103
+			}
102 104
 
103 105
 			// Are there any subsections?
104 106
 			if (!empty($area['subsections']))
@@ -108,8 +110,9 @@  discard block
 block discarded – undo
108 110
 
109 111
 				foreach ($area['subsections'] as $sa => $sub)
110 112
 				{
111
-					if (!empty($sub['disabled']))
112
-						continue;
113
+					if (!empty($sub['disabled'])) {
114
+											continue;
115
+					}
113 116
 
114 117
 					$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
115 118
 
@@ -156,8 +159,9 @@  discard block
 block discarded – undo
156 159
 							<h3 class="catbg">';
157 160
 
158 161
 		// The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available
159
-		if (function_exists('template_admin_quick_search'))
160
-			template_admin_quick_search();
162
+		if (function_exists('template_admin_quick_search')) {
163
+					template_admin_quick_search();
164
+		}
161 165
 
162 166
 		// Exactly how many tabs do we have?
163 167
 		if (!empty($context['tabs']))
@@ -172,30 +176,36 @@  discard block
 block discarded – undo
172 176
 				}
173 177
 
174 178
 				// Did this not even exist - or do we not have a label?
175
-				if (!isset($tab_context['tabs'][$id]))
176
-					$tab_context['tabs'][$id] = array('label' => $tab['label']);
177
-				elseif (!isset($tab_context['tabs'][$id]['label']))
178
-					$tab_context['tabs'][$id]['label'] = $tab['label'];
179
+				if (!isset($tab_context['tabs'][$id])) {
180
+									$tab_context['tabs'][$id] = array('label' => $tab['label']);
181
+				} elseif (!isset($tab_context['tabs'][$id]['label'])) {
182
+									$tab_context['tabs'][$id]['label'] = $tab['label'];
183
+				}
179 184
 
180 185
 				// Has a custom URL defined in the main admin structure?
181
-				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
182
-					$tab_context['tabs'][$id]['url'] = $tab['url'];
186
+				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) {
187
+									$tab_context['tabs'][$id]['url'] = $tab['url'];
188
+				}
183 189
 
184 190
 				// Any additional paramaters for the url?
185
-				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
186
-					$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
191
+				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) {
192
+									$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
193
+				}
187 194
 
188 195
 				// Has it been deemed selected?
189
-				if (!empty($tab['is_selected']))
190
-					$tab_context['tabs'][$id]['is_selected'] = true;
196
+				if (!empty($tab['is_selected'])) {
197
+									$tab_context['tabs'][$id]['is_selected'] = true;
198
+				}
191 199
 
192 200
 				// Does it have its own help?
193
-				if (!empty($tab['help']))
194
-					$tab_context['tabs'][$id]['help'] = $tab['help'];
201
+				if (!empty($tab['help'])) {
202
+									$tab_context['tabs'][$id]['help'] = $tab['help'];
203
+				}
195 204
 
196 205
 				// Is this the last one?
197
-				if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
198
-					$tab_context['tabs'][$id]['is_last'] = true;
206
+				if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) {
207
+									$tab_context['tabs'][$id]['is_last'] = true;
208
+				}
199 209
 			}
200 210
 
201 211
 			// Find the selected tab
@@ -212,22 +222,24 @@  discard block
 block discarded – undo
212 222
 		// Show an icon and/or a help item?
213 223
 		if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
214 224
 		{
215
-			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']))
216
-				echo '
225
+			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) {
226
+							echo '
217 227
 								<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
218
-			elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
219
-				echo '
228
+			} elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) {
229
+							echo '
220 230
 								<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
231
+			}
221 232
 
222
-			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
223
-				echo '
233
+			if (!empty($selected_tab['help']) || !empty($tab_context['help'])) {
234
+							echo '
224 235
 								<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a>';
236
+			}
225 237
 
226 238
 			echo $tab_context['title'];
227
-		}
228
-		else
229
-			echo '
239
+		} else {
240
+					echo '
230 241
 								', $tab_context['title'];
242
+		}
231 243
 
232 244
 		echo '
233 245
 							</h3>', (function_exists('template_admin_quick_search') ? '
@@ -236,11 +248,12 @@  discard block
 block discarded – undo
236 248
 	}
237 249
 
238 250
 	// Shall we use the tabs? Yes, it's the only known way!
239
-	if (!empty($selected_tab['description']) || !empty($tab_context['description']))
240
-		echo '
251
+	if (!empty($selected_tab['description']) || !empty($tab_context['description'])) {
252
+			echo '
241 253
 					<p class="information">
242 254
 						', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
243 255
 					</p>';
256
+	}
244 257
 
245 258
 	// Print out all the items in this tab (if any).
246 259
 	if (!empty($context['tabs']))
@@ -252,19 +265,21 @@  discard block
 block discarded – undo
252 265
 
253 266
 		foreach ($tab_context['tabs'] as $sa => $tab)
254 267
 		{
255
-			if (!empty($tab['disabled']))
256
-				continue;
268
+			if (!empty($tab['disabled'])) {
269
+							continue;
270
+			}
257 271
 
258
-			if (!empty($tab['is_selected']))
259
-				echo '
272
+			if (!empty($tab['is_selected'])) {
273
+							echo '
260 274
 							<li>
261 275
 								<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
262 276
 							</li>';
263
-			else
264
-				echo '
277
+			} else {
278
+							echo '
265 279
 							<li>
266 280
 								<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
267 281
 							</li>';
282
+			}
268 283
 		}
269 284
 
270 285
 		// The end of tabs
Please login to merge, or discard this patch.
Themes/default/Reports.template.php 1 patch
Braces   +32 added lines, -24 removed lines patch added patch discarded remove patch
@@ -29,9 +29,10 @@  discard block
 block discarded – undo
29 29
 	// Go through each type of report they can run.
30 30
 	foreach ($context['report_types'] as $type)
31 31
 	{
32
-		if (isset($type['description']))
33
-			echo '
32
+		if (isset($type['description'])) {
33
+					echo '
34 34
 					<dt>', $type['description'], '</dt>';
35
+		}
35 36
 
36 37
 		echo '
37 38
 					<dd>
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
 		</div>
63 64
 		<div id="report_buttons">';
64 65
 
65
-	if (!empty($context['report_buttons']))
66
-		template_button_strip($context['report_buttons'], 'right');
66
+	if (!empty($context['report_buttons'])) {
67
+			template_button_strip($context['report_buttons'], 'right');
68
+	}
67 69
 
68 70
 	echo '
69 71
 		</div>';
@@ -74,25 +76,27 @@  discard block
 block discarded – undo
74 76
 		echo '
75 77
 		<table class="table_grid report_results">';
76 78
 
77
-		if (!empty($table['title']))
78
-			echo '
79
+		if (!empty($table['title'])) {
80
+					echo '
79 81
 			<thead>
80 82
 				<tr class="title_bar">
81 83
 					<th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th>
82 84
 				</tr>
83 85
 			</thead>
84 86
 			<tbody>';
87
+		}
85 88
 
86 89
 		// Now do each row!
87 90
 		$row_number = 0;
88 91
 		foreach ($table['data'] as $row)
89 92
 		{
90
-			if ($row_number == 0 && !empty($table['shading']['top']))
91
-				echo '
93
+			if ($row_number == 0 && !empty($table['shading']['top'])) {
94
+							echo '
92 95
 				<tr class="windowbg table_caption">';
93
-			else
94
-				echo '
96
+			} else {
97
+							echo '
95 98
 				<tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">';
99
+			}
96 100
 
97 101
 			// Now do each column.
98 102
 			$column_number = 0;
@@ -110,16 +114,17 @@  discard block
 block discarded – undo
110 114
 				}
111 115
 
112 116
 				// Shaded?
113
-				if ($column_number == 0 && !empty($table['shading']['left']))
114
-					echo '
117
+				if ($column_number == 0 && !empty($table['shading']['left'])) {
118
+									echo '
115 119
 					<td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '>
116 120
 						', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), '
117 121
 					</td>';
118
-				else
119
-					echo '
122
+				} else {
123
+									echo '
120 124
 					<td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '>
121 125
 						', $data['v'], '
122 126
 					</td>';
127
+				}
123 128
 
124 129
 				$column_number++;
125 130
 			}
@@ -168,24 +173,26 @@  discard block
 block discarded – undo
168 173
 		<div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '">
169 174
 			<table class="bordercolor">';
170 175
 
171
-		if (!empty($table['title']))
172
-			echo '
176
+		if (!empty($table['title'])) {
177
+					echo '
173 178
 				<tr class="title_bar">
174 179
 					<td colspan="', $table['column_count'], '">
175 180
 						', $table['title'], '
176 181
 					</td>
177 182
 				</tr>';
183
+		}
178 184
 
179 185
 		// Now do each row!
180 186
 		$row_number = 0;
181 187
 		foreach ($table['data'] as $row)
182 188
 		{
183
-			if ($row_number == 0 && !empty($table['shading']['top']))
184
-				echo '
189
+			if ($row_number == 0 && !empty($table['shading']['top'])) {
190
+							echo '
185 191
 				<tr class="titlebg">';
186
-			else
187
-				echo '
192
+			} else {
193
+							echo '
188 194
 				<tr class="windowbg">';
195
+			}
189 196
 
190 197
 			// Now do each column!!
191 198
 			$column_number = 0;
@@ -202,16 +209,17 @@  discard block
 block discarded – undo
202 209
 				}
203 210
 
204 211
 				// Shaded?
205
-				if ($column_number == 0 && !empty($table['shading']['left']))
206
-					echo '
212
+				if ($column_number == 0 && !empty($table['shading']['left'])) {
213
+									echo '
207 214
 					<td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '>
208 215
 						', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), '
209 216
 					</td>';
210
-				else
211
-					echo '
217
+				} else {
218
+									echo '
212 219
 					<td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '>
213 220
 						', $data['v'], '
214 221
 					</td>';
222
+				}
215 223
 
216 224
 				$column_number++;
217 225
 			}
Please login to merge, or discard this patch.
Themes/default/ManageSearch.template.php 1 patch
Braces   +23 added lines, -20 removed lines patch added patch discarded remove patch
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 			<div class="windowbg2 noup">
128 128
 				<dl class="settings">';
129 129
 
130
-	if (!empty($context['table_info']))
131
-		echo '
130
+	if (!empty($context['table_info'])) {
131
+			echo '
132 132
 					<dt>
133 133
 						<strong>', $txt['search_method_messages_table_space'], ':</strong>
134 134
 					</dt>
@@ -141,6 +141,7 @@  discard block
 block discarded – undo
141 141
 					<dd>
142 142
 						', $context['table_info']['index_length'], '
143 143
 					</dd>';
144
+	}
144 145
 	echo '
145 146
 				</dl>
146 147
 				', $context['double_index'] ? '<div class="noticebox">
@@ -163,17 +164,17 @@  discard block
 block discarded – undo
163 164
 						<dd>
164 165
 							<span class="smalltext">';
165 166
 
166
-		if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext']))
167
-			echo '
167
+		if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) {
168
+					echo '
168 169
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]';
169
-
170
-		elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext']))
171
-			echo '
170
+		} elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) {
171
+					echo '
172 172
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create'];
173
-		else
174
-			echo '
173
+		} else {
174
+					echo '
175 175
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br>
176 176
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length'];
177
+		}
177 178
 		echo '
178 179
 							</span>
179 180
 						</dd>';
@@ -187,26 +188,27 @@  discard block
 block discarded – undo
187 188
 						<dd>
188 189
 							<span class="smalltext">';
189 190
 
190
-	if ($context['custom_index'])
191
-		echo '
191
+	if ($context['custom_index']) {
192
+			echo '
192 193
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br>
193 194
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
194
-
195
-	elseif ($context['partial_custom_index'])
196
-		echo '
195
+	} elseif ($context['partial_custom_index']) {
196
+			echo '
197 197
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br>
198 198
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
199
-	else
200
-		echo '
199
+	} else {
200
+			echo '
201 201
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]';
202
+	}
202 203
 	echo '
203 204
 							</span>
204 205
 						</dd>';
205 206
 
206 207
 	foreach ($context['search_apis'] as $api)
207 208
 	{
208
-		if (empty($api['label']) || $api['has_template'])
209
-			continue;
209
+		if (empty($api['label']) || $api['has_template']) {
210
+					continue;
211
+		}
210 212
 
211 213
 		echo '
212 214
 						<dt>
@@ -214,11 +216,12 @@  discard block
 block discarded – undo
214 216
 							', $api['label'], '
215 217
 						</dt>';
216 218
 
217
-		if ($api['desc'])
218
-			echo '
219
+		if ($api['desc']) {
220
+					echo '
219 221
 						<dd>
220 222
 							<span class="smalltext">', $api['desc'], '</span>
221 223
 						</dd>';
224
+		}
222 225
 	}
223 226
 
224 227
 	echo '
Please login to merge, or discard this patch.
Themes/default/Calendar.template.php 1 patch
Braces   +222 added lines, -162 removed lines patch added patch discarded remove patch
@@ -22,30 +22,32 @@  discard block
 block discarded – undo
22 22
 		<div id="calendar">';
23 23
 
24 24
 	// Show the mini-blocks if they're enabled.
25
-	if (empty($context['blocks_disabled']))
26
-		echo '
25
+	if (empty($context['blocks_disabled'])) {
26
+			echo '
27 27
 			<div id="month_grid">
28 28
 				', template_show_month_grid('prev', true), '
29 29
 				', template_show_month_grid('current', true), '
30 30
 				', template_show_month_grid('next', true), '
31 31
 			</div>';
32
+	}
32 33
 
33 34
 	// What view are we showing?
34
-	if ($context['calendar_view'] == 'viewlist')
35
-		echo '
35
+	if ($context['calendar_view'] == 'viewlist') {
36
+			echo '
36 37
 			<div id="main_grid">
37 38
 				', template_show_upcoming_list('main'), '
38 39
 			</div>';
39
-	elseif ($context['calendar_view'] == 'viewweek')
40
-		echo '
40
+	} elseif ($context['calendar_view'] == 'viewweek') {
41
+			echo '
41 42
 			<div id="main_grid">
42 43
 				', template_show_week_grid('main'), '
43 44
 			</div>';
44
-	else
45
-		echo '
45
+	} else {
46
+			echo '
46 47
 			<div id="main_grid">
47 48
 				', template_show_month_grid('main'), '
48 49
 			</div>';
50
+	}
49 51
 
50 52
 	// Close our wrapper.
51 53
 	echo '
@@ -64,20 +66,22 @@  discard block
 block discarded – undo
64 66
 	global $context, $scripturl, $txt;
65 67
 
66 68
 	// Bail out if we have nothing to work with
67
-	if (!isset($context['calendar_grid_' . $grid_name]))
68
-		return false;
69
+	if (!isset($context['calendar_grid_' . $grid_name])) {
70
+			return false;
71
+	}
69 72
 
70 73
 	// Protect programmer sanity
71 74
 	$calendar_data = &$context['calendar_grid_' . $grid_name];
72 75
 
73 76
 	// Do we want a title?
74
-	if (empty($calendar_data['disable_title']))
75
-		echo '
77
+	if (empty($calendar_data['disable_title'])) {
78
+			echo '
76 79
 			<div class="cat_bar">
77 80
 				<h3 class="catbg centertext largetext">
78 81
 					<a href="', $scripturl, '?action=calendar;viewlist;year=', $calendar_data['start_year'], ';month=', $calendar_data['start_month'], ';day=', $calendar_data['start_day'], '">', $txt['calendar_upcoming'], '</a>
79 82
 				</h3>
80 83
 			</div>';
84
+	}
81 85
 
82 86
 	// Give the user some controls to work with
83 87
 	template_calendar_top($calendar_data);
@@ -100,11 +104,13 @@  discard block
 block discarded – undo
100 104
 					<li class="windowbg">
101 105
 						<strong class="event_title">', $event['link'], '</strong>';
102 106
 
103
-				if ($event['can_edit'])
104
-					echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
107
+				if ($event['can_edit']) {
108
+									echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
109
+				}
105 110
 
106
-				if ($event['can_export'])
107
-					echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
111
+				if ($event['can_export']) {
112
+									echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
113
+				}
108 114
 
109 115
 				echo '
110 116
 						<br>';
@@ -112,14 +118,14 @@  discard block
 block discarded – undo
112 118
 				if (!empty($event['allday']))
113 119
 				{
114 120
 					echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : '';
115
-				}
116
-				else
121
+				} else
117 122
 				{
118 123
 					// Display event info relative to user's local timezone
119 124
 					echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
120 125
 
121
-					if ($event['start_date_local'] != $event['end_date_local'])
122
-						echo trim($event['end_date_local']) . ', ';
126
+					if ($event['start_date_local'] != $event['end_date_local']) {
127
+											echo trim($event['end_date_local']) . ', ';
128
+					}
123 129
 
124 130
 					echo trim($event['end_time_local']);
125 131
 
@@ -128,23 +134,27 @@  discard block
 block discarded – undo
128 134
 					{
129 135
 						echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">';
130 136
 
131
-						if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig'])
132
-							echo trim($event['start_date_orig']), ', ';
137
+						if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) {
138
+													echo trim($event['start_date_orig']), ', ';
139
+						}
133 140
 
134 141
 						echo trim($event['start_time_orig']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
135 142
 
136
-						if ($event['start_date_orig'] != $event['end_date_orig'])
137
-							echo trim($event['end_date_orig']) . ', ';
143
+						if ($event['start_date_orig'] != $event['end_date_orig']) {
144
+													echo trim($event['end_date_orig']) . ', ';
145
+						}
138 146
 
139 147
 						echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)';
140 148
 					}
141 149
 					// Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion
142
-					else
143
-						echo ' ', $event['tz_abbrev'], '</time>';
150
+					else {
151
+											echo ' ', $event['tz_abbrev'], '</time>';
152
+					}
144 153
 				}
145 154
 
146
-				if (!empty($event['location']))
147
-					echo '<br>', $event['location'];
155
+				if (!empty($event['location'])) {
156
+									echo '<br>', $event['location'];
157
+				}
148 158
 
149 159
 				echo '
150 160
 					</li>';
@@ -176,8 +186,9 @@  discard block
 block discarded – undo
176 186
 
177 187
 			$birthdays = array();
178 188
 
179
-			foreach ($date as $member)
180
-				$birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>';
189
+			foreach ($date as $member) {
190
+							$birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>';
191
+			}
181 192
 
182 193
 			echo implode(', ', $birthdays);
183 194
 
@@ -208,8 +219,9 @@  discard block
 block discarded – undo
208 219
 			$date_local = $date['date_local'];
209 220
 			unset($date['date_local']);
210 221
 
211
-			foreach ($date as $holiday)
212
-				$holidays[] = $holiday . ' (' . $date_local . ')';
222
+			foreach ($date as $holiday) {
223
+							$holidays[] = $holiday . ' (' . $date_local . ')';
224
+			}
213 225
 		}
214 226
 
215 227
 		echo implode(', ', $holidays);
@@ -233,17 +245,19 @@  discard block
 block discarded – undo
233 245
 	global $context, $txt, $scripturl, $modSettings;
234 246
 
235 247
 	// If the grid doesn't exist, no point in proceeding.
236
-	if (!isset($context['calendar_grid_' . $grid_name]))
237
-		return false;
248
+	if (!isset($context['calendar_grid_' . $grid_name])) {
249
+			return false;
250
+	}
238 251
 
239 252
 	// A handy little pointer variable.
240 253
 	$calendar_data = &$context['calendar_grid_' . $grid_name];
241 254
 
242 255
 	// Some conditions for whether or not we should show the week links *here*.
243
-	if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false)))
244
-		$show_week_links = true;
245
-	else
246
-		$show_week_links = false;
256
+	if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) {
257
+			$show_week_links = true;
258
+	} else {
259
+			$show_week_links = false;
260
+	}
247 261
 
248 262
 	// Assuming that we've not disabled it, show the title block!
249 263
 	if (empty($calendar_data['disable_title']))
@@ -253,18 +267,20 @@  discard block
 block discarded – undo
253 267
 				<h3 class="catbg centertext largetext">';
254 268
 
255 269
 		// Previous Link: If we're showing prev / next and it's not a mini-calendar.
256
-		if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false)
257
-			echo '
270
+		if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) {
271
+					echo '
258 272
 					<span class="floatleft">
259 273
 						<a href="', $calendar_data['previous_calendar']['href'], '">&#171;</a>
260 274
 					</span>';
275
+		}
261 276
 
262 277
 		// Next Link: if we're showing prev / next and it's not a mini-calendar.
263
-		if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false)
264
-			echo '
278
+		if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && $is_mini === false) {
279
+					echo '
265 280
 					<span class="floatright">
266 281
 						<a href="', $calendar_data['next_calendar']['href'], '">&#187;</a>
267 282
 					</span>';
283
+		}
268 284
 
269 285
 		// Arguably the most exciting part, the title!
270 286
 		echo '
@@ -274,8 +290,9 @@  discard block
 block discarded – undo
274 290
 	}
275 291
 
276 292
 	// Show the controls on main grids
277
-	if ($is_mini === false)
278
-		template_calendar_top($calendar_data);
293
+	if ($is_mini === false) {
294
+			template_calendar_top($calendar_data);
295
+	}
279 296
 
280 297
 	// Finally, the main calendar table.
281 298
 	echo '
@@ -288,14 +305,16 @@  discard block
 block discarded – undo
288 305
 				<tr>';
289 306
 
290 307
 		// If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared!
291
-		if ($show_week_links === true)
292
-			echo '
308
+		if ($show_week_links === true) {
309
+					echo '
293 310
 					<th></th>';
311
+		}
294 312
 
295 313
 		// Now, loop through each actual day of the week.
296
-		foreach ($calendar_data['week_days'] as $day)
297
-			echo '
314
+		foreach ($calendar_data['week_days'] as $day) {
315
+					echo '
298 316
 					<th class="days" scope="col">', !empty($calendar_data['short_day_titles']) || $is_mini === true ? $txt['days_short'][$day] : $txt['days'][$day], '</th>';
317
+		}
299 318
 
300 319
 		echo '
301 320
 				</tr>';
@@ -314,11 +333,12 @@  discard block
 block discarded – undo
314 333
 				<tr class="days_wrapper">';
315 334
 
316 335
 		// This is where we add the actual week link, if enabled on this location.
317
-		if ($show_week_links === true)
318
-			echo '
336
+		if ($show_week_links === true) {
337
+					echo '
319 338
 					<td class="windowbg2 weeks">
320 339
 						<a href="', $scripturl, '?action=calendar;viewweek;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $week['days'][0]['day'], '" title="', $txt['calendar_view_week'], '">&#187;</a>
321 340
 					</td>';
341
+		}
322 342
 
323 343
 		// Now loop through each day in the week we're on.
324 344
 		foreach ($week['days'] as $day)
@@ -335,27 +355,29 @@  discard block
 block discarded – undo
335 355
 				// Additional classes are given for events, holidays, and birthdays.
336 356
 				if (!empty($day['events']) && !empty($calendar_data['highlight']['events']))
337 357
 				{
338
-					if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3)))
339
-						$classes[] = 'events';
340
-					elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3)))
341
-						$classes[] = 'events';
358
+					if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) {
359
+											$classes[] = 'events';
360
+					} elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) {
361
+											$classes[] = 'events';
362
+					}
342 363
 				}
343 364
 				if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays']))
344 365
 				{
345
-					if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3)))
346
-						$classes[] = 'holidays';
347
-					elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3)))
348
-						$classes[] = 'holidays';
366
+					if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) {
367
+											$classes[] = 'holidays';
368
+					} elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) {
369
+											$classes[] = 'holidays';
370
+					}
349 371
 				}
350 372
 				if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays']))
351 373
 				{
352
-					if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3)))
353
-						$classes[] = 'birthdays';
354
-					elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3)))
355
-						$classes[] = 'birthdays';
374
+					if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) {
375
+											$classes[] = 'birthdays';
376
+					} elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) {
377
+											$classes[] = 'birthdays';
378
+					}
356 379
 				}
357
-			}
358
-			else
380
+			} else
359 381
 			{
360 382
 				// Default Classes (either compact or comfortable and disabled).
361 383
 				$classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable';
@@ -374,25 +396,27 @@  discard block
 block discarded – undo
374 396
 				$title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : '';
375 397
 
376 398
 				// The actual day number - be it a link, or just plain old text!
377
-				if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
378
-					echo '
399
+				if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) {
400
+									echo '
379 401
 						<a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>';
380
-				elseif ($is_mini)
381
-					echo '
402
+				} elseif ($is_mini) {
403
+									echo '
382 404
 						<a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>';
383
-				else
384
-					echo '
405
+				} else {
406
+									echo '
385 407
 						<span class="day_text">', $title_prefix, $day['day'], '</span>';
408
+				}
386 409
 
387 410
 				// A lot of stuff, we're not showing on mini-calendars to conserve space.
388 411
 				if ($is_mini === false)
389 412
 				{
390 413
 					// Holidays are always fun, let's show them!
391
-					if (!empty($day['holidays']))
392
-						echo '
414
+					if (!empty($day['holidays'])) {
415
+											echo '
393 416
 						<div class="smalltext holiday">
394 417
 							<span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), '
395 418
 						</div>';
419
+					}
396 420
 
397 421
 					// Happy Birthday Dear Member!
398 422
 					if (!empty($day['birthdays']))
@@ -410,15 +434,17 @@  discard block
 block discarded – undo
410 434
 							echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', ';
411 435
 
412 436
 							// 9...10! Let's stop there.
413
-							if ($birthday_count == 10 && $use_js_hide)
414
-								// !!TODO - Inline CSS and JavaScript should be moved.
437
+							if ($birthday_count == 10 && $use_js_hide) {
438
+															// !!TODO - Inline CSS and JavaScript should be moved.
415 439
 								echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, ';
440
+							}
416 441
 
417 442
 							++$birthday_count;
418 443
 						}
419
-						if ($use_js_hide)
420
-							echo '
444
+						if ($use_js_hide) {
445
+													echo '
421 446
 							</span>';
447
+						}
422 448
 
423 449
 						echo '
424 450
 						</div><!-- .smalltext -->';
@@ -429,8 +455,9 @@  discard block
 block discarded – undo
429 455
 					{
430 456
 						// Sort events by start time (all day events will be listed first)
431 457
 						uasort($day['events'], function($a, $b) {
432
-							if ($a['start_timestamp'] == $b['start_timestamp'])
433
-								return 0;
458
+							if ($a['start_timestamp'] == $b['start_timestamp']) {
459
+															return 0;
460
+							}
434 461
 
435 462
 							return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
436 463
 						});
@@ -450,20 +477,22 @@  discard block
 block discarded – undo
450 477
 								', $event['link'], '<br>
451 478
 								<span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">';
452 479
 
453
-							if (!empty($event['start_time_local']) && $event['starts_today'] == true)
454
-								echo trim(str_replace(':00 ', ' ', $event['start_time_local']));
455
-							elseif (!empty($event['end_time_local']) && $event['ends_today'] == true)
456
-								echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local']));
457
-							elseif (!empty($event['allday']))
458
-								echo $txt['calendar_allday'];
480
+							if (!empty($event['start_time_local']) && $event['starts_today'] == true) {
481
+															echo trim(str_replace(':00 ', ' ', $event['start_time_local']));
482
+							} elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) {
483
+															echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local']));
484
+							} elseif (!empty($event['allday'])) {
485
+															echo $txt['calendar_allday'];
486
+							}
459 487
 
460 488
 							echo '
461 489
 								</span>';
462 490
 
463
-							if (!empty($event['location']))
464
-								echo '
491
+							if (!empty($event['location'])) {
492
+															echo '
465 493
 								<br>
466 494
 								<span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>';
495
+							}
467 496
 
468 497
 							if ($event['can_edit'] || $event['can_export'])
469 498
 							{
@@ -471,18 +500,20 @@  discard block
 block discarded – undo
471 500
 								<span class="modify_event_links">';
472 501
 
473 502
 								// If they can edit the event, show an icon they can click on....
474
-								if ($event['can_edit'])
475
-									echo '
503
+								if ($event['can_edit']) {
504
+																	echo '
476 505
 									<a class="modify_event" href="', $event['modify_href'], '">
477 506
 										<span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span>
478 507
 									</a>';
508
+								}
479 509
 
480 510
 								// Exporting!
481
-								if ($event['can_export'])
482
-									echo '
511
+								if ($event['can_export']) {
512
+																	echo '
483 513
 									<a class="modify_event" href="', $event['export_href'], '">
484 514
 										<span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span>
485 515
 									</a>';
516
+								}
486 517
 
487 518
 								echo '
488 519
 								</span><br class="clear">';
@@ -501,10 +532,11 @@  discard block
 block discarded – undo
501 532
 			// Otherwise, assuming it's not a mini-calendar, we can show previous / next month days!
502 533
 			elseif ($is_mini === false)
503 534
 			{
504
-				if (empty($current_month_started) && !empty($context['calendar_grid_prev']))
505
-					echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>';
506
-				elseif (!empty($current_month_started) && !empty($context['calendar_grid_next']))
507
-					echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>';
535
+				if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) {
536
+									echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>';
537
+				} elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) {
538
+									echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>';
539
+				}
508 540
 			}
509 541
 
510 542
 			// Close this day and increase var count.
@@ -534,8 +566,9 @@  discard block
 block discarded – undo
534 566
 	global $context, $txt, $scripturl, $modSettings;
535 567
 
536 568
 	// We might have no reason to proceed, if the variable isn't there.
537
-	if (!isset($context['calendar_grid_' . $grid_name]))
538
-		return false;
569
+	if (!isset($context['calendar_grid_' . $grid_name])) {
570
+			return false;
571
+	}
539 572
 
540 573
 	// Handy pointer.
541 574
 	$calendar_data = &$context['calendar_grid_' . $grid_name];
@@ -552,22 +585,25 @@  discard block
 block discarded – undo
552 585
 					<h3 class="catbg centertext largetext">';
553 586
 
554 587
 			// Previous Week Link...
555
-			if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev']))
556
-				echo '
588
+			if (empty($calendar_data['previous_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) {
589
+							echo '
557 590
 						<span class="floatleft">
558 591
 							<a href="', $calendar_data['previous_week']['href'], '">&#171;</a>
559 592
 						</span>';
593
+			}
560 594
 
561 595
 			// Next Week Link...
562
-			if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev']))
563
-				echo '
596
+			if (empty($calendar_data['next_calendar']['disabled']) && !empty($calendar_data['show_next_prev'])) {
597
+							echo '
564 598
 						<span class="floatright">
565 599
 							<a href="', $calendar_data['next_week']['href'], '">&#187;</a>
566 600
 						</span>';
601
+			}
567 602
 
568 603
 			// The Month Title + Week Number...
569
-			if (!empty($calendar_data['week_title']))
570
-				echo $calendar_data['week_title'];
604
+			if (!empty($calendar_data['week_title'])) {
605
+							echo $calendar_data['week_title'];
606
+			}
571 607
 
572 608
 			echo '
573 609
 					</h3>
@@ -608,11 +644,12 @@  discard block
 block discarded – undo
608 644
 						<td class="', implode(' ', $classes), ' act_day">';
609 645
 
610 646
 			// Should the day number be a link?
611
-			if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
612
-				echo '
647
+			if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) {
648
+							echo '
613 649
 							<a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>';
614
-			else
615
-				echo $txt['days'][$day['day_of_week']], ' - ', $day['day'];
650
+			} else {
651
+							echo $txt['days'][$day['day_of_week']], ' - ', $day['day'];
652
+			}
616 653
 
617 654
 			echo '
618 655
 						</td>
@@ -623,8 +660,9 @@  discard block
 block discarded – undo
623 660
 			{
624 661
 				// Sort events by start time (all day events will be listed first)
625 662
 				uasort($day['events'], function($a, $b) {
626
-					if ($a['start_timestamp'] == $b['start_timestamp'])
627
-						return 0;
663
+					if ($a['start_timestamp'] == $b['start_timestamp']) {
664
+											return 0;
665
+					}
628 666
 					return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
629 667
 				});
630 668
 
@@ -638,35 +676,39 @@  discard block
 block discarded – undo
638 676
 					echo $event['link'], '<br>
639 677
 								<span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">';
640 678
 
641
-					if (!empty($event['start_time_local']))
642
-						echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' &ndash; ' . trim($event['end_time_local']) : '';
643
-					else
644
-						echo $txt['calendar_allday'];
679
+					if (!empty($event['start_time_local'])) {
680
+											echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' &ndash; ' . trim($event['end_time_local']) : '';
681
+					} else {
682
+											echo $txt['calendar_allday'];
683
+					}
645 684
 
646 685
 					echo '
647 686
 								</span>';
648 687
 
649
-					if (!empty($event['location']))
650
-						echo '<br>
688
+					if (!empty($event['location'])) {
689
+											echo '<br>
651 690
 								<span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>';
691
+					}
652 692
 
653 693
 					if (!empty($event_icons_needed))
654 694
 					{
655 695
 						echo ' <span class="modify_event_links">';
656 696
 
657 697
 						// If they can edit the event, show a star they can click on....
658
-						if (!empty($event['can_edit']))
659
-							echo '
698
+						if (!empty($event['can_edit'])) {
699
+													echo '
660 700
 									<a class="modify_event" href="', $event['modify_href'], '">
661 701
 										<span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span>
662 702
 									</a>';
703
+						}
663 704
 
664 705
 						// Can we export? Sweet.
665
-						if (!empty($event['can_export']))
666
-							echo '
706
+						if (!empty($event['can_export'])) {
707
+													echo '
667 708
 									<a class="modify_event" href="', $event['export_href'], '">
668 709
 										<span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span>
669 710
 									</a>';
711
+						}
670 712
 
671 713
 						echo '
672 714
 								</span><br class="clear">';
@@ -684,22 +726,23 @@  discard block
 block discarded – undo
684 726
 							</div>
685 727
 							<br class="clear">';
686 728
 				}
687
-			}
688
-			else
729
+			} else
689 730
 			{
690
-				if (!empty($context['can_post']))
691
-					echo '
731
+				if (!empty($context['can_post'])) {
732
+									echo '
692 733
 							<div class="week_add_event">
693 734
 								<a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['calendar_post_event'], '</a>
694 735
 							</div>';
736
+				}
695 737
 			}
696 738
 			echo '
697 739
 						</td>
698 740
 						<td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col" data-css-prefix="' . $txt['calendar_prompt'] . ' ">';
699 741
 
700 742
 			// Show any holidays!
701
-			if (!empty($day['holidays']))
702
-				echo implode('<br>', $day['holidays']);
743
+			if (!empty($day['holidays'])) {
744
+							echo implode('<br>', $day['holidays']);
745
+			}
703 746
 
704 747
 			echo '
705 748
 						</td>
@@ -708,11 +751,12 @@  discard block
 block discarded – undo
708 751
 			// Show any birthdays...
709 752
 			if (!empty($day['birthdays']))
710 753
 			{
711
-				foreach ($day['birthdays'] as $member)
712
-					echo '
754
+				foreach ($day['birthdays'] as $member) {
755
+									echo '
713 756
 							<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], '</a>
714 757
 							', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '
715 758
 							', $member['is_last'] ? '' : '<br>';
759
+				}
716 760
 			}
717 761
 			echo '
718 762
 						</td>
@@ -758,26 +802,27 @@  discard block
 block discarded – undo
758 802
 				<input type="text" name="end_date" id="end_date" maxlength="10" value="', $calendar_data['end_date'], '" tabindex="', $context['tabindex']++, '" class="date_input end" data-type="date">
759 803
 				<input type="submit" class="button" style="float:none" id="view_button" value="', $txt['view'], '">
760 804
 			</form>';
761
-	}
762
-	else
805
+	} else
763 806
 	{
764 807
 		echo'
765 808
 			<form action="', $scripturl, '?action=calendar" id="calendar_navigation" method="post" accept-charset="', $context['character_set'], '">
766 809
 				<select name="month" id="input_month">';
767 810
 
768 811
 		// Show a select box with all the months.
769
-		foreach ($txt['months_short'] as $number => $month)
770
-			echo '
812
+		foreach ($txt['months_short'] as $number => $month) {
813
+					echo '
771 814
 					<option value="', $number, '"', $number == $context['current_month'] ? ' selected' : '', '>', $month, '</option>';
815
+		}
772 816
 
773 817
 		echo '
774 818
 				</select>
775 819
 				<select name="year">';
776 820
 
777 821
 		// Show a link for every year...
778
-		for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++)
779
-			echo '
822
+		for ($year = $context['calendar_resources']['min_year']; $year <= $context['calendar_resources']['max_year']; $year++) {
823
+					echo '
780 824
 					<option value="', $year, '"', $year == $context['current_year'] ? ' selected' : '', '>', $year, '</option>';
825
+		}
781 826
 
782 827
 		echo '
783 828
 				</select>
@@ -799,9 +844,10 @@  discard block
 block discarded – undo
799 844
 	echo '
800 845
 		<form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">';
801 846
 
802
-	if (!empty($context['event']['new']))
803
-		echo '
847
+	if (!empty($context['event']['new'])) {
848
+			echo '
804 849
 			<input type="hidden" name="eventid" value="', $context['event']['eventid'], '">';
850
+	}
805 851
 
806 852
 	// Start the main table.
807 853
 	echo '
@@ -812,8 +858,8 @@  discard block
 block discarded – undo
812 858
 					</h3>
813 859
 				</div>';
814 860
 
815
-	if (!empty($context['post_error']['messages']))
816
-		echo '
861
+	if (!empty($context['post_error']['messages'])) {
862
+			echo '
817 863
 				<div class="errorbox">
818 864
 					<dl class="event_error">
819 865
 						<dt>
@@ -824,6 +870,7 @@  discard block
 block discarded – undo
824 870
 						</dt>
825 871
 					</dl>
826 872
 				</div>';
873
+	}
827 874
 
828 875
 	echo '
829 876
 				<div class="roundframe noup">
@@ -851,9 +898,10 @@  discard block
 block discarded – undo
851 898
 			echo '
852 899
 									<optgroup label="', $category['name'], '">';
853 900
 
854
-			foreach ($category['boards'] as $board)
855
-				echo '
901
+			foreach ($category['boards'] as $board) {
902
+							echo '
856 903
 										<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
904
+			}
857 905
 			echo '
858 906
 									</optgroup>';
859 907
 		}
@@ -889,9 +937,10 @@  discard block
 block discarded – undo
889 937
 								<span class="label">', $txt['calendar_timezone'], '</span>
890 938
 								<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
891 939
 
892
-	foreach ($context['all_timezones'] as $tz => $tzname)
893
-		echo '
940
+	foreach ($context['all_timezones'] as $tz => $tzname) {
941
+			echo '
894 942
 									<option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
943
+	}
895 944
 
896 945
 	echo '
897 946
 								</select>
@@ -907,9 +956,10 @@  discard block
 block discarded – undo
907 956
 					<input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button">';
908 957
 
909 958
 	// Delete button?
910
-	if (empty($context['event']['new']))
911
-		echo '
959
+	if (empty($context['event']['new'])) {
960
+			echo '
912 961
 					<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button you_sure">';
962
+	}
913 963
 
914 964
 	echo '
915 965
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -937,9 +987,10 @@  discard block
 block discarded – undo
937 987
 		echo '
938 988
 				<td style="padding-', $alt ? 'right' : 'left', ': 1.5em;">';
939 989
 
940
-		foreach ($v as $i)
941
-			echo '
990
+		foreach ($v as $i) {
991
+					echo '
942 992
 					<img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '"><br>';
993
+		}
943 994
 
944 995
 		echo '
945 996
 				</td>';
@@ -960,9 +1011,10 @@  discard block
 block discarded – undo
960 1011
 
961 1012
 	foreach ($context['clockicons'] as $t => $v)
962 1013
 	{
963
-		foreach ($v as $i)
964
-			echo '
1014
+		foreach ($v as $i) {
1015
+					echo '
965 1016
 			icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
1017
+		}
966 1018
 	}
967 1019
 
968 1020
 	echo '
@@ -987,13 +1039,14 @@  discard block
 block discarded – undo
987 1039
 
988 1040
 	foreach ($context['clockicons'] as $t => $v)
989 1041
 	{
990
-		foreach ($v as $i)
991
-			echo '
1042
+		foreach ($v as $i) {
1043
+					echo '
992 1044
 				if (', $t, ' >= ', $i, ')
993 1045
 				{
994 1046
 					turnon.push("', $t, '_', $i, '");
995 1047
 					', $t, ' -= ', $i, ';
996 1048
 				}';
1049
+		}
997 1050
 	}
998 1051
 
999 1052
 	echo '
@@ -1037,9 +1090,10 @@  discard block
 block discarded – undo
1037 1090
 			<tr class="', $alt ? 'windowbg2' : 'windowbg', '">
1038 1091
 				<td>';
1039 1092
 
1040
-		foreach ($v as $i)
1041
-			echo '
1093
+		foreach ($v as $i) {
1094
+					echo '
1042 1095
 					<img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">';
1096
+		}
1043 1097
 
1044 1098
 		echo '
1045 1099
 				</td>
@@ -1061,9 +1115,10 @@  discard block
 block discarded – undo
1061 1115
 
1062 1116
 	foreach ($context['clockicons'] as $t => $v)
1063 1117
 	{
1064
-		foreach ($v as $i)
1065
-			echo '
1118
+		foreach ($v as $i) {
1119
+					echo '
1066 1120
 			icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
1121
+		}
1067 1122
 	}
1068 1123
 
1069 1124
 	echo '
@@ -1080,13 +1135,14 @@  discard block
 block discarded – undo
1080 1135
 
1081 1136
 	foreach ($context['clockicons'] as $t => $v)
1082 1137
 	{
1083
-		foreach ($v as $i)
1084
-			echo '
1138
+		foreach ($v as $i) {
1139
+					echo '
1085 1140
 				if (', $t, ' >= ', $i, ')
1086 1141
 				{
1087 1142
 					turnon.push("', $t, '_', $i, '");
1088 1143
 					', $t, ' -= ', $i, ';
1089 1144
 				}';
1145
+		}
1090 1146
 	}
1091 1147
 
1092 1148
 	echo '
@@ -1130,9 +1186,10 @@  discard block
 block discarded – undo
1130 1186
 			<tr class="', $alt ? 'windowbg2' : 'windowbg', '">
1131 1187
 				<td>';
1132 1188
 
1133
-		foreach ($v as $i)
1134
-			echo '
1189
+		foreach ($v as $i) {
1190
+					echo '
1135 1191
 					<img src="', $context['offimg'], '" alt="" id="', $t, '_', $i, '" style="padding: 2px;">';
1192
+		}
1136 1193
 
1137 1194
 		echo '
1138 1195
 				</td>
@@ -1148,9 +1205,10 @@  discard block
 block discarded – undo
1148 1205
 
1149 1206
 	foreach ($context['clockicons'] as $t => $v)
1150 1207
 	{
1151
-		foreach ($v as $i)
1152
-			echo '
1208
+		foreach ($v as $i) {
1209
+					echo '
1153 1210
 			icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
1211
+		}
1154 1212
 	}
1155 1213
 
1156 1214
 	echo '
@@ -1171,13 +1229,14 @@  discard block
 block discarded – undo
1171 1229
 
1172 1230
 	foreach ($context['clockicons'] as $t => $v)
1173 1231
 	{
1174
-		foreach ($v as $i)
1175
-		echo '
1232
+		foreach ($v as $i) {
1233
+				echo '
1176 1234
 				if (', $t, ' >= ', $i, ')
1177 1235
 				{
1178 1236
 					turnon.push("', $t, '_', $i, '");
1179 1237
 					', $t, ' -= ', $i, ';
1180 1238
 				}';
1239
+		}
1181 1240
 	}
1182 1241
 
1183 1242
 	echo '
@@ -1221,9 +1280,10 @@  discard block
 block discarded – undo
1221 1280
 			<tr class="', $alt ? 'windowbg2' : 'windowbg', '">
1222 1281
 				<td>';
1223 1282
 
1224
-		foreach ($v as $i)
1225
-			echo '
1283
+		foreach ($v as $i) {
1284
+					echo '
1226 1285
 					<img src="', $i ? $context['onimg'] : $context['offimg'], '" alt="" style="padding: 2px;">';
1286
+		}
1227 1287
 
1228 1288
 		echo '
1229 1289
 				</td>
Please login to merge, or discard this patch.
Themes/default/ManagePermissions.template.php 1 patch
Braces   +170 added lines, -128 removed lines patch added patch discarded remove patch
@@ -19,26 +19,28 @@  discard block
 block discarded – undo
19 19
 	global $context, $settings, $scripturl, $txt, $modSettings;
20 20
 
21 21
 	// Not allowed to edit?
22
-	if (!$context['can_modify'])
23
-		echo '
22
+	if (!$context['can_modify']) {
23
+			echo '
24 24
 	<div class="errorbox">
25 25
 		', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
26 26
 	</div>';
27
+	}
27 28
 
28 29
 	echo '
29 30
 	<div id="admin_form_wrapper">
30 31
 		<form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">';
31 32
 
32
-	if (!empty($context['profile']))
33
-		echo '
33
+	if (!empty($context['profile'])) {
34
+			echo '
34 35
 			<div class="cat_bar">
35 36
 				<h3 class="catbg">', $txt['permissions_for_profile'], ': &quot;', $context['profile']['name'], '&quot;</h3>
36 37
 			</div>';
37
-	else
38
-		echo '
38
+	} else {
39
+			echo '
39 40
 			<div class="cat_bar">
40 41
 				<h3 class="catbg">', $txt['permissions_title'], '</h3>
41 42
 			</div>';
43
+	}
42 44
 
43 45
 	echo '
44 46
 			<table class="table_grid">
@@ -47,13 +49,14 @@  discard block
 block discarded – undo
47 49
 						<th>', $txt['membergroups_name'], '</th>
48 50
 						<th class="small_table">', $txt['membergroups_members_top'], '</th>';
49 51
 
50
-	if (empty($modSettings['permission_enable_deny']))
51
-		echo '
52
+	if (empty($modSettings['permission_enable_deny'])) {
53
+			echo '
52 54
 						<th class="small_table">', $txt['membergroups_permissions'], '</th>';
53
-	else
54
-		echo '
55
+	} else {
56
+			echo '
55 57
 						<th class="small_table">', $txt['permissions_allowed'], '</th>
56 58
 						<th class="small_table">', $txt['permissions_denied'], '</th>';
59
+	}
57 60
 
58 61
 	echo '
59 62
 						<th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th>
@@ -71,26 +74,28 @@  discard block
 block discarded – undo
71 74
 						<td>
72 75
 							', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a> ' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '<span>', $group['name'], '</span>';
73 76
 
74
-		if (!empty($group['children']))
75
-			echo '
77
+		if (!empty($group['children'])) {
78
+					echo '
76 79
 							<br>
77 80
 							<span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
81
+		}
78 82
 
79 83
 		echo '
80 84
 						</td>
81 85
 						<td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>';
82 86
 
83
-		if (empty($modSettings['permission_enable_deny']))
84
-			echo '
87
+		if (empty($modSettings['permission_enable_deny'])) {
88
+					echo '
85 89
 						<td>', $group['num_permissions']['allowed'], '</td>';
86
-		else
87
-			echo '
90
+		} else {
91
+					echo '
88 92
 						<td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>
89 93
 							', $group['num_permissions']['allowed'], '
90 94
 						</td>
91 95
 						<td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>
92 96
 							', $group['num_permissions']['denied'], '
93 97
 						</td>';
98
+		}
94 99
 
95 100
 		echo '
96 101
 						<td>
@@ -141,10 +146,11 @@  discard block
 block discarded – undo
141 146
 							<select name="copy_from">
142 147
 								<option value="empty">(', $txt['permissions_select_membergroup'], ')</option>';
143 148
 
144
-		foreach ($context['groups'] as $group)
145
-			if ($group['id'] != 1)
149
+		foreach ($context['groups'] as $group) {
150
+					if ($group['id'] != 1)
146 151
 				echo '
147 152
 								<option value="', $group['id'], '">', $group['name'], '</option>';
153
+		}
148 154
 
149 155
 		echo '
150 156
 							</select>
@@ -154,9 +160,10 @@  discard block
 block discarded – undo
154 160
 								<option value="add">', $txt['permissions_add'], '...</option>
155 161
 								<option value="clear">', $txt['permissions_remove'], '...</option>';
156 162
 
157
-		if (!empty($modSettings['permission_enable_deny']))
158
-			echo '
163
+		if (!empty($modSettings['permission_enable_deny'])) {
164
+					echo '
159 165
 								<option value="deny">', $txt['permissions_deny'], '...</option>';
166
+		}
160 167
 
161 168
 		echo '
162 169
 							</select>
@@ -167,31 +174,35 @@  discard block
 block discarded – undo
167 174
 
168 175
 		foreach ($context['permissions'] as $permissionType)
169 176
 		{
170
-			if ($permissionType['id'] == 'membergroup' && !empty($context['profile']))
171
-				continue;
177
+			if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) {
178
+							continue;
179
+			}
172 180
 
173 181
 			foreach ($permissionType['columns'] as $column)
174 182
 			{
175 183
 				foreach ($column as $permissionGroup)
176 184
 				{
177
-					if ($permissionGroup['hidden'])
178
-						continue;
185
+					if ($permissionGroup['hidden']) {
186
+											continue;
187
+					}
179 188
 
180 189
 					echo '
181 190
 								<option value="" disabled>[', $permissionGroup['name'], ']</option>';
182 191
 
183 192
 					foreach ($permissionGroup['permissions'] as $perm)
184 193
 					{
185
-						if ($perm['hidden'])
186
-							continue;
194
+						if ($perm['hidden']) {
195
+													continue;
196
+						}
187 197
 
188
-						if ($perm['has_own_any'])
189
-							echo '
198
+						if ($perm['has_own_any']) {
199
+													echo '
190 200
 								<option value="', $permissionType['id'], '/', $perm['own']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['own']['name'], ')</option>
191 201
 								<option value="', $permissionType['id'], '/', $perm['any']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['any']['name'], ')</option>';
192
-						else
193
-							echo '
202
+						} else {
203
+													echo '
194 204
 								<option value="', $permissionType['id'], '/', $perm['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], '</option>';
205
+						}
195 206
 					}
196 207
 				}
197 208
 			}
@@ -256,9 +267,10 @@  discard block
 block discarded – undo
256 267
 				}
257 268
 			</script>';
258 269
 
259
-		if (!empty($context['profile']))
260
-			echo '
270
+		if (!empty($context['profile'])) {
271
+					echo '
261 272
 			<input type="hidden" name="pid" value="', $context['profile']['id'], '">';
273
+		}
262 274
 
263 275
 		echo '
264 276
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -303,9 +315,10 @@  discard block
 block discarded – undo
303 315
 					<h3 class="subbg">', $category['name'], '</h3>
304 316
 				</div>';
305 317
 
306
-		if (!empty($category['boards']))
307
-			echo '
318
+		if (!empty($category['boards'])) {
319
+					echo '
308 320
 				<ul class="perm_boards flow_hidden">';
321
+		}
309 322
 
310 323
 		foreach ($category['boards'] as $board)
311 324
 		{
@@ -321,33 +334,36 @@  discard block
 block discarded – undo
321 334
 				echo '
322 335
 							<select name="boardprofile[', $board['id'], ']">';
323 336
 
324
-				foreach ($context['profiles'] as $id => $profile)
325
-					echo '
337
+				foreach ($context['profiles'] as $id => $profile) {
338
+									echo '
326 339
 								<option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
340
+				}
327 341
 
328 342
 				echo '
329 343
 							</select>';
330
-			}
331
-			else
332
-				echo '
344
+			} else {
345
+							echo '
333 346
 							<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>';
347
+			}
334 348
 
335 349
 			echo '
336 350
 						</span>
337 351
 					</li>';
338 352
 		}
339 353
 
340
-		if (!empty($category['boards']))
341
-			echo '
354
+		if (!empty($category['boards'])) {
355
+					echo '
342 356
 				</ul>';
357
+		}
343 358
 	}
344 359
 
345
-	if ($context['edit_all'])
346
-		echo '
360
+	if ($context['edit_all']) {
361
+			echo '
347 362
 				<input type="submit" name="save_changes" value="', $txt['save'], '" class="button">';
348
-	else
349
-		echo '
363
+	} else {
364
+			echo '
350 365
 				<a class="button" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>';
366
+	}
351 367
 
352 368
 	echo '
353 369
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -387,12 +403,13 @@  discard block
 block discarded – undo
387 403
 					<tr class="windowbg">
388 404
 						<td>';
389 405
 
390
-		if (!empty($context['show_rename_boxes']) && $profile['can_edit'])
391
-			echo '
406
+		if (!empty($context['show_rename_boxes']) && $profile['can_edit']) {
407
+					echo '
392 408
 							<input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">';
393
-		else
394
-			echo '
409
+		} else {
410
+					echo '
395 411
 							<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>';
412
+		}
396 413
 
397 414
 		echo '
398 415
 						</td>
@@ -412,9 +429,10 @@  discard block
 block discarded – undo
412 429
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
413 430
 				<input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">';
414 431
 
415
-	if ($context['can_edit_something'])
416
-		echo '
432
+	if ($context['can_edit_something']) {
433
+			echo '
417 434
 				<input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button">';
435
+	}
418 436
 
419 437
 	echo '
420 438
 				<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '>
@@ -439,9 +457,10 @@  discard block
 block discarded – undo
439 457
 					<dd>
440 458
 						<select name="copy_from">';
441 459
 
442
-	foreach ($context['profiles'] as $id => $profile)
443
-		echo '
460
+	foreach ($context['profiles'] as $id => $profile) {
461
+			echo '
444 462
 							<option value="', $id, '">', $profile['name'], '</option>';
463
+	}
445 464
 
446 465
 	echo '
447 466
 						</select>
@@ -463,13 +482,13 @@  discard block
 block discarded – undo
463 482
 	global $context, $scripturl, $txt, $modSettings;
464 483
 
465 484
 	// Cannot be edited?
466
-	if (!$context['profile']['can_modify'])
467
-		echo '
485
+	if (!$context['profile']['can_modify']) {
486
+			echo '
468 487
 	<div class="errorbox">
469 488
 		', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
470 489
 	</div>';
471
-	else
472
-		echo '
490
+	} else {
491
+			echo '
473 492
 	<script>
474 493
 		window.smf_usedDeny = false;
475 494
 
@@ -481,27 +500,30 @@  discard block
 block discarded – undo
481 500
 				return true;
482 501
 		}
483 502
 	</script>';
503
+	}
484 504
 
485 505
 	echo '
486 506
 	<div id="admincenter">
487 507
 		<form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">';
488 508
 
489
-	if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1)
490
-		echo '
509
+	if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) {
510
+			echo '
491 511
 			<div class="information">
492 512
 				', $txt['permissions_option_desc'], '
493 513
 			</div>';
514
+	}
494 515
 
495 516
 	echo '
496 517
 			<div class="cat_bar">
497 518
 				<h3 class="catbg">';
498 519
 
499
-	if ($context['permission_type'] == 'board')
500
-		echo '
520
+	if ($context['permission_type'] == 'board') {
521
+			echo '
501 522
 				', $txt['permissions_local_for'], ' &quot;', $context['group']['name'], '&quot; ', $txt['permissions_on'], ' &quot;', $context['profile']['name'], '&quot;';
502
-	else
503
-		echo '
523
+	} else {
524
+			echo '
504 525
 				', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - &quot;', $context['group']['name'], '&quot;';
526
+	}
505 527
 	echo '
506 528
 				</h3>
507 529
 			</div>';
@@ -524,15 +546,17 @@  discard block
 block discarded – undo
524 546
 		template_modify_group_display('board');
525 547
 	}
526 548
 
527
-	if ($context['profile']['can_modify'])
528
-		echo '
549
+	if ($context['profile']['can_modify']) {
550
+			echo '
529 551
 			<div class="padding">
530 552
 				<input type="submit" value="', $txt['permissions_commit'], '" class="button">
531 553
 			</div>';
554
+	}
532 555
 
533
-	foreach ($context['hidden_perms'] as $hidden_perm)
534
-		echo '
556
+	foreach ($context['hidden_perms'] as $hidden_perm) {
557
+			echo '
535 558
 			<input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">';
559
+	}
536 560
 
537 561
 	echo '
538 562
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -560,17 +584,19 @@  discard block
 block discarded – undo
560 584
 
561 585
 		foreach ($column as $permissionGroup)
562 586
 		{
563
-			if (empty($permissionGroup['permissions']))
564
-				continue;
587
+			if (empty($permissionGroup['permissions'])) {
588
+							continue;
589
+			}
565 590
 
566 591
 			// Are we likely to have something in this group to display or is it all hidden?
567 592
 			$has_display_content = false;
568 593
 			if (!$permissionGroup['hidden'])
569 594
 			{
570 595
 				// Before we go any further check we are going to have some data to print otherwise we just have a silly heading.
571
-				foreach ($permissionGroup['permissions'] as $permission)
572
-					if (!$permission['hidden'])
596
+				foreach ($permissionGroup['permissions'] as $permission) {
597
+									if (!$permission['hidden'])
573 598
 						$has_display_content = true;
599
+				}
574 600
 
575 601
 				if ($has_display_content)
576 602
 				{
@@ -579,10 +605,11 @@  discard block
 block discarded – undo
579 605
 							<th></th>
580 606
 							<th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>';
581 607
 
582
-					if ($context['group']['id'] != -1)
583
-						echo '
608
+					if ($context['group']['id'] != -1) {
609
+											echo '
584 610
 							<th>', $txt['permissions_option_own'], '</th>
585 611
 							<th>', $txt['permissions_option_any'], '</th>';
612
+					}
586 613
 
587 614
 					echo '
588 615
 						</tr>';
@@ -605,17 +632,18 @@  discard block
 block discarded – undo
605 632
 						// Guests can't do their own thing.
606 633
 						if ($context['group']['id'] != -1)
607 634
 						{
608
-							if (empty($modSettings['permission_enable_deny']))
609
-								echo '
635
+							if (empty($modSettings['permission_enable_deny'])) {
636
+															echo '
610 637
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '>';
611
-							else
638
+							} else
612 639
 							{
613 640
 								echo '
614 641
 								<select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>';
615 642
 
616
-								foreach (array('on', 'off', 'deny') as $c)
617
-									echo '
643
+								foreach (array('on', 'off', 'deny') as $c) {
644
+																	echo '
618 645
 									<option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
646
+								}
619 647
 								echo '
620 648
 								</select>';
621 649
 							}
@@ -625,39 +653,41 @@  discard block
 block discarded – undo
625 653
 							<td>';
626 654
 						}
627 655
 
628
-						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
629
-							echo '
656
+						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) {
657
+													echo '
630 658
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>';
631
-						else
659
+						} else
632 660
 						{
633 661
 							echo '
634 662
 								<select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>';
635 663
 
636
-							foreach (array('on', 'off', 'deny') as $c)
637
-								echo '
664
+							foreach (array('on', 'off', 'deny') as $c) {
665
+															echo '
638 666
 									<option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
667
+							}
639 668
 							echo '
640 669
 								</select>';
641 670
 						}
642
-					}
643
-					else
671
+					} else
644 672
 					{
645
-						if ($context['group']['id'] != -1)
646
-							echo '
673
+						if ($context['group']['id'] != -1) {
674
+													echo '
647 675
 							</td>
648 676
 							<td>';
677
+						}
649 678
 
650
-						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
651
-							echo '
679
+						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) {
680
+													echo '
652 681
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '>';
653
-						else
682
+						} else
654 683
 						{
655 684
 							echo '
656 685
 								<select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>';
657 686
 
658
-							foreach (array('on', 'off', 'deny') as $c)
659
-								echo '
687
+							foreach (array('on', 'off', 'deny') as $c) {
688
+															echo '
660 689
 									<option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
690
+							}
661 691
 							echo '
662 692
 								</select>';
663 693
 						}
@@ -689,11 +719,11 @@  discard block
 block discarded – undo
689 719
 											<fieldset id="', $context['current_permission'], '">
690 720
 												<legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>';
691 721
 
692
-	if (empty($modSettings['permission_enable_deny']))
693
-		echo '
722
+	if (empty($modSettings['permission_enable_deny'])) {
723
+			echo '
694 724
 												<ul>';
695
-	else
696
-		echo '
725
+	} else {
726
+			echo '
697 727
 												<div class="information">', $txt['permissions_option_desc'], '</div>
698 728
 												<dl class="settings">
699 729
 													<dt>
@@ -703,47 +733,52 @@  discard block
 block discarded – undo
703 733
 													</dt>
704 734
 													<dd>
705 735
 													</dd>';
736
+	}
706 737
 
707 738
 	foreach ($context['member_groups'] as $group)
708 739
 	{
709
-		if (!empty($modSettings['permission_enable_deny']))
710
-			echo '
740
+		if (!empty($modSettings['permission_enable_deny'])) {
741
+					echo '
711 742
 													<dt>';
712
-		else
713
-			echo '
743
+		} else {
744
+					echo '
714 745
 													<li>';
746
+		}
715 747
 
716
-		if (empty($modSettings['permission_enable_deny']))
717
-			echo '
748
+		if (empty($modSettings['permission_enable_deny'])) {
749
+					echo '
718 750
 														<input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>';
719
-		else
720
-			echo '
751
+		} else {
752
+					echo '
721 753
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span>
722 754
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span>
723 755
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>';
756
+		}
724 757
 
725
-		if (!empty($modSettings['permission_enable_deny']))
726
-			echo '
758
+		if (!empty($modSettings['permission_enable_deny'])) {
759
+					echo '
727 760
 													</dt>
728 761
 													<dd>
729 762
 														<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
730 763
 													</dd>';
731
-		else
732
-			echo '
764
+		} else {
765
+					echo '
733 766
 														<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
734 767
 													</li>';
768
+		}
735 769
 	}
736 770
 
737
-	if (empty($modSettings['permission_enable_deny']))
738
-		echo '
771
+	if (empty($modSettings['permission_enable_deny'])) {
772
+			echo '
739 773
 													<li>
740 774
 														<input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');">
741 775
 														<span>', $txt['check_all'], '</span>
742 776
 													</li>
743 777
 												</ul>';
744
-	else
745
-		echo '
778
+	} else {
779
+			echo '
746 780
 												</dl>';
781
+	}
747 782
 
748 783
 	echo '
749 784
 											</fieldset>
@@ -783,9 +818,10 @@  discard block
 block discarded – undo
783 818
 	if (!empty($modSettings['postmod_active']))
784 819
 	{
785 820
 		// Got advanced permissions - if so warn!
786
-		if (!empty($modSettings['permission_enable_deny']))
787
-			echo '
821
+		if (!empty($modSettings['permission_enable_deny'])) {
822
+					echo '
788 823
 							<div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>';
824
+		}
789 825
 
790 826
 		echo '
791 827
 							<div class="padding">
@@ -800,10 +836,11 @@  discard block
 block discarded – undo
800 836
 									', $txt['permissions_post_moderation_select'], ':
801 837
 									<select name="pid" onchange="document.forms.postmodForm.submit();">';
802 838
 
803
-		foreach ($context['profiles'] as $profile)
804
-			if ($profile['can_modify'])
839
+		foreach ($context['profiles'] as $profile) {
840
+					if ($profile['can_modify'])
805 841
 				echo '
806 842
 										<option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
843
+		}
807 844
 
808 845
 		echo '
809 846
 									</select>
@@ -824,11 +861,12 @@  discard block
 block discarded – undo
824 861
 											', $txt['permissions_post_moderation_replies_any'], '
825 862
 										</th>';
826 863
 
827
-		if ($modSettings['attachmentEnable'] == 1)
828
-			echo '
864
+		if ($modSettings['attachmentEnable'] == 1) {
865
+					echo '
829 866
 										<th class="centercol" colspan="3">
830 867
 											', $txt['permissions_post_moderation_attachments'], '
831 868
 										</th>';
869
+		}
832 870
 
833 871
 		echo '
834 872
 									</tr>
@@ -846,11 +884,12 @@  discard block
 block discarded – undo
846 884
 										<th><span class="generic_icons post_moderation_moderate"></span></th>
847 885
 										<th><span class="generic_icons post_moderation_deny"></span></th>';
848 886
 
849
-		if ($modSettings['attachmentEnable'] == 1)
850
-			echo '
887
+		if ($modSettings['attachmentEnable'] == 1) {
888
+					echo '
851 889
 										<th><span class="generic_icons post_moderation_allow"></span></th>
852 890
 										<th><span class="generic_icons post_moderation_moderate"></span></th>
853 891
 										<th><span class="generic_icons post_moderation_deny"></span></th>';
892
+		}
854 893
 
855 894
 		echo '
856 895
 									</tr>
@@ -864,10 +903,11 @@  discard block
 block discarded – undo
864 903
 										<td class="half_table">
865 904
 											<span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>';
866 905
 
867
-				if (!empty($group['children']))
868
-					echo '
906
+				if (!empty($group['children'])) {
907
+									echo '
869 908
 											<br>
870 909
 											<span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
910
+				}
871 911
 
872 912
 				echo '
873 913
 										</td>
@@ -882,11 +922,11 @@  discard block
 block discarded – undo
882 922
 										</td>';
883 923
 
884 924
 				// Guests can't have "own" permissions
885
-				if ($group['id'] == '-1')
886
-					echo '
925
+				if ($group['id'] == '-1') {
926
+									echo '
887 927
 										<td colspan="3"></td>';
888
-				else
889
-					echo '
928
+				} else {
929
+									echo '
890 930
 										<td class="centercol">
891 931
 											<input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '>
892 932
 										</td>
@@ -896,6 +936,7 @@  discard block
 block discarded – undo
896 936
 										<td class="centercol">
897 937
 											<input type="radio" name="replies_own[', $group['id'], ']" value="disallow"', $group['replies_own'] == 'disallow' ? ' checked' : '', '>
898 938
 										</td>';
939
+				}
899 940
 
900 941
 				echo '
901 942
 										<td class="centercol">
@@ -908,8 +949,8 @@  discard block
 block discarded – undo
908 949
 											<input type="radio" name="replies_any[', $group['id'], ']" value="disallow"', $group['replies_any'] == 'disallow' ? ' checked' : '', '>
909 950
 										</td>';
910 951
 
911
-				if ($modSettings['attachmentEnable'] == 1)
912
-					echo '
952
+				if ($modSettings['attachmentEnable'] == 1) {
953
+									echo '
913 954
 										<td class="centercol">
914 955
 											<input type="radio" name="attachment[', $group['id'], ']" value="allow"', $group['attachment'] == 'allow' ? ' checked' : '', '>
915 956
 										</td>
@@ -919,6 +960,7 @@  discard block
 block discarded – undo
919 960
 										<td class="centercol">
920 961
 											<input type="radio" name="attachment[', $group['id'], ']" value="disallow"', $group['attachment'] == 'disallow' ? ' checked' : '', '>
921 962
 										</td>';
963
+				}
922 964
 
923 965
 				echo '
924 966
 									</tr>';
Please login to merge, or discard this patch.
Themes/default/GenericControls.template.php 1 patch
Braces   +82 added lines, -62 removed lines patch added patch discarded remove patch
@@ -53,14 +53,15 @@  discard block
 block discarded – undo
53 53
 			foreach ($context['smileys'] as $location => $smileyRows)
54 54
 			{
55 55
 				$countLocations--;
56
-				if ($location == 'postform')
57
-					echo '
56
+				if ($location == 'postform') {
57
+									echo '
58 58
 						dropdown:
59 59
 						{';
60
-				elseif ($location == 'popup')
61
-					echo '
60
+				} elseif ($location == 'popup') {
61
+									echo '
62 62
 						popup:
63 63
 						{';
64
+				}
64 65
 
65 66
 				$numRows = count($smileyRows);
66 67
 
@@ -68,25 +69,27 @@  discard block
 block discarded – undo
68 69
 				$emptyPlaceholder = 0;
69 70
 				foreach ($smileyRows as $smileyRow)
70 71
 				{
71
-					foreach ($smileyRow['smileys'] as $smiley)
72
-						echo '
72
+					foreach ($smileyRow['smileys'] as $smiley) {
73
+											echo '
73 74
 							', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : '';
75
+					}
74 76
 
75
-					if (empty($smileyRow['isLast']) && $numRows != 1)
76
-						echo ',
77
+					if (empty($smileyRow['isLast']) && $numRows != 1) {
78
+											echo ',
77 79
 						\'-', $emptyPlaceholder++, '\': \'\',';
80
+					}
78 81
 				}
79 82
 				echo '
80 83
 						}', $countLocations != 0 ? ',' : '';
81 84
 			}
82 85
 			echo '
83 86
 					}';
84
-		}
85
-		else
86
-			echo ',
87
+		} else {
88
+					echo ',
87 89
 					emoticons:
88 90
 					{},
89 91
 					emoticonsEnabled:false';
92
+		}
90 93
 
91 94
 		if ($context['show_bbc'] && $bbcContainer !== null)
92 95
 		{
@@ -100,15 +103,16 @@  discard block
 block discarded – undo
100 103
 
101 104
 				$count_tags--;
102 105
 
103
-				if (!empty($count_tags))
104
-					echo '||';
106
+				if (!empty($count_tags)) {
107
+									echo '||';
108
+				}
105 109
 			}
106 110
 
107 111
 			echo '",';
108
-		}
109
-		else
110
-			echo ',
112
+		} else {
113
+					echo ',
111 114
 					toolbar: "",';
115
+		}
112 116
 
113 117
 		echo '
114 118
 				});
@@ -150,42 +154,47 @@  discard block
 block discarded – undo
150 154
 
151 155
 	$tempTab = $context['tabindex'];
152 156
 
153
-	if (!empty($context['drafts_pm_save']))
154
-		$tempTab++;
155
-	elseif (!empty($context['drafts_save']))
156
-		$tempTab++;
157
-	elseif ($editor_context['preview_type'])
158
-		$tempTab++;
159
-	elseif ($context['show_spellchecking'])
160
-		$tempTab++;
157
+	if (!empty($context['drafts_pm_save'])) {
158
+			$tempTab++;
159
+	} elseif (!empty($context['drafts_save'])) {
160
+			$tempTab++;
161
+	} elseif ($editor_context['preview_type']) {
162
+			$tempTab++;
163
+	} elseif ($context['show_spellchecking']) {
164
+			$tempTab++;
165
+	}
161 166
 
162 167
 	$tempTab++;
163 168
 	$context['tabindex'] = $tempTab;
164 169
 
165
-	if (!empty($context['drafts_pm_save']))
166
-		echo '
170
+	if (!empty($context['drafts_pm_save'])) {
171
+			echo '
167 172
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button">
168 173
 		<input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">';
174
+	}
169 175
 
170
-	if (!empty($context['drafts_save']))
171
-		echo '
176
+	if (!empty($context['drafts_save'])) {
177
+			echo '
172 178
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button">
173 179
 		<input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">';
180
+	}
174 181
 
175
-	if ($context['show_spellchecking'])
176
-		echo '
182
+	if ($context['show_spellchecking']) {
183
+			echo '
177 184
 		<input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button">';
185
+	}
178 186
 
179
-	if ($editor_context['preview_type'])
180
-		echo '
187
+	if ($editor_context['preview_type']) {
188
+			echo '
181 189
 		<input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button">';
190
+	}
182 191
 
183 192
 	echo '
184 193
 		<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">';
185 194
 
186 195
 	// Load in the PM autosaver if it's enabled
187
-	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave']))
188
-		echo '
196
+	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) {
197
+			echo '
189 198
 		<span class="righttext padding" style="display: block">
190 199
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon"></span>
191 200
 			<span id="draft_lastautosave" ></span>
@@ -203,10 +212,11 @@  discard block
 block discarded – undo
203 212
 				iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), '
204 213
 			});
205 214
 		</script>';
215
+	}
206 216
 
207 217
 	// Start an instance of the auto saver if its enabled
208
-	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave']))
209
-		echo '
218
+	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) {
219
+			echo '
210 220
 		<span class="righttext padding" style="display: block">
211 221
 			<span id="throbber" style="display:none"><img src="', $settings['images_url'], '/loading_sm.gif" alt="" class="centericon"></span>
212 222
 			<span id="draft_lastautosave" ></span>
@@ -223,7 +233,8 @@  discard block
 block discarded – undo
223 233
 				iFreq: ', $context['drafts_autosave_frequency'], '
224 234
 			});
225 235
 		</script>';
226
-}
236
+	}
237
+	}
227 238
 
228 239
 /**
229 240
  * This template displays a verification form
@@ -240,51 +251,57 @@  discard block
 block discarded – undo
240 251
 	$verify_context = &$context['controls']['verification'][$verify_id];
241 252
 
242 253
 	// Keep track of where we are.
243
-	if (empty($verify_context['tracking']) || $reset)
244
-		$verify_context['tracking'] = 0;
254
+	if (empty($verify_context['tracking']) || $reset) {
255
+			$verify_context['tracking'] = 0;
256
+	}
245 257
 
246 258
 	// How many items are there to display in total.
247 259
 	$total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0);
248 260
 
249 261
 	// If we've gone too far, stop.
250
-	if ($verify_context['tracking'] > $total_items)
251
-		return false;
262
+	if ($verify_context['tracking'] > $total_items) {
263
+			return false;
264
+	}
252 265
 
253 266
 	// Loop through each item to show them.
254 267
 	for ($i = 0; $i < $total_items; $i++)
255 268
 	{
256 269
 		// If we're after a single item only show it if we're in the right place.
257
-		if ($display_type == 'single' && $verify_context['tracking'] != $i)
258
-			continue;
270
+		if ($display_type == 'single' && $verify_context['tracking'] != $i) {
271
+					continue;
272
+		}
259 273
 
260
-		if ($display_type != 'single')
261
-			echo '
274
+		if ($display_type != 'single') {
275
+					echo '
262 276
 			<div id="verification_control_', $i, '" class="verification_control">';
277
+		}
263 278
 
264 279
 		// Display empty field, but only if we have one, and it's the first time.
265
-		if ($verify_context['empty_field'] && empty($i))
266
-			echo '
280
+		if ($verify_context['empty_field'] && empty($i)) {
281
+					echo '
267 282
 				<div class="smalltext vv_special">
268 283
 					', $txt['visual_verification_hidden'], ':
269 284
 					<input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value="">
270 285
 				</div>';
286
+		}
271 287
 
272 288
 		// Do the actual stuff
273 289
 		if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha']))
274 290
 		{
275 291
 			if ($verify_context['show_visual'])
276 292
 			{
277
-				if ($context['use_graphic_library'])
278
-					echo '
293
+				if ($context['use_graphic_library']) {
294
+									echo '
279 295
 				<img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">';
280
-				else
281
-					echo '
296
+				} else {
297
+									echo '
282 298
 				<img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1">
283 299
 				<img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2">
284 300
 				<img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3">
285 301
 				<img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4">
286 302
 				<img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5">
287 303
 				<img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">';
304
+				}
288 305
 
289 306
 				echo '
290 307
 				<div class="smalltext" style="margin: 4px 0 8px 0;">
@@ -294,13 +311,13 @@  discard block
 block discarded – undo
294 311
 				</div>';
295 312
 			}
296 313
 
297
-			if ($verify_context['can_recaptcha'])
298
-				echo '
314
+			if ($verify_context['can_recaptcha']) {
315
+							echo '
299 316
 				<div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div>
300 317
 				<br>
301 318
 				<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>';
302
-		}
303
-		else
319
+			}
320
+		} else
304 321
 		{
305 322
 			// Where in the question array is this question?
306 323
 			$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;
@@ -312,21 +329,24 @@  discard block
 block discarded – undo
312 329
 				</div>';
313 330
 		}
314 331
 
315
-		if ($display_type != 'single')
316
-			echo '
332
+		if ($display_type != 'single') {
333
+					echo '
317 334
 			</div><!-- #verification_control_[i] -->';
335
+		}
318 336
 
319 337
 		// If we were displaying just one and we did it, break.
320
-		if ($display_type == 'single' && $verify_context['tracking'] == $i)
321
-			break;
338
+		if ($display_type == 'single' && $verify_context['tracking'] == $i) {
339
+					break;
340
+		}
322 341
 	}
323 342
 
324 343
 	// Assume we found something, always.
325 344
 	$verify_context['tracking']++;
326 345
 
327 346
 	// Tell something displaying piecemeal to keep going.
328
-	if ($display_type == 'single')
329
-		return true;
330
-}
347
+	if ($display_type == 'single') {
348
+			return true;
349
+	}
350
+	}
331 351
 
332 352
 ?>
333 353
\ No newline at end of file
Please login to merge, or discard this patch.