Completed
Push — release-2.1 ( e39a06...35b3d8 )
by Mathias
07:09
created
Themes/default/ReportToMod.template.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,16 +62,17 @@
 block discarded – undo
62 62
 				<div id="error_box" class="errorbox">
63 63
 					<ul id="error_list">';
64 64
 
65
-		foreach ($context['post_errors'] as $key => $error)
66
-			echo '
65
+		foreach ($context['post_errors'] as $key => $error) {
66
+					echo '
67 67
 						<li id="error_', $key, '" class="error">', $error, '</li>';
68
+		}
68 69
 
69 70
 		echo '
70 71
 					</ul>';
71
-	}
72
-	else
73
-		echo '
72
+	} else {
73
+			echo '
74 74
 				<div style="display:none" id="error_box" class="errorbox">';
75
+	}
75 76
 
76 77
 	echo '
77 78
 				</div>';
Please login to merge, or discard this patch.
Themes/default/ReportedContent.template.php 1 patch
Braces   +66 added lines, -44 removed lines patch added patch discarded remove patch
@@ -18,11 +18,12 @@  discard block
 block discarded – undo
18 18
 	global $context, $txt, $scripturl;
19 19
 
20 20
 	// Let them know the action was a success.
21
-	if (!empty($context['report_post_action']))
22
-		echo '
21
+	if (!empty($context['report_post_action'])) {
22
+			echo '
23 23
 	<div class="infobox">
24 24
 		', $txt['report_action_' . $context['report_post_action']], '
25 25
 	</div>';
26
+	}
26 27
 
27 28
 	echo '
28 29
 	<form id="reported_posts" action="', $scripturl, '?action=moderate;area=reportedposts;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
@@ -52,8 +53,9 @@  discard block
 block discarded – undo
52 53
 
53 54
 		// Prepare the comments...
54 55
 		$comments = array();
55
-		foreach ($report['comments'] as $comment)
56
-			$comments[$comment['member']['id']] = $comment['member']['link'];
56
+		foreach ($report['comments'] as $comment) {
57
+					$comments[$comment['member']['id']] = $comment['member']['link'];
58
+		}
57 59
 
58 60
 		echo '
59 61
 				', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
@@ -69,18 +71,21 @@  discard block
 block discarded – undo
69 71
 				<li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
70 72
 
71 73
 		// Delete message button.
72
-		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])))
73
-			echo '
74
+		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) {
75
+					echo '
74 76
 				<li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>';
77
+		}
75 78
 
76 79
 		// Ban this user button.
77
-		if (!$report['closed'] && !empty($context['report_manage_bans']))
78
-			echo '
80
+		if (!$report['closed'] && !empty($context['report_manage_bans'])) {
81
+					echo '
79 82
 				<li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']), ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
83
+		}
80 84
 
81
-		if (!$context['view_closed'])
82
-			echo '
85
+		if (!$context['view_closed']) {
86
+					echo '
83 87
 				<li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>';
88
+		}
84 89
 
85 90
 		echo '
86 91
 			</ul>
@@ -88,18 +93,20 @@  discard block
 block discarded – undo
88 93
 	}
89 94
 
90 95
 	// Were none found?
91
-	if (empty($context['reports']))
92
-		echo '
96
+	if (empty($context['reports'])) {
97
+			echo '
93 98
 		<div class="windowbg2">
94 99
 			<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
95 100
 		</div>';
101
+	}
96 102
 
97 103
 	echo '
98 104
 		<div class="pagesection">';
99 105
 	
100
-	if (!empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many'])
101
-		echo '
106
+	if (!empty($context['total_reports']) && $context['total_reports'] >= $context['reports_how_many']) {
107
+			echo '
102 108
 			<div class="pagelinks floatleft">' . $context['page_index'] . '</div>';
109
+	}
103 110
 
104 111
 	echo '
105 112
 			<div class="floatright">', !$context['view_closed'] ? '
@@ -130,18 +137,20 @@  discard block
 block discarded – undo
130 137
 			<div class="modbox">
131 138
 				<ul>';
132 139
 
133
-	foreach ($context['reported_posts'] as $report)
134
-		echo '
140
+	foreach ($context['reported_posts'] as $report) {
141
+			echo '
135 142
 					<li class="smalltext">
136 143
 						<a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
137 144
 					</li>';
145
+	}
138 146
 
139 147
 	// Don't have any watched users right now?
140
-	if (empty($context['reported_posts']))
141
-		echo '
148
+	if (empty($context['reported_posts'])) {
149
+			echo '
142 150
 					<li>
143 151
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
144 152
 					</li>';
153
+	}
145 154
 
146 155
 	echo '
147 156
 				</ul>
@@ -189,11 +198,12 @@  discard block
 block discarded – undo
189 198
 	global $context, $scripturl, $txt;
190 199
 
191 200
 	// Let them know the action was a success.
192
-	if (!empty($context['report_post_action']))
193
-		echo '
201
+	if (!empty($context['report_post_action'])) {
202
+			echo '
194 203
 	<div class="infobox">
195 204
 		', $txt['report_action_' . $context['report_post_action']], '
196 205
 	</div>';
206
+	}
197 207
 
198 208
 	echo '
199 209
 	<div id="modcenter">
@@ -229,14 +239,15 @@  discard block
 block discarded – undo
229 239
 				<h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3>
230 240
 			</div>';
231 241
 
232
-	foreach ($context['report']['comments'] as $comment)
233
-		echo '
242
+	foreach ($context['report']['comments'] as $comment) {
243
+			echo '
234 244
 			<div class="windowbg">
235 245
 				<p class="smalltext">
236 246
 					', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '
237 247
 				</p>
238 248
 				<p>', $comment['message'], '</p>
239 249
 			</div>';
250
+	}
240 251
 
241 252
 	echo '
242 253
 			<br>
@@ -245,11 +256,12 @@  discard block
 block discarded – undo
245 256
 			</div>
246 257
 			<div>';
247 258
 
248
-	if (empty($context['report']['mod_comments']))
249
-		echo '
259
+	if (empty($context['report']['mod_comments'])) {
260
+			echo '
250 261
 				<div class="information">
251 262
 					<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
252 263
 				</div>';
264
+	}
253 265
 
254 266
 	foreach ($context['report']['mod_comments'] as $comment)
255 267
 	{
@@ -335,18 +347,20 @@  discard block
 block discarded – undo
335 347
 			<div class="modbox">
336 348
 				<ul>';
337 349
 
338
-	foreach ($context['reported_members'] as $report)
339
-		echo '
350
+	foreach ($context['reported_members'] as $report) {
351
+			echo '
340 352
 					<li class="smalltext">
341 353
 						<a href="', $report['report_href'], '">', $report['user_name'], '</a>
342 354
 					</li>';
355
+	}
343 356
 
344 357
 	// Don't have any reported members right now?
345
-	if (empty($context['reported_members']))
346
-		echo '
358
+	if (empty($context['reported_members'])) {
359
+			echo '
347 360
 					<li>
348 361
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
349 362
 					</li>';
363
+	}
350 364
 
351 365
 	echo '
352 366
 				</ul>
@@ -394,11 +408,12 @@  discard block
 block discarded – undo
394 408
 	global $context, $txt, $scripturl;
395 409
 
396 410
 	// Let them know the action was a success.
397
-	if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']]))
398
-		echo '
411
+	if (!empty($context['report_post_action']) && !empty($txt['report_action_' . $context['report_post_action']])) {
412
+			echo '
399 413
 	<div class="infobox">
400 414
 		', $txt['report_action_' . $context['report_post_action']], '
401 415
 	</div>';
416
+	}
402 417
 
403 418
 	echo '
404 419
 	<form id="reported_members" action="', $scripturl, '?action=moderate;area=reportedmembers;sa=show', $context['view_closed'] ? ';closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
@@ -430,8 +445,9 @@  discard block
 block discarded – undo
430 445
 
431 446
 		// Prepare the comments...
432 447
 		$comments = array();
433
-		foreach ($report['comments'] as $comment)
434
-			$comments[$comment['member']['id']] = $comment['member']['link'];
448
+		foreach ($report['comments'] as $comment) {
449
+					$comments[$comment['member']['id']] = $comment['member']['link'];
450
+		}
435 451
 
436 452
 		echo '
437 453
 				', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
@@ -443,13 +459,15 @@  discard block
 block discarded – undo
443 459
 				<li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
444 460
 
445 461
 		// Ban this user button.
446
-		if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id']))
447
-			echo '
462
+		if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) {
463
+					echo '
448 464
 				<li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
465
+		}
449 466
 
450
-		if (!$context['view_closed'])
451
-			echo '
467
+		if (!$context['view_closed']) {
468
+					echo '
452 469
 				<li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>';
470
+		}
453 471
 
454 472
 			echo '
455 473
 			</ul>
@@ -457,11 +475,12 @@  discard block
 block discarded – undo
457 475
 	}
458 476
 
459 477
 	// Were none found?
460
-	if (empty($context['reports']))
461
-		echo '
478
+	if (empty($context['reports'])) {
479
+			echo '
462 480
 		<div class="windowbg2">
463 481
 			<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
464 482
 		</div>';
483
+	}
465 484
 
466 485
 	echo '
467 486
 		<div class="pagesection">
@@ -482,11 +501,12 @@  discard block
 block discarded – undo
482 501
 	global $context, $scripturl, $txt;
483 502
 
484 503
 	// Let them know the action was a success.
485
-	if (!empty($context['report_post_action']))
486
-		echo '
504
+	if (!empty($context['report_post_action'])) {
505
+			echo '
487 506
 	<div class="infobox">
488 507
 		', $txt['report_action_' . $context['report_post_action']], '
489 508
 	</div>';
509
+	}
490 510
 
491 511
 	echo '
492 512
 	<div id="modcenter">
@@ -519,14 +539,15 @@  discard block
 block discarded – undo
519 539
 				<h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3>
520 540
 			</div>';
521 541
 
522
-	foreach ($context['report']['comments'] as $comment)
523
-		echo '
542
+	foreach ($context['report']['comments'] as $comment) {
543
+			echo '
524 544
 			<div class="windowbg">
525 545
 				<p class="smalltext">
526 546
 					', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '
527 547
 				</p>
528 548
 				<p>', $comment['message'], '</p>
529 549
 			</div>';
550
+	}
530 551
 
531 552
 	echo '
532 553
 			<br>
@@ -535,11 +556,12 @@  discard block
 block discarded – undo
535 556
 			</div>
536 557
 			<div>';
537 558
 
538
-	if (empty($context['report']['mod_comments']))
539
-		echo '
559
+	if (empty($context['report']['mod_comments'])) {
560
+			echo '
540 561
 				<div class="information">
541 562
 					<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
542 563
 				</div>';
564
+	}
543 565
 
544 566
 	foreach ($context['report']['mod_comments'] as $comment)
545 567
 	{
Please login to merge, or discard this patch.
Themes/default/MessageIndex.template.php 1 patch
Braces   +100 added lines, -70 removed lines patch added patch discarded remove patch
@@ -18,11 +18,12 @@  discard block
 block discarded – undo
18 18
 	global $context, $settings, $options, $scripturl, $modSettings, $txt;
19 19
 
20 20
 	// Let them know why their message became unapproved.
21
-	if ($context['becomesUnapproved'])
22
-		echo '
21
+	if ($context['becomesUnapproved']) {
22
+			echo '
23 23
 	<div class="noticebox">
24 24
 		', $txt['post_becomesUnapproved'], '
25 25
 	</div>';
26
+	}
26 27
 
27 28
 	if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
28 29
 	{
@@ -46,17 +47,19 @@  discard block
 block discarded – undo
46 47
 				</a>';
47 48
 
48 49
 			// Has it outstanding posts for approval?
49
-			if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
50
-				echo '
50
+			if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
51
+							echo '
51 52
 				<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
53
+			}
52 54
 
53 55
 			echo '
54 56
 				<p class="board_description">', $board['description'], '</p>';
55 57
 
56 58
 			// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
57
-			if (!empty($board['moderators']) || !empty($board['moderator_groups']))
58
-				echo '
59
+			if (!empty($board['moderators']) || !empty($board['moderator_groups'])) {
60
+							echo '
59 61
 				<p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
62
+			}
60 63
 
61 64
 			// Show some basic information about the number of posts, etc.
62 65
 			echo '
@@ -68,9 +71,10 @@  discard block
 block discarded – undo
68 71
 			</div>
69 72
 			<div class="lastpost lpr_border">';
70 73
 
71
-			if (!empty($board['last_post']['id']))
72
-				echo '
74
+			if (!empty($board['last_post']['id'])) {
75
+							echo '
73 76
 				<p>', $board['last_post']['last_post_message'], '</p>';
77
+			}
74 78
 
75 79
 			echo '
76 80
 			</div>';
@@ -84,14 +88,16 @@  discard block
 block discarded – undo
84 88
 					id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
85 89
 				foreach ($board['children'] as $child)
86 90
 				{
87
-					if (!$child['is_redirect'])
88
-						$child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
89
-					else
90
-						$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
91
+					if (!$child['is_redirect']) {
92
+											$child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
93
+					} else {
94
+											$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
95
+					}
91 96
 
92 97
 					// Has it posts awaiting approval?
93
-					if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
94
-						$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
98
+					if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) {
99
+											$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
100
+					}
95 101
 
96 102
 					$children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>';
97 103
 				}
@@ -111,8 +117,9 @@  discard block
 block discarded – undo
111 117
 	}
112 118
 
113 119
 	// They can only mark read if they are logged in and it's enabled!
114
-	if (!$context['user']['is_logged'])
115
-		unset($context['normal_buttons']['markread']);
120
+	if (!$context['user']['is_logged']) {
121
+			unset($context['normal_buttons']['markread']);
122
+	}
116 123
 
117 124
 	if (!$context['no_topic_listing'])
118 125
 	{
@@ -139,13 +146,15 @@  discard block
 block discarded – undo
139 146
 		<h3>', $context['name'], '</h3>
140 147
 		<p>';
141 148
 
142
-			if ($context['description'] != '')
143
-				echo '
149
+			if ($context['description'] != '') {
150
+							echo '
144 151
 			', $context['description'];
152
+			}
145 153
 
146
-			if (!empty($context['moderators']))
147
-				echo '
154
+			if (!empty($context['moderators'])) {
155
+							echo '
148 156
 			', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.';
157
+			}
149 158
 
150 159
 			echo '
151 160
 		</p>
@@ -153,9 +162,10 @@  discard block
 block discarded – undo
153 162
 		}
154 163
 
155 164
 		// If Quick Moderation is enabled start the form.
156
-		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
157
-			echo '
165
+		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
166
+					echo '
158 167
 	<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
168
+		}
159 169
 
160 170
 		echo '
161 171
 		<div id="messageindex">';
@@ -165,11 +175,11 @@  discard block
 block discarded – undo
165 175
 			echo '
166 176
 			<div class="information">';
167 177
 
168
-			if ($settings['display_who_viewing'] == 1)
169
-				echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
170
-
171
-			else
172
-				echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
178
+			if ($settings['display_who_viewing'] == 1) {
179
+							echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
180
+			} else {
181
+							echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
182
+			}
173 183
 			echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'];
174 184
 
175 185
 		echo '
@@ -189,32 +199,36 @@  discard block
 block discarded – undo
189 199
 				<div class="lastpost">', $context['topics_headers']['last_post'], '</div>';
190 200
 
191 201
 			// Show a "select all" box for quick moderation?
192
-			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
193
-				echo '
202
+			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) {
203
+							echo '
194 204
 				<div class="moderation">
195 205
 					<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">
196 206
 				</div>';
207
+			}
197 208
 
198 209
 			// If it's on in "image" mode, don't show anything but the column.
199
-			elseif (!empty($context['can_quick_mod']))
200
-				echo '
210
+			elseif (!empty($context['can_quick_mod'])) {
211
+							echo '
201 212
 				<div class="moderation"></div>';
213
+			}
202 214
 		}
203 215
 
204 216
 		// No topics... just say, "sorry bub".
205
-		else
206
-			echo '
217
+		else {
218
+					echo '
207 219
 				<h3 class="titlebg">', $txt['topic_alert_none'], '</h3>';
220
+		}
208 221
 
209 222
 		echo '
210 223
 			</div><!-- #topic_header -->';
211 224
 
212 225
 		// If this person can approve items and we have some awaiting approval tell them.
213
-		if (!empty($context['unapproved_posts_message']))
214
-			echo '
226
+		if (!empty($context['unapproved_posts_message'])) {
227
+					echo '
215 228
 			<div class="information">
216 229
 				<span class="alert">!</span> ', $context['unapproved_posts_message'], '
217 230
 			</div>';
231
+		}
218 232
 
219 233
 		// Contain the topic list
220 234
 		echo '
@@ -235,25 +249,30 @@  discard block
 block discarded – undo
235 249
 			echo '
236 250
 							<div class="icons floatright">';
237 251
 
238
-			if ($topic['is_watched'])
239
-				echo '
252
+			if ($topic['is_watched']) {
253
+							echo '
240 254
 								<span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>';
255
+			}
241 256
 
242
-			if ($topic['is_locked'])
243
-				echo '
257
+			if ($topic['is_locked']) {
258
+							echo '
244 259
 								<span class="generic_icons lock"></span>';
260
+			}
245 261
 
246
-			if ($topic['is_sticky'])
247
-				echo '
262
+			if ($topic['is_sticky']) {
263
+							echo '
248 264
 								<span class="generic_icons sticky"></span>';
265
+			}
249 266
 
250
-			if ($topic['is_redirect'])
251
-				echo '
267
+			if ($topic['is_redirect']) {
268
+							echo '
252 269
 								<span class="generic_icons move"></span>';
270
+			}
253 271
 
254
-			if ($topic['is_poll'])
255
-				echo '
272
+			if ($topic['is_poll']) {
273
+							echo '
256 274
 								<span class="generic_icons poll"></span>';
275
+			}
257 276
 
258 277
 			echo '
259 278
 							</div>';
@@ -285,26 +304,31 @@  discard block
 block discarded – undo
285 304
 				echo '
286 305
 					<div class="moderation">';
287 306
 
288
-				if ($options['display_quick_mod'] == 1)
289
-					echo '
307
+				if ($options['display_quick_mod'] == 1) {
308
+									echo '
290 309
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '">';
291
-				else
310
+				} else
292 311
 				{
293 312
 					// Check permissions on each and show only the ones they are allowed to use.
294
-					if ($topic['quick_mod']['remove'])
295
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
313
+					if ($topic['quick_mod']['remove']) {
314
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
315
+					}
296 316
 
297
-					if ($topic['quick_mod']['lock'])
298
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
317
+					if ($topic['quick_mod']['lock']) {
318
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
319
+					}
299 320
 
300
-					if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
301
-						echo '<br>';
321
+					if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
322
+											echo '<br>';
323
+					}
302 324
 
303
-					if ($topic['quick_mod']['sticky'])
304
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
325
+					if ($topic['quick_mod']['sticky']) {
326
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
327
+					}
305 328
 
306
-					if ($topic['quick_mod']['move'])
307
-						echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
329
+					if ($topic['quick_mod']['move']) {
330
+											echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
331
+					}
308 332
 				}
309 333
 				echo '
310 334
 					</div><!-- .moderation -->';
@@ -322,18 +346,20 @@  discard block
 block discarded – undo
322 346
 				<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
323 347
 					<option value="">--------</option>';
324 348
 
325
-			foreach ($context['qmod_actions'] as $qmod_action)
326
-				if ($context['can_' . $qmod_action])
349
+			foreach ($context['qmod_actions'] as $qmod_action) {
350
+							if ($context['can_' . $qmod_action])
327 351
 					echo '
328 352
 					<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
353
+			}
329 354
 
330 355
 			echo '
331 356
 				</select>';
332 357
 
333 358
 			// Show a list of boards they can move the topic to.
334
-			if ($context['can_move'])
335
-				echo '
359
+			if ($context['can_move']) {
360
+							echo '
336 361
 				<span id="quick_mod_jump_to"></span>';
362
+			}
337 363
 
338 364
 			echo '
339 365
 				<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction">
@@ -344,10 +370,11 @@  discard block
 block discarded – undo
344 370
 		</div><!-- #messageindex -->';
345 371
 
346 372
 		// Finish off the form - again.
347
-		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
348
-			echo '
373
+		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
374
+					echo '
349 375
 		<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
350 376
 	</form>';
377
+		}
351 378
 
352 379
 		// Mobile action buttons (bottom)
353 380
 		echo '
@@ -369,8 +396,8 @@  discard block
 block discarded – undo
369 396
 	// Show breadcrumbs at the bottom too.
370 397
 	theme_linktree();
371 398
 
372
-	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
373
-		echo '
399
+	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
400
+			echo '
374 401
 	<script>
375 402
 		if (typeof(window.XMLHttpRequest) != "undefined")
376 403
 			aJumpTo[aJumpTo.length] = new JumpTo({
@@ -389,6 +416,7 @@  discard block
 block discarded – undo
389 416
 				sCustomName: "move_to"
390 417
 			});
391 418
 	</script>';
419
+	}
392 420
 
393 421
 	// Javascript for inline editing.
394 422
 	echo '
@@ -425,8 +453,8 @@  discard block
 block discarded – undo
425 453
 		<div class="information">
426 454
 			<p class="floatright" id="message_index_jump_to"></p>';
427 455
 
428
-	if (empty($context['no_topic_listing']))
429
-		echo '
456
+	if (empty($context['no_topic_listing'])) {
457
+			echo '
430 458
 			<p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
431 459
 				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', '
432 460
 				'. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br>
@@ -436,9 +464,10 @@  discard block
 block discarded – undo
436 464
 				<span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br>
437 465
 				<span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br>
438 466
 			</p>';
467
+	}
439 468
 
440
-	if (!empty($context['jump_to']))
441
-		echo '
469
+	if (!empty($context['jump_to'])) {
470
+			echo '
442 471
 			<script>
443 472
 				if (typeof(window.XMLHttpRequest) != "undefined")
444 473
 					aJumpTo[aJumpTo.length] = new JumpTo({
@@ -454,6 +483,7 @@  discard block
 block discarded – undo
454 483
 						sGoButtonLabel: "', $txt['quick_mod_go'], '"
455 484
 					});
456 485
 			</script>';
486
+	}
457 487
 
458 488
 	echo '
459 489
 			<br class="clear">
Please login to merge, or discard this patch.
Themes/default/ManageScheduledTasks.template.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,13 +20,12 @@  discard block
 block discarded – undo
20 20
 	// We completed some tasks?
21 21
 	if (!empty($context['tasks_were_run']))
22 22
 	{
23
-		if (empty($context['scheduled_errors']))
24
-			echo '
23
+		if (empty($context['scheduled_errors'])) {
24
+					echo '
25 25
 	<div class="infobox">
26 26
 		', $txt['scheduled_tasks_were_run'], '
27 27
 	</div>';
28
-
29
-		else
28
+		} else
30 29
 		{
31 30
 			echo '
32 31
 	<div class="errorbox" id="errors">
@@ -35,14 +34,15 @@  discard block
 block discarded – undo
35 34
 				<strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong>
36 35
 			</dt>';
37 36
 
38
-			foreach ($context['scheduled_errors'] as $task => $errors)
39
-				echo '
37
+			foreach ($context['scheduled_errors'] as $task => $errors) {
38
+							echo '
40 39
 			<dd class="error">
41 40
 				<strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong>
42 41
 				<ul>
43 42
 					<li>', implode('</li><li>', $errors), '</li>
44 43
 				</ul>
45 44
 			</dd>';
45
+			}
46 46
 
47 47
 			echo '
48 48
 		</dl>
Please login to merge, or discard this patch.
Themes/default/ManageMaintenance.template.php 1 patch
Braces   +45 added lines, -31 removed lines patch added patch discarded remove patch
@@ -18,11 +18,12 @@  discard block
 block discarded – undo
18 18
 	global $context, $txt, $scripturl, $modSettings;
19 19
 
20 20
 	// If maintenance has finished tell the user.
21
-	if (!empty($context['maintenance_finished']))
22
-		echo '
21
+	if (!empty($context['maintenance_finished'])) {
22
+			echo '
23 23
 	<div class="infobox">
24 24
 		', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
25 25
 	</div>';
26
+	}
26 27
 
27 28
 	echo '
28 29
 	<div id="manage_maintenance">
@@ -39,8 +40,8 @@  discard block
 block discarded – undo
39 40
 		</div>';
40 41
 
41 42
 	// Show an option to convert the body column of the post table to MEDIUMTEXT or TEXT
42
-	if (isset($context['convert_to']))
43
-		echo '
43
+	if (isset($context['convert_to'])) {
44
+			echo '
44 45
 		<div class="cat_bar">
45 46
 			<h3 class="catbg">', $txt[$context['convert_to'] . '_title'], '</h3>
46 47
 		</div>
@@ -53,10 +54,11 @@  discard block
 block discarded – undo
53 54
 				<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
54 55
 			</form>
55 56
 		</div>';
57
+	}
56 58
 
57 59
 	// Show an option to convert to UTF-8 if we're not on UTF-8 yet.
58
-	if ($context['convert_utf8'])
59
-		echo '
60
+	if ($context['convert_utf8']) {
61
+			echo '
60 62
 		<div class="cat_bar">
61 63
 			<h3 class="catbg">', $txt['utf8_title'], '</h3>
62 64
 		</div>
@@ -69,10 +71,11 @@  discard block
 block discarded – undo
69 71
 				<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
70 72
 			</form>
71 73
 		</div>';
74
+	}
72 75
 
73 76
 	// We might want to convert entities if we're on UTF-8.
74
-	if ($context['convert_entities'])
75
-		echo '
77
+	if ($context['convert_entities']) {
78
+			echo '
76 79
 		<div class="cat_bar">
77 80
 			<h3 class="catbg">', $txt['entity_convert_title'], '</h3>
78 81
 		</div>
@@ -84,6 +87,7 @@  discard block
 block discarded – undo
84 87
 				<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '">
85 88
 			</form>
86 89
 		</div>';
90
+	}
87 91
 
88 92
 	echo '
89 93
 	</div><!-- #manage_maintenance -->';
@@ -101,11 +105,12 @@  discard block
 block discarded – undo
101 105
 	<div id="manage_maintenance">';
102 106
 
103 107
 	// If maintenance has finished tell the user.
104
-	if (!empty($context['maintenance_finished']))
105
-		echo '
108
+	if (!empty($context['maintenance_finished'])) {
109
+			echo '
106 110
 		<div class="infobox">
107 111
 			', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
108 112
 		</div>';
113
+	}
109 114
 
110 115
 	echo '
111 116
 		<div class="cat_bar">
@@ -237,11 +242,12 @@  discard block
 block discarded – undo
237 242
 	<div id="manage_maintenance">';
238 243
 
239 244
 	// If maintenance has finished, tell the user.
240
-	if (!empty($context['maintenance_finished']))
241
-		echo '
245
+	if (!empty($context['maintenance_finished'])) {
246
+			echo '
242 247
 		<div class="infobox">
243 248
 			', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
244 249
 		</div>';
250
+	}
245 251
 
246 252
 	echo '
247 253
 		<div class="cat_bar">
@@ -303,9 +309,10 @@  discard block
 block discarded – undo
303 309
 				</p>
304 310
 				<div style="display: none;" id="membersPanel">';
305 311
 
306
-	foreach ($context['membergroups'] as $group)
307
-		echo '
312
+	foreach ($context['membergroups'] as $group) {
313
+			echo '
308 314
 					<label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked> ', $group['name'], '</label><br>';
315
+	}
309 316
 
310 317
 	echo '
311 318
 				</div>
@@ -349,11 +356,12 @@  discard block
 block discarded – undo
349 356
 	global $scripturl, $txt, $context, $settings, $modSettings;
350 357
 
351 358
 	// If maintenance has finished tell the user.
352
-	if (!empty($context['maintenance_finished']))
353
-		echo '
359
+	if (!empty($context['maintenance_finished'])) {
360
+			echo '
354 361
 	<div class="infobox">
355 362
 		', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
356 363
 	</div>';
364
+	}
357 365
 
358 366
 	// Bit of javascript for showing which boards to prune in an otherwise hidden list.
359 367
 	echo '
@@ -421,21 +429,23 @@  discard block
 block discarded – undo
421 429
 								<ul>';
422 430
 
423 431
 		// Display a checkbox with every board.
424
-		foreach ($category['boards'] as $board)
425
-			echo '
432
+		foreach ($category['boards'] as $board) {
433
+					echo '
426 434
 									<li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;">
427 435
 										<label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked>', $board['name'], '</label>
428 436
 									</li>';
437
+		}
429 438
 
430 439
 		echo '
431 440
 								</ul>
432 441
 							</fieldset>';
433 442
 
434 443
 		// Increase $i, and check if we're at the middle yet.
435
-		if (++$i == $middle)
436
-			echo '
444
+		if (++$i == $middle) {
445
+					echo '
437 446
 						</div><!-- .floatleft -->
438 447
 						<div class="floatright" style="width: 49%;">';
448
+		}
439 449
 	}
440 450
 
441 451
 	echo '
@@ -477,9 +487,10 @@  discard block
 block discarded – undo
477 487
 		echo '
478 488
 						<optgroup label="', $category['name'], '">';
479 489
 
480
-		foreach ($category['boards'] as $board)
481
-			echo '
490
+		foreach ($category['boards'] as $board) {
491
+					echo '
482 492
 							<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
493
+		}
483 494
 
484 495
 		echo '
485 496
 						</optgroup>';
@@ -497,9 +508,10 @@  discard block
 block discarded – undo
497 508
 		echo '
498 509
 						<optgroup label="', $category['name'], '">';
499 510
 
500
-		foreach ($category['boards'] as $board)
501
-			echo '
511
+		foreach ($category['boards'] as $board) {
512
+					echo '
502 513
 							<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
514
+		}
503 515
 
504 516
 		echo '
505 517
 						</optgroup>';
@@ -542,9 +554,10 @@  discard block
 block discarded – undo
542 554
 				', $txt['database_optimize_attempt'], '<br>';
543 555
 
544 556
 	// List each table being optimized...
545
-	foreach ($context['optimized_tables'] as $table)
546
-		echo '
557
+	foreach ($context['optimized_tables'] as $table) {
558
+			echo '
547 559
 				', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>';
560
+	}
548 561
 
549 562
 	// How did we go?
550 563
 	echo '
@@ -604,13 +617,14 @@  discard block
 block discarded – undo
604 617
 				</li>
605 618
 			</ul>';
606 619
 
607
-		if (!empty($context['exceeding_messages_morethan']))
608
-			echo '
620
+		if (!empty($context['exceeding_messages_morethan'])) {
621
+					echo '
609 622
 			<p>', $context['exceeding_messages_morethan'], '</p>';
610
-	}
611
-	else
612
-		echo '
623
+		}
624
+	} else {
625
+			echo '
613 626
 			<p class="infobox">', $txt['convert_to_text'], '</p>';
627
+	}
614 628
 
615 629
 	echo '
616 630
 			<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '">
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>
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			if (!empty($message['custom_fields']['below_avatar']))
281 281
 				foreach ($message['custom_fields']['below_avatar'] as $custom)
282 282
 					echo '
283
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
283
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
284 284
 
285 285
 			if (!$message['member']['is_guest'])
286 286
 				echo '
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
 					foreach ($message['custom_fields']['icons'] as $custom)
324 324
 						echo '
325
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
325
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
326 326
 
327 327
 					echo '
328 328
 							</ol>
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 				if (!empty($message['custom_fields']['standard']))
387 387
 					foreach ($message['custom_fields']['standard'] as $custom)
388 388
 						echo '
389
-						<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
389
+						<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
390 390
 
391 391
 				// Are we showing the warning status?
392 392
 				if ($message['member']['can_see_warning'])
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 				if (!empty($message['custom_fields']['bottom_poster']))
398 398
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
399 399
 						echo '
400
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
400
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
401 401
 			}
402 402
 
403 403
 			// Done with the information about the poster... on to the post itself.
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
 				foreach ($message['custom_fields']['above_signature'] as $custom)
500 500
 					echo '
501
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
501
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
502 502
 
503 503
 				echo '
504 504
 							</ul>
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 
522 522
 				foreach ($message['custom_fields']['below_signature'] as $custom)
523 523
 					echo '
524
-								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
524
+								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
525 525
 
526 526
 				echo '
527 527
 							</ul>
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 	while ($message = $context['get_pmessage']('subject'))
658 658
 	{
659 659
 		echo '
660
-			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
660
+			<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
661 661
 				<td class="table_icon">
662 662
 					<script>
663 663
 						currentLabels[', $message['id'], '] = {';
@@ -946,13 +946,13 @@  discard block
 block discarded – undo
946 946
 				// You can only reply if they are not a guest...
947 947
 				if (!$message['member']['is_guest'])
948 948
 					echo '
949
-					<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
-					<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'];
949
+					<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
+					<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'];
951 951
 
952 952
 				// This is for "forwarding" - even if the member is gone.
953 953
 				else
954 954
 					echo '
955
-					<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'];
955
+					<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'];
956 956
 			}
957 957
 
958 958
 			echo '
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1056 1056
 					<dl>
1057 1057
 						<dt>
1058
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1058
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1059 1059
 						</dt>
1060 1060
 						<dd class="error" id="error_list">
1061 1061
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1112 1112
 					</dt>
1113 1113
 					<dd id="pm_subject">
1114
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1114
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>
1115 1115
 					</dd>
1116 1116
 				</dl>
1117 1117
 				<hr>';
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
 		echo '
1477 1477
 		<div class="padding">
1478 1478
 			<input type="submit" name="save" value="', $txt['save'], '" class="button">
1479
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure">
1479
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure">
1480 1480
 		</div>';
1481 1481
 
1482 1482
 	echo '
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 	if (!empty($context['rules']))
1642 1642
 		echo '
1643 1643
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1644
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">';
1644
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">';
1645 1645
 
1646 1646
 	echo '
1647 1647
 		</div>
@@ -1884,9 +1884,9 @@  discard block
 block discarded – undo
1884 1884
 
1885 1885
 		echo '
1886 1886
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1887
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1888
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1889
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1887
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1888
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1889
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1890 1890
 				</select>
1891 1891
 				<span id="labdiv', $k, '">
1892 1892
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1998,7 +1998,7 @@  discard block
 block discarded – undo
1998 1998
 			</div>
1999 1999
 			<ul class="quickbuttons">
2000 2000
 				<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>
2001
-				<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>
2001
+				<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>
2002 2002
 			</ul>
2003 2003
 		</div><!-- .windowbg -->';
2004 2004
 		}
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/ManageMembergroups.template.php 1 patch
Braces   +104 added lines, -74 removed lines patch added patch discarded remove patch
@@ -55,9 +55,10 @@  discard block
 block discarded – undo
55 55
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
56 56
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
57 57
 
58
-		if ($context['allow_protected'])
59
-			echo '
58
+		if ($context['allow_protected']) {
59
+					echo '
60 60
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
61
+		}
61 62
 
62 63
 		echo '
63 64
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -67,14 +68,15 @@  discard block
 block discarded – undo
67 68
 					</dd>';
68 69
 	}
69 70
 
70
-	if ($context['post_group'] || $context['undefined_group'])
71
-		echo '
71
+	if ($context['post_group'] || $context['undefined_group']) {
72
+			echo '
72 73
 					<dt id="min_posts_text">
73 74
 						<strong>', $txt['membergroups_min_posts'], ':</strong>
74 75
 					</dt>
75 76
 					<dd>
76 77
 						<input type="number" name="min_posts" id="min_posts_input" size="5">
77 78
 					</dd>';
79
+	}
78 80
 
79 81
 	if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups']))
80 82
 	{
@@ -92,9 +94,10 @@  discard block
 block discarded – undo
92 94
 								<option value="-1">', $txt['membergroups_guests'], '</option>
93 95
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
94 96
 
95
-		foreach ($context['groups'] as $group)
96
-			echo '
97
+		foreach ($context['groups'] as $group) {
98
+					echo '
97 99
 								<option value="', $group['id'], '">', $group['name'], '</option>';
100
+		}
98 101
 
99 102
 		echo '
100 103
 							</select>
@@ -105,9 +108,10 @@  discard block
 block discarded – undo
105 108
 								<option value="-1">', $txt['membergroups_guests'], '</option>
106 109
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
107 110
 
108
-		foreach ($context['groups'] as $group)
109
-			echo '
111
+		foreach ($context['groups'] as $group) {
112
+					echo '
110 113
 								<option value="', $group['id'], '">', $group['name'], '</option>';
114
+		}
111 115
 
112 116
 		echo '
113 117
 							</select>
@@ -139,8 +143,8 @@  discard block
 block discarded – undo
139 143
 				<input type="submit" value="', $txt['membergroups_add_group'], '" class="button">
140 144
 			</div><!-- .windowbg2 -->';
141 145
 
142
-	if ($context['undefined_group'])
143
-		echo '
146
+	if ($context['undefined_group']) {
147
+			echo '
144 148
 			<script>
145 149
 				function swapPostGroup(isChecked)
146 150
 				{
@@ -150,6 +154,7 @@  discard block
 block discarded – undo
150 154
 				}
151 155
 				swapPostGroup(', $context['post_group'] ? 'true' : 'false', ');
152 156
 			</script>';
157
+	}
153 158
 
154 159
 	echo '
155 160
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -181,14 +186,15 @@  discard block
 block discarded – undo
181 186
 						<input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30">
182 187
 					</dd>';
183 188
 
184
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
185
-		echo '
189
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
190
+			echo '
186 191
 					<dt id="group_desc_text">
187 192
 						<label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label>
188 193
 					</dt>
189 194
 					<dd>
190 195
 						<textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea>
191 196
 					</dd>';
197
+	}
192 198
 
193 199
 	// Group type...
194 200
 	if ($context['group']['allow_post_group'])
@@ -202,9 +208,10 @@  discard block
 block discarded – undo
202 208
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
203 209
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
204 210
 
205
-		if ($context['group']['allow_protected'])
206
-			echo '
211
+		if ($context['group']['allow_protected']) {
212
+					echo '
207 213
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
214
+		}
208 215
 
209 216
 		echo '
210 217
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -214,8 +221,8 @@  discard block
 block discarded – undo
214 221
 					</dd>';
215 222
 	}
216 223
 
217
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
218
-		echo '
224
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
225
+			echo '
219 226
 					<dt id="group_moderators_text">
220 227
 						<label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label>
221 228
 					</dt>
@@ -233,6 +240,7 @@  discard block
 block discarded – undo
233 240
 							<option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option>
234 241
 						</select>
235 242
 					</dd>';
243
+	}
236 244
 
237 245
 	// Can they inherit permissions?
238 246
 	if ($context['group']['id'] > 1 && $context['group']['id'] != 3)
@@ -249,9 +257,10 @@  discard block
 block discarded – undo
249 257
 							<option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>';
250 258
 
251 259
 		// For all the inheritable groups show an option.
252
-		foreach ($context['inheritable_groups'] as $id => $group)
253
-			echo '
260
+		foreach ($context['inheritable_groups'] as $id => $group) {
261
+					echo '
254 262
 							<option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>';
263
+		}
255 264
 
256 265
 		echo '
257 266
 						</select>
@@ -259,8 +268,8 @@  discard block
 block discarded – undo
259 268
 					</dd>';
260 269
 	}
261 270
 
262
-	if ($context['group']['allow_post_group'])
263
-		echo '
271
+	if ($context['group']['allow_post_group']) {
272
+			echo '
264 273
 
265 274
 					<dt id="min_posts_text">
266 275
 						<label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label>
@@ -268,6 +277,7 @@  discard block
 block discarded – undo
268 277
 					<dd>
269 278
 						<input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6">
270 279
 					</dd>';
280
+	}
271 281
 
272 282
 	echo '
273 283
 					<dt>
@@ -297,9 +307,10 @@  discard block
 block discarded – undo
297 307
 						<select name="icon_image" id="icon_image_input">';
298 308
 
299 309
 		// For every possible icon, create an option.
300
-		foreach ($context['possible_icons'] as $icon)
301
-			echo '
310
+		foreach ($context['possible_icons'] as $icon) {
311
+					echo '
302 312
 							<option value="', $icon, '"', $context['group']['icon_image'] == $icon ? ' selected' : '', '>', $icon, '</option>';
313
+		}
303 314
 
304 315
 		echo '
305 316
 						</select>
@@ -308,9 +319,10 @@  discard block
 block discarded – undo
308 319
 	}
309 320
 
310 321
 	// No? Hide the entire control.
311
-	else
312
-		echo '
322
+	else {
323
+			echo '
313 324
 					<input type="hidden" name="icon_image" value="">';
325
+	}
314 326
 
315 327
 	echo '
316 328
 					<dt>
@@ -322,8 +334,8 @@  discard block
 block discarded – undo
322 334
 					</dd>';
323 335
 
324 336
 	// Force 2FA for this membergroup?
325
-	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2)
326
-		echo '
337
+	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) {
338
+			echo '
327 339
 					<dt>
328 340
 						<label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br>
329 341
 						<span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span>
@@ -331,6 +343,7 @@  discard block
 block discarded – undo
331 343
 					<dd>
332 344
 						<input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '>
333 345
 					</dd>';
346
+	}
334 347
 
335 348
 	if (!empty($context['categories']))
336 349
 	{
@@ -341,11 +354,11 @@  discard block
 block discarded – undo
341 354
 					</dt>
342 355
 					<dd>';
343 356
 
344
-		if (!empty($context['can_manage_boards']))
345
-			echo $txt['membergroups_can_manage_access'];
346
-
347
-		else
348
-			template_add_edit_group_boards_list();
357
+		if (!empty($context['can_manage_boards'])) {
358
+					echo $txt['membergroups_can_manage_access'];
359
+		} else {
360
+					template_add_edit_group_boards_list();
361
+		}
349 362
 
350 363
 		echo '
351 364
 					</dd>';
@@ -375,20 +388,21 @@  discard block
 block discarded – undo
375 388
 			sItemListContainerId: \'moderator_container\',
376 389
 			aListItems: [';
377 390
 
378
-	foreach ($context['group']['moderators'] as $id_member => $member_name)
379
-		echo '
391
+	foreach ($context['group']['moderators'] as $id_member => $member_name) {
392
+			echo '
380 393
 				{
381 394
 					sItemId: ', JavaScriptEscape($id_member), ',
382 395
 					sItemName: ', JavaScriptEscape($member_name), '
383 396
 				}', $id_member == $context['group']['last_moderator_id'] ? '' : ',';
397
+	}
384 398
 
385 399
 	echo '
386 400
 			]
387 401
 		});
388 402
 	</script>';
389 403
 
390
-	if ($context['group']['allow_post_group'])
391
-		echo '
404
+	if ($context['group']['allow_post_group']) {
405
+			echo '
392 406
 	<script>
393 407
 		function swapPostGroup(isChecked)
394 408
 		{
@@ -436,7 +450,8 @@  discard block
 block discarded – undo
436 450
 
437 451
 		swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', ');
438 452
 	</script>';
439
-}
453
+	}
454
+	}
440 455
 
441 456
 /**
442 457
  * The template for determining which boards a group has access to.
@@ -454,13 +469,13 @@  discard block
 block discarded – undo
454 469
 
455 470
 	foreach ($context['categories'] as $category)
456 471
 	{
457
-		if (empty($modSettings['deny_boards_access']))
458
-			echo '
472
+		if (empty($modSettings['deny_boards_access'])) {
473
+					echo '
459 474
 									<li class="category">
460 475
 										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a>
461 476
 										<ul>';
462
-		else
463
-			echo '
477
+		} else {
478
+					echo '
464 479
 									<li class="category">
465 480
 										<strong>', $category['name'], '</strong>
466 481
 										<span class="select_all_box">
@@ -473,16 +488,17 @@  discard block
 block discarded – undo
473 488
 											</select>
474 489
 										</span>
475 490
 										<ul id="boards_list_', $category['id'], '">';
491
+		}
476 492
 
477 493
 		foreach ($category['boards'] as $board)
478 494
 		{
479
-			if (empty($modSettings['deny_boards_access']))
480
-				echo '
495
+			if (empty($modSettings['deny_boards_access'])) {
496
+							echo '
481 497
 											<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
482 498
 												<input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label>
483 499
 											</li>';
484
-			else
485
-				echo '
500
+			} else {
501
+							echo '
486 502
 											<li class="board" style="width:100%">
487 503
 												<span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span>
488 504
 												<span style="width:50%;float:right">
@@ -491,6 +507,7 @@  discard block
 block discarded – undo
491 507
 													<input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label>
492 508
 												</span>
493 509
 											</li>';
510
+			}
494 511
 		}
495 512
 
496 513
 		echo '
@@ -501,14 +518,14 @@  discard block
 block discarded – undo
501 518
 	echo '
502 519
 								</ul>';
503 520
 
504
-	if (empty($modSettings['deny_boards_access']))
505
-		echo '
521
+	if (empty($modSettings['deny_boards_access'])) {
522
+			echo '
506 523
 								<br class="clear"><br>
507 524
 								<input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');">
508 525
 								<label for="checkall_check"><em>', $txt['check_all'], '</em></label>
509 526
 							</fieldset>';
510
-	else
511
-		echo '
527
+	} else {
528
+			echo '
512 529
 								<br class="clear">
513 530
 								<span class="select_all_box">
514 531
 									<em>', $txt['all'], ': </em>
@@ -524,15 +541,17 @@  discard block
 block discarded – undo
524 541
 									});
525 542
 								});
526 543
 							</script>';
544
+	}
527 545
 
528
-	if ($collapse)
529
-		echo '
546
+	if ($collapse) {
547
+			echo '
530 548
 							<a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a>
531 549
 							<script>
532 550
 								document.getElementById("visible_boards_link").style.display = "";
533 551
 								document.getElementById("visible_boards").style.display = "none";
534 552
 							</script>';
535
-}
553
+	}
554
+	}
536 555
 
537 556
 /**
538 557
  * Templatine for viewing the members of a group.
@@ -557,14 +576,15 @@  discard block
 block discarded – undo
557 576
 					</dd>';
558 577
 
559 578
 	// Any description to show?
560
-	if (!empty($context['group']['description']))
561
-		echo '
579
+	if (!empty($context['group']['description'])) {
580
+			echo '
562 581
 					<dt>
563 582
 						<strong>' . $txt['membergroups_members_description'] . ':</strong>
564 583
 					</dt>
565 584
 					<dd>
566 585
 						', $context['group']['description'], '
567 586
 					</dd>';
587
+	}
568 588
 
569 589
 	echo '
570 590
 					<dt>
@@ -578,8 +598,9 @@  discard block
 block discarded – undo
578 598
 	if (!empty($context['group']['moderators']))
579 599
 	{
580 600
 		$moderators = array();
581
-		foreach ($context['group']['moderators'] as $moderator)
582
-			$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
601
+		foreach ($context['group']['moderators'] as $moderator) {
602
+					$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
603
+		}
583 604
 
584 605
 		echo '
585 606
 					<dt>
@@ -604,9 +625,10 @@  discard block
 block discarded – undo
604 625
 					<tr class="title_bar">
605 626
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
606 627
 
607
-	if ($context['can_send_email'])
608
-		echo '
628
+	if ($context['can_send_email']) {
629
+			echo '
609 630
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
631
+	}
610 632
 
611 633
 	echo '
612 634
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
@@ -615,20 +637,22 @@  discard block
 block discarded – undo
615 637
 							<a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
616 638
 						</th>';
617 639
 
618
-	if (!empty($context['group']['assignable']))
619
-		echo '
640
+	if (!empty($context['group']['assignable'])) {
641
+			echo '
620 642
 						<th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>';
643
+	}
621 644
 
622 645
 	echo '
623 646
 					</tr>
624 647
 				</thead>
625 648
 				<tbody>';
626 649
 
627
-	if (empty($context['members']))
628
-		echo '
650
+	if (empty($context['members'])) {
651
+			echo '
629 652
 					<tr class="windowbg">
630 653
 						<td colspan="6">', $txt['membergroups_members_no_members'], '</td>
631 654
 					</tr>';
655
+	}
632 656
 
633 657
 	foreach ($context['members'] as $member)
634 658
 	{
@@ -636,20 +660,22 @@  discard block
 block discarded – undo
636 660
 					<tr class="windowbg">
637 661
 						<td>', $member['name'], '</td>';
638 662
 
639
-		if ($context['can_send_email'])
640
-			echo '
663
+		if ($context['can_send_email']) {
664
+					echo '
641 665
 						<td>
642 666
 								<a href="mailto:', $member['email'], '">', $member['email'], '</a>
643 667
 						</td>';
668
+		}
644 669
 
645 670
 		echo '
646 671
 						<td>', $member['last_online'], '</td>
647 672
 						<td>', $member['registered'], '</td>
648 673
 						<td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';
649 674
 
650
-		if (!empty($context['group']['assignable']))
651
-			echo '
675
+		if (!empty($context['group']['assignable'])) {
676
+					echo '
652 677
 						<td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>';
678
+		}
653 679
 
654 680
 		echo '
655 681
 					</tr>';
@@ -659,11 +685,12 @@  discard block
 block discarded – undo
659 685
 				</tbody>
660 686
 			</table>';
661 687
 
662
-	if (!empty($context['group']['assignable']))
663
-		echo '
688
+	if (!empty($context['group']['assignable'])) {
689
+			echo '
664 690
 			<div class="floatright">
665 691
 				<input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button ">
666 692
 			</div>';
693
+	}
667 694
 
668 695
 	echo '
669 696
 			<div class="pagesection flow_hidden">
@@ -671,8 +698,8 @@  discard block
 block discarded – undo
671 698
 			</div>
672 699
 			<br>';
673 700
 
674
-	if (!empty($context['group']['assignable']))
675
-		echo '
701
+	if (!empty($context['group']['assignable'])) {
702
+			echo '
676 703
 			<div class="cat_bar">
677 704
 				<h3 class="catbg">', $txt['membergroups_members_add_title'], '</h3>
678 705
 			</div>
@@ -688,6 +715,7 @@  discard block
 block discarded – undo
688 715
 				</dl>
689 716
 				<input type="submit" name="add" value="', $txt['membergroups_members_add'], '" class="button">
690 717
 			</div>';
718
+	}
691 719
 
692 720
 	echo '
693 721
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -695,8 +723,8 @@  discard block
 block discarded – undo
695 723
 		</form>
696 724
 	</div><!-- #admincenter -->';
697 725
 
698
-	if (!empty($context['group']['assignable']))
699
-		echo '
726
+	if (!empty($context['group']['assignable'])) {
727
+			echo '
700 728
 	<script>
701 729
 		var oAddMemberSuggest = new smc_AutoSuggest({
702 730
 			sSelf: \'oAddMemberSuggest\',
@@ -712,7 +740,8 @@  discard block
 block discarded – undo
712 740
 			sItemListContainerId: \'toAddItemContainer\'
713 741
 		});
714 742
 	</script>';
715
-}
743
+	}
744
+	}
716 745
 
717 746
 /**
718 747
  * Allow the moderator to enter a reason to each user being rejected.
@@ -732,8 +761,8 @@  discard block
 block discarded – undo
732 761
 				<dl class="settings">';
733 762
 
734 763
 	// Loop through and print out a reason box for each...
735
-	foreach ($context['group_requests'] as $request)
736
-		echo '
764
+	foreach ($context['group_requests'] as $request) {
765
+			echo '
737 766
 					<dt>
738 767
 						<strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong>
739 768
 					</dt>
@@ -741,6 +770,7 @@  discard block
 block discarded – undo
741 770
 						<input type="hidden" name="groupr[]" value="', $request['id'], '">
742 771
 						<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40"></textarea>
743 772
 					</dd>';
773
+	}
744 774
 
745 775
 	echo '
746 776
 				</dl>
Please login to merge, or discard this patch.
Themes/default/Display.template.php 1 patch
Braces   +236 added lines, -162 removed lines patch added patch discarded remove patch
@@ -18,18 +18,20 @@  discard block
 block discarded – undo
18 18
 	global $context, $settings, $options, $txt, $scripturl, $modSettings;
19 19
 
20 20
 	// Let them know, if their report was a success!
21
-	if ($context['report_sent'])
22
-		echo '
21
+	if ($context['report_sent']) {
22
+			echo '
23 23
 		<div class="infobox">
24 24
 			', $txt['report_sent'], '
25 25
 		</div>';
26
+	}
26 27
 
27 28
 	// Let them know why their message became unapproved.
28
-	if ($context['becomesUnapproved'])
29
-		echo '
29
+	if ($context['becomesUnapproved']) {
30
+			echo '
30 31
 		<div class="noticebox">
31 32
 			', $txt['post_becomesUnapproved'], '
32 33
 		</div>';
34
+	}
33 35
 
34 36
 	// Show new topic info here?
35 37
 	echo '
@@ -49,11 +51,13 @@  discard block
 block discarded – undo
49 51
 			<p>';
50 52
 
51 53
 		// Show just numbers...?
52
-		if ($settings['display_who_viewing'] == 1)
53
-			echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
54
+		if ($settings['display_who_viewing'] == 1) {
55
+					echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
56
+		}
54 57
 		// Or show the actual people viewing the topic?
55
-		else
56
-			echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
58
+		else {
59
+					echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
60
+		}
57 61
 
58 62
 		// Now show how many guests are here too.
59 63
 		echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
@@ -91,10 +95,11 @@  discard block
 block discarded – undo
91 95
 						<dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
92 96
 						<dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">';
93 97
 
94
-				if ($context['allow_results_view'])
95
-					echo '
98
+				if ($context['allow_results_view']) {
99
+									echo '
96 100
 							', $option['bar_ndt'], '
97 101
 							<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
102
+				}
98 103
 
99 104
 				echo '
100 105
 						</dd>';
@@ -103,9 +108,10 @@  discard block
 block discarded – undo
103 108
 			echo '
104 109
 					</dl>';
105 110
 
106
-			if ($context['allow_results_view'])
107
-				echo '
111
+			if ($context['allow_results_view']) {
112
+							echo '
108 113
 					<p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
114
+			}
109 115
 		}
110 116
 		// They are allowed to vote! Go to it!
111 117
 		else
@@ -114,17 +120,19 @@  discard block
 block discarded – undo
114 120
 					<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
115 121
 
116 122
 			// Show a warning if they are allowed more than one option.
117
-			if ($context['poll']['allowed_warning'])
118
-				echo '
123
+			if ($context['poll']['allowed_warning']) {
124
+							echo '
119 125
 						<p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
126
+			}
120 127
 
121 128
 			echo '
122 129
 						<ul class="options">';
123 130
 
124 131
 			// Show each option with its button - a radio likely.
125
-			foreach ($context['poll']['options'] as $option)
126
-				echo '
132
+			foreach ($context['poll']['options'] as $option) {
133
+							echo '
127 134
 							<li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
135
+			}
128 136
 
129 137
 			echo '
130 138
 						</ul>
@@ -136,9 +144,10 @@  discard block
 block discarded – undo
136 144
 		}
137 145
 
138 146
 		// Is the clock ticking?
139
-		if (!empty($context['poll']['expire_time']))
140
-			echo '
147
+		if (!empty($context['poll']['expire_time'])) {
148
+					echo '
141 149
 					<p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
150
+		}
142 151
 
143 152
 		echo '
144 153
 				</div><!-- #poll_options -->
@@ -168,11 +177,13 @@  discard block
 block discarded – undo
168 177
 				<li>
169 178
 					<strong class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></strong>';
170 179
 
171
-			if ($event['can_edit'])
172
-				echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
180
+			if ($event['can_edit']) {
181
+							echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
182
+			}
173 183
 
174
-			if ($event['can_export'])
175
-				echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
184
+			if ($event['can_export']) {
185
+							echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
186
+			}
176 187
 
177 188
 			echo '
178 189
 					<br>';
@@ -180,14 +191,14 @@  discard block
 block discarded – undo
180 191
 			if (!empty($event['allday']))
181 192
 			{
182 193
 				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>' : '';
183
-			}
184
-			else
194
+			} else
185 195
 			{
186 196
 				// Display event info relative to user's local timezone
187 197
 				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'] . '">';
188 198
 
189
-				if ($event['start_date_local'] != $event['end_date_local'])
190
-					echo trim($event['end_date_local']) . ', ';
199
+				if ($event['start_date_local'] != $event['end_date_local']) {
200
+									echo trim($event['end_date_local']) . ', ';
201
+				}
191 202
 
192 203
 				echo trim($event['end_time_local']);
193 204
 
@@ -196,24 +207,28 @@  discard block
 block discarded – undo
196 207
 				{
197 208
 					echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">';
198 209
 
199
-					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'])
200
-						echo trim($event['start_date_orig']), ', ';
210
+					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']) {
211
+											echo trim($event['start_date_orig']), ', ';
212
+					}
201 213
 
202 214
 					echo trim($event['start_time_orig']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
203 215
 
204
-					if ($event['start_date_orig'] != $event['end_date_orig'])
205
-						echo trim($event['end_date_orig']) . ', ';
216
+					if ($event['start_date_orig'] != $event['end_date_orig']) {
217
+											echo trim($event['end_date_orig']) . ', ';
218
+					}
206 219
 
207 220
 					echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)';
208 221
 				}
209 222
 				// Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion
210
-				else
211
-					echo ' ', $event['tz_abbrev'], '</time>';
223
+				else {
224
+									echo ' ', $event['tz_abbrev'], '</time>';
225
+				}
212 226
 			}
213 227
 
214
-			if (!empty($event['location']))
215
-				echo '
228
+			if (!empty($event['location'])) {
229
+							echo '
216 230
 					<br>', $event['location'];
231
+			}
217 232
 
218 233
 			echo '
219 234
 				</li>';
@@ -250,8 +265,9 @@  discard block
 block discarded – undo
250 265
 	$context['removableMessageIDs'] = array();
251 266
 
252 267
 	// Get all the messages...
253
-	while ($message = $context['get_message']())
254
-		template_single_post($message);
268
+	while ($message = $context['get_message']()) {
269
+			template_single_post($message);
270
+	}
255 271
 
256 272
 	echo '
257 273
 			</form>
@@ -289,8 +305,9 @@  discard block
 block discarded – undo
289 305
 		<div id="display_jump_to"></div>';
290 306
 
291 307
 	// Show quickreply
292
-	if ($context['can_reply'])
293
-		template_quickreply();
308
+	if ($context['can_reply']) {
309
+			template_quickreply();
310
+	}
294 311
 
295 312
 	// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
296 313
 	echo '
@@ -305,8 +322,8 @@  discard block
 block discarded – undo
305 322
 		</div>';
306 323
 
307 324
 	// Show the moderation button & pop only if user can moderate
308
-	if ($context['can_moderate_forum'] || $context['user']['is_mod'])
309
-		echo '
325
+	if ($context['can_moderate_forum'] || $context['user']['is_mod']) {
326
+			echo '
310 327
 		<div id="mobile_moderation" class="popup_container">
311 328
 			<div class="popup_window description">
312 329
 				<div class="popup_heading">
@@ -318,6 +335,7 @@  discard block
 block discarded – undo
318 335
 				</div>
319 336
 			</div>
320 337
 		</div>';
338
+	}
321 339
 
322 340
 	echo '
323 341
 		<script>';
@@ -441,9 +459,10 @@  discard block
 block discarded – undo
441 459
 				});
442 460
 			}';
443 461
 
444
-	if (!empty($context['ignoredMsgs']))
445
-		echo '
462
+	if (!empty($context['ignoredMsgs'])) {
463
+			echo '
446 464
 			ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
465
+	}
447 466
 
448 467
 	echo '
449 468
 		</script>';
@@ -460,8 +479,9 @@  discard block
 block discarded – undo
460 479
 
461 480
 	$ignoring = false;
462 481
 
463
-	if ($message['can_remove'])
464
-		$context['removableMessageIDs'][] = $message['id'];
482
+	if ($message['can_remove']) {
483
+			$context['removableMessageIDs'][] = $message['id'];
484
+	}
465 485
 
466 486
 	// Are we ignoring this message?
467 487
 	if (!empty($message['is_ignored']))
@@ -488,9 +508,10 @@  discard block
 block discarded – undo
488 508
 							<div class="custom_fields_above_member">
489 509
 								<ul class="nolist">';
490 510
 
491
-		foreach ($message['custom_fields']['above_member'] as $custom)
492
-			echo '
511
+		foreach ($message['custom_fields']['above_member'] as $custom) {
512
+					echo '
493 513
 									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
514
+		}
494 515
 
495 516
 		echo '
496 517
 								</ul>
@@ -501,25 +522,28 @@  discard block
 block discarded – undo
501 522
 							<h4>';
502 523
 
503 524
 	// Show online and offline buttons?
504
-	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
505
-		echo '
525
+	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
526
+			echo '
506 527
 								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : '';
528
+	}
507 529
 
508 530
 	// Custom fields BEFORE the username?
509
-	if (!empty($message['custom_fields']['before_member']))
510
-		foreach ($message['custom_fields']['before_member'] as $custom)
531
+	if (!empty($message['custom_fields']['before_member'])) {
532
+			foreach ($message['custom_fields']['before_member'] as $custom)
511 533
 			echo '
512 534
 								<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
535
+	}
513 536
 
514 537
 	// Show a link to the member's profile.
515 538
 	echo '
516 539
 								', $message['member']['link'];
517 540
 
518 541
 	// Custom fields AFTER the username?
519
-	if (!empty($message['custom_fields']['after_member']))
520
-		foreach ($message['custom_fields']['after_member'] as $custom)
542
+	if (!empty($message['custom_fields']['after_member'])) {
543
+			foreach ($message['custom_fields']['after_member'] as $custom)
521 544
 			echo '
522 545
 								<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
546
+	}
523 547
 
524 548
 	// Begin display of user info
525 549
 	echo '
@@ -527,51 +551,59 @@  discard block
 block discarded – undo
527 551
 							<ul class="user_info">';
528 552
 
529 553
 	// Show the user's avatar.
530
-	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
531
-		echo '
554
+	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
555
+			echo '
532 556
 								<li class="avatar">
533 557
 									<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>
534 558
 								</li>';
559
+	}
535 560
 
536 561
 	// Are there any custom fields below the avatar?
537
-	if (!empty($message['custom_fields']['below_avatar']))
538
-		foreach ($message['custom_fields']['below_avatar'] as $custom)
562
+	if (!empty($message['custom_fields']['below_avatar'])) {
563
+			foreach ($message['custom_fields']['below_avatar'] as $custom)
539 564
 			echo '
540 565
 								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
566
+	}
541 567
 
542 568
 	// Show the post group icons, but not for guests.
543
-	if (!$message['member']['is_guest'])
544
-		echo '
569
+	if (!$message['member']['is_guest']) {
570
+			echo '
545 571
 								<li class="icons">', $message['member']['group_icons'], '</li>';
572
+	}
546 573
 
547 574
 	// Show the member's primary group (like 'Administrator') if they have one.
548
-	if (!empty($message['member']['group']))
549
-		echo '
575
+	if (!empty($message['member']['group'])) {
576
+			echo '
550 577
 								<li class="membergroup">', $message['member']['group'], '</li>';
578
+	}
551 579
 
552 580
 	// Show the member's custom title, if they have one.
553
-	if (!empty($message['member']['title']))
554
-		echo '
581
+	if (!empty($message['member']['title'])) {
582
+			echo '
555 583
 								<li class="title">', $message['member']['title'], '</li>';
584
+	}
556 585
 
557 586
 	// Don't show these things for guests.
558 587
 	if (!$message['member']['is_guest'])
559 588
 	{
560 589
 
561 590
 		// 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.
562
-		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group']))
563
-			echo '
591
+		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) {
592
+					echo '
564 593
 								<li class="postgroup">', $message['member']['post_group'], '</li>';
594
+		}
565 595
 
566 596
 		// Show how many posts they have made.
567
-		if (!isset($context['disabled_fields']['posts']))
568
-			echo '
597
+		if (!isset($context['disabled_fields']['posts'])) {
598
+					echo '
569 599
 								<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
600
+		}
570 601
 
571 602
 		// Show their personal text?
572
-		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
573
-			echo '
603
+		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) {
604
+					echo '
574 605
 								<li class="blurb">', $message['member']['blurb'], '</li>';
606
+		}
575 607
 
576 608
 		// Any custom fields to show as icons?
577 609
 		if (!empty($message['custom_fields']['icons']))
@@ -580,9 +612,10 @@  discard block
 block discarded – undo
580 612
 								<li class="im_icons">
581 613
 									<ol>';
582 614
 
583
-			foreach ($message['custom_fields']['icons'] as $custom)
584
-				echo '
615
+			foreach ($message['custom_fields']['icons'] as $custom) {
616
+							echo '
585 617
 										<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
618
+			}
586 619
 
587 620
 			echo '
588 621
 									</ol>
@@ -597,19 +630,22 @@  discard block
 block discarded – undo
597 630
 									<ol class="profile_icons">';
598 631
 
599 632
 			// Don't show an icon if they haven't specified a website.
600
-			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website']))
601
-				echo '
633
+			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) {
634
+							echo '
602 635
 										<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>';
636
+			}
603 637
 
604 638
 			// Since we know this person isn't a guest, you *can* message them.
605
-			if ($context['can_send_pm'])
606
-				echo '
639
+			if ($context['can_send_pm']) {
640
+							echo '
607 641
 										<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>';
642
+			}
608 643
 
609 644
 			// Show the email if necessary
610
-			if (!empty($message['member']['email']) && $message['member']['show_email'])
611
-				echo '
645
+			if (!empty($message['member']['email']) && $message['member']['show_email']) {
646
+							echo '
612 647
 										<li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
648
+			}
613 649
 
614 650
 			echo '
615 651
 									</ol>
@@ -617,58 +653,66 @@  discard block
 block discarded – undo
617 653
 		}
618 654
 
619 655
 		// Any custom fields for standard placement?
620
-		if (!empty($message['custom_fields']['standard']))
621
-			foreach ($message['custom_fields']['standard'] as $custom)
656
+		if (!empty($message['custom_fields']['standard'])) {
657
+					foreach ($message['custom_fields']['standard'] as $custom)
622 658
 				echo '
623 659
 								<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
660
+		}
624 661
 
625 662
 	}
626 663
 	// Otherwise, show the guest's email.
627
-	elseif (!empty($message['member']['email']) && $message['member']['show_email'])
628
-		echo '
664
+	elseif (!empty($message['member']['email']) && $message['member']['show_email']) {
665
+			echo '
629 666
 								<li class="email">
630 667
 									<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>
631 668
 								</li>';
669
+	}
632 670
 
633 671
 	// Show the IP to this user for this post - because you can moderate?
634
-	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
635
-		echo '
672
+	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
673
+			echo '
636 674
 								<li class="poster_ip">
637 675
 									<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>
638 676
 								</li>';
677
+	}
639 678
 
640 679
 	// Or, should we show it because this is you?
641
-	elseif ($message['can_see_ip'])
642
-		echo '
680
+	elseif ($message['can_see_ip']) {
681
+			echo '
643 682
 								<li class="poster_ip">
644 683
 									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a>
645 684
 								</li>';
685
+	}
646 686
 
647 687
 	// Okay, are you at least logged in? Then we can show something about why IPs are logged...
648
-	elseif (!$context['user']['is_guest'])
649
-		echo '
688
+	elseif (!$context['user']['is_guest']) {
689
+			echo '
650 690
 								<li class="poster_ip">
651 691
 									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a>
652 692
 								</li>';
693
+	}
653 694
 
654 695
 	// Otherwise, you see NOTHING!
655
-	else
656
-		echo '
696
+	else {
697
+			echo '
657 698
 								<li class="poster_ip">', $txt['logged'], '</li>';
699
+	}
658 700
 
659 701
 	// Are we showing the warning status?
660 702
 	// Don't show these things for guests.
661
-	if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
662
-		echo '
703
+	if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) {
704
+			echo '
663 705
 								<li class="warning">
664 706
 									', $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>
665 707
 								</li>';
708
+	}
666 709
 
667 710
 	// Are there any custom fields to show at the bottom of the poster info?
668
-	if (!empty($message['custom_fields']['bottom_poster']))
669
-		foreach ($message['custom_fields']['bottom_poster'] as $custom)
711
+	if (!empty($message['custom_fields']['bottom_poster'])) {
712
+			foreach ($message['custom_fields']['bottom_poster'] as $custom)
670 713
 			echo '
671 714
 								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
715
+	}
672 716
 
673 717
 	// Poster info ends.
674 718
 	echo '
@@ -698,9 +742,10 @@  discard block
 block discarded – undo
698 742
 	echo '
699 743
 									<span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">';
700 744
 
701
-	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
702
-		echo
745
+	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) {
746
+			echo
703 747
 										$message['modified']['last_edit_text'];
748
+	}
704 749
 
705 750
 	echo '
706 751
 									</span>
@@ -709,22 +754,24 @@  discard block
 block discarded – undo
709 754
 							</div><!-- .keyinfo -->';
710 755
 
711 756
 	// Ignoring this user? Hide the post.
712
-	if ($ignoring)
713
-		echo '
757
+	if ($ignoring) {
758
+			echo '
714 759
 							<div id="msg_', $message['id'], '_ignored_prompt">
715 760
 								', $txt['ignoring_user'], '
716 761
 								<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
717 762
 							</div>';
763
+	}
718 764
 
719 765
 	// Show the post itself, finally!
720 766
 	echo '
721 767
 							<div class="post">';
722 768
 
723
-	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
724
-		echo '
769
+	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) {
770
+			echo '
725 771
 								<div class="approve_post">
726 772
 									', $txt['post_awaiting_approval'], '
727 773
 								</div>';
774
+	}
728 775
 	echo '
729 776
 								<div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>
730 777
 									', $message['body'], '
@@ -743,9 +790,9 @@  discard block
 block discarded – undo
743 790
 		foreach ($message['attachment'] as $attachment)
744 791
 		{
745 792
 			// Do we want this attachment to not be showed here?
746
-			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']]))
747
-				continue;
748
-			elseif (!$div_output)
793
+			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) {
794
+							continue;
795
+			} elseif (!$div_output)
749 796
 			{
750 797
 				$div_output = true;
751 798
 
@@ -762,9 +809,10 @@  discard block
 block discarded – undo
762 809
 									<legend>
763 810
 										', $txt['attach_awaiting_approve'];
764 811
 
765
-				if ($context['can_approve'])
766
-					echo '
812
+				if ($context['can_approve']) {
813
+									echo '
767 814
 										&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
815
+				}
768 816
 
769 817
 				echo '
770 818
 									</legend>';
@@ -778,12 +826,13 @@  discard block
 block discarded – undo
778 826
 				echo '
779 827
 										<div class="attachments_top">';
780 828
 
781
-				if ($attachment['thumbnail']['has_thumb'])
782
-					echo '
829
+				if ($attachment['thumbnail']['has_thumb']) {
830
+									echo '
783 831
 											<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>';
784
-				else
785
-					echo '
832
+				} else {
833
+									echo '
786 834
 											<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">';
835
+				}
787 836
 
788 837
 				echo '
789 838
 										</div><!-- .attachments_top -->';
@@ -793,9 +842,10 @@  discard block
 block discarded – undo
793 842
 										<div class="attachments_bot">
794 843
 											<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*">&nbsp;' . $attachment['name'] . '</a> ';
795 844
 
796
-			if (!$attachment['is_approved'] && $context['can_approve'])
797
-				echo '
845
+			if (!$attachment['is_approved'] && $context['can_approve']) {
846
+							echo '
798 847
 											[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
848
+			}
799 849
 			echo '
800 850
 											<br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '
801 851
 										</div><!-- .attachments_bot -->';
@@ -804,35 +854,40 @@  discard block
 block discarded – undo
804 854
 									</div><!-- .attached -->';
805 855
 
806 856
 			// Next attachment line ?
807
-			if (++$i % $attachments_per_line === 0)
808
-				echo '
857
+			if (++$i % $attachments_per_line === 0) {
858
+							echo '
809 859
 									<br>';
860
+			}
810 861
 		}
811 862
 
812 863
 		// If we had unapproved attachments clean up.
813
-		if ($last_approved_state == 0)
814
-			echo '
864
+		if ($last_approved_state == 0) {
865
+					echo '
815 866
 								</fieldset>';
867
+		}
816 868
 
817 869
 		// Only do this if we output a div above - otherwise it'll break things
818
-		if ($div_output)
819
-			echo '
870
+		if ($div_output) {
871
+					echo '
820 872
 							</div><!-- #msg_[id]_footer -->';
873
+		}
821 874
 	}
822 875
 
823 876
 	// And stuff below the attachments.
824
-	if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
825
-		echo '
877
+	if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
878
+			echo '
826 879
 							<div class="under_message">';
880
+	}
827 881
 
828 882
 	// Maybe they want to report this post to the moderator(s)?
829
-	if ($context['can_report_moderator'])
830
-		echo '
883
+	if ($context['can_report_moderator']) {
884
+			echo '
831 885
 								<ul class="floatright smalltext">
832 886
 									<li class="report_link">
833 887
 										<a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a>
834 888
 									</li>
835 889
 								</ul>';
890
+	}
836 891
 
837 892
 	// What about likes?
838 893
 	if (!empty($modSettings['enable_likes']))
@@ -879,83 +934,95 @@  discard block
 block discarded – undo
879 934
 								<ul class="quickbuttons">';
880 935
 
881 936
 		// Can they quote? if so they can select and quote as well!
882
-		if ($context['can_quote'])
883
-			echo '
937
+		if ($context['can_quote']) {
938
+					echo '
884 939
 									<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>
885 940
 									<li style="display:none;" id="quoteSelected_', $message['id'], '">
886 941
 										<a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a>
887 942
 									</li>';
943
+		}
888 944
 
889 945
 		// Can the user modify the contents of this post? Show the modify inline image.
890
-		if ($message['can_modify'])
891
-			echo '
946
+		if ($message['can_modify']) {
947
+					echo '
892 948
 									<li class="quick_edit">
893 949
 										<a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a>
894 950
 									</li>';
951
+		}
895 952
 
896
-		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
897
-			echo '
953
+		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
954
+					echo '
898 955
 									<li class="post_options">', $txt['post_options'];
956
+		}
899 957
 
900 958
 		echo '
901 959
 										<ul>';
902 960
 
903 961
 		// Can the user modify the contents of this post?
904
-		if ($message['can_modify'])
905
-			echo '
962
+		if ($message['can_modify']) {
963
+					echo '
906 964
 											<li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>';
965
+		}
907 966
 
908 967
 		// How about... even... remove it entirely?!
909
-		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id']))
910
-			echo '
968
+		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) {
969
+					echo '
911 970
 											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'], '</a></li>';
912
-
913
-		elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id']))
914
-			echo '
971
+		} elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) {
972
+					echo '
915 973
 											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
974
+		}
916 975
 
917 976
 		// What about splitting it off the rest of the topic?
918
-		if ($context['can_split'] && !empty($context['real_num_replies']))
919
-			echo '
977
+		if ($context['can_split'] && !empty($context['real_num_replies'])) {
978
+					echo '
920 979
 											<li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>';
980
+		}
921 981
 
922 982
 		// Can we issue a warning because of this post? Remember, we can't give guests warnings.
923
-		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
924
-			echo '
983
+		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) {
984
+					echo '
925 985
 											<li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>';
986
+		}
926 987
 
927 988
 		// Can we restore topics?
928
-		if ($context['can_restore_msg'])
929
-			echo '
989
+		if ($context['can_restore_msg']) {
990
+					echo '
930 991
 											<li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>';
992
+		}
931 993
 
932 994
 		// Maybe we can approve it, maybe we should?
933
-		if ($message['can_approve'])
934
-			echo '
995
+		if ($message['can_approve']) {
996
+					echo '
935 997
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>';
998
+		}
936 999
 
937 1000
 		// Maybe we can unapprove it?
938
-		if ($message['can_unapprove'])
939
-			echo '
1001
+		if ($message['can_unapprove']) {
1002
+					echo '
940 1003
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>';
1004
+		}
941 1005
 
942 1006
 		echo '
943 1007
 										</ul>
944 1008
 									</li>';
945 1009
 
946 1010
 		// Show a checkbox for quick moderation?
947
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
948
-			echo '
1011
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
1012
+					echo '
949 1013
 									<li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
1014
+		}
950 1015
 
951
-		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
952
-			echo '
1016
+		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
1017
+					echo '
953 1018
 								</ul><!-- .quickbuttons -->';
1019
+		}
954 1020
 	}
955 1021
 
956
-	if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
957
-		echo '
1022
+	if ($context['can_report_moderator'] || !empty($modSettings['enable_likes']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
1023
+			echo '
958 1024
 							</div><!-- .under_message -->';
1025
+	}
959 1026
 
960 1027
 	echo '
961 1028
 						</div><!-- .postarea -->
@@ -968,9 +1035,10 @@  discard block
 block discarded – undo
968 1035
 							<div class="custom_fields_above_signature">
969 1036
 								<ul class="nolist">';
970 1037
 
971
-		foreach ($message['custom_fields']['above_signature'] as $custom)
972
-			echo '
1038
+		foreach ($message['custom_fields']['above_signature'] as $custom) {
1039
+					echo '
973 1040
 									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
1041
+		}
974 1042
 
975 1043
 		echo '
976 1044
 								</ul>
@@ -978,11 +1046,12 @@  discard block
 block discarded – undo
978 1046
 	}
979 1047
 
980 1048
 	// Show the member's signature?
981
-	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
982
-		echo '
1049
+	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
1050
+			echo '
983 1051
 							<div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>
984 1052
 								', $message['member']['signature'], '
985 1053
 							</div>';
1054
+	}
986 1055
 
987 1056
 
988 1057
 	// Are there any custom profile fields for below the signature?
@@ -992,9 +1061,10 @@  discard block
 block discarded – undo
992 1061
 							<div class="custom_fields_below_signature">
993 1062
 								<ul class="nolist">';
994 1063
 
995
-		foreach ($message['custom_fields']['below_signature'] as $custom)
996
-			echo '
1064
+		foreach ($message['custom_fields']['below_signature'] as $custom) {
1065
+					echo '
997 1066
 									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
1067
+		}
998 1068
 
999 1069
 		echo '
1000 1070
 								</ul>
@@ -1044,8 +1114,8 @@  discard block
 block discarded – undo
1044 1114
 						<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">';
1045 1115
 
1046 1116
 	// Guests just need more.
1047
-	if ($context['user']['is_guest'])
1048
-		echo '
1117
+	if ($context['user']['is_guest']) {
1118
+			echo '
1049 1119
 						<dl id="post_header">
1050 1120
 							<dt>
1051 1121
 								', $txt['name'], ':
@@ -1060,6 +1130,7 @@  discard block
 block discarded – undo
1060 1130
 								<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" required>
1061 1131
 							</dd>
1062 1132
 						</dl>';
1133
+	}
1063 1134
 
1064 1135
 	echo '
1065 1136
 						', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
@@ -1084,12 +1155,13 @@  discard block
 block discarded – undo
1084 1155
 						</script>';
1085 1156
 
1086 1157
 	// Is visual verification enabled?
1087
-	if ($context['require_verification'])
1088
-		echo '
1158
+	if ($context['require_verification']) {
1159
+			echo '
1089 1160
 						<div class="post_verification">
1090 1161
 							<strong>', $txt['verification'], ':</strong>
1091 1162
 							', template_control_verification($context['visual_verification_id'], 'all'), '
1092 1163
 						</div>';
1164
+	}
1093 1165
 
1094 1166
 	// Finally, the submit buttons.
1095 1167
 	echo '
@@ -1105,8 +1177,8 @@  discard block
 block discarded – undo
1105 1177
 		<br class="clear">';
1106 1178
 
1107 1179
 	// Draft autosave available and the user has it enabled?
1108
-	if (!empty($context['drafts_autosave']))
1109
-		echo '
1180
+	if (!empty($context['drafts_autosave'])) {
1181
+			echo '
1110 1182
 		<script>
1111 1183
 			var oDraftAutoSave = new smf_DraftAutoSave({
1112 1184
 				sSelf: \'oDraftAutoSave\',
@@ -1118,12 +1190,14 @@  discard block
 block discarded – undo
1118 1190
 				iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
1119 1191
 			});
1120 1192
 		</script>';
1193
+	}
1121 1194
 
1122
-	if ($context['show_spellchecking'])
1123
-		echo '
1195
+	if ($context['show_spellchecking']) {
1196
+			echo '
1124 1197
 		<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow">
1125 1198
 			<input type="hidden" name="spellstring" value="">
1126 1199
 		</form>';
1200
+	}
1127 1201
 
1128 1202
 	echo '
1129 1203
 		<script>
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.