Completed
Push — release-2.1 ( 12381f...8d796c )
by Michael
07:22
created
Themes/default/Post.template.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -416,8 +416,8 @@  discard block
 block discarded – undo
416 416
 									</div>
417 417
 									<div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
418 418
 									<div class="attach-ui">
419
-										<a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a>
420
-										<a class="button upload">', $txt['upload'] ,'</a>
419
+										<a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a>
420
+										<a class="button upload">', $txt['upload'], '</a>
421 421
 									</div>
422 422
 								</div>
423 423
 							</div>
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
 							</dt>
436 436
 							<dd class="smalltext fallback">
437 437
 								<div id="attachUpload" class="descbox">
438
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
439
-									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
440
-									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
441
-									<a class="button fileinput-button">', $txt['attach_add'] ,'</a>
438
+									<h5>', $txt['attach_drop_zone'], '</h5>
439
+									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
440
+									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
441
+									<a class="button fileinput-button">', $txt['attach_add'], '</a>
442 442
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
443 443
 									<div class="fallback">
444 444
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	// Option to delete an event if user is editing one.
546 546
 	if ($context['make_event'] && !$context['event']['new'])
547 547
 		echo '
548
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
548
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">';
549 549
 
550 550
 	echo '
551 551
 					</span>
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 			});';
800 800
 
801 801
 	echo '
802
-			var oEditorID = "', $context['post_box_name'] ,'";
802
+			var oEditorID = "', $context['post_box_name'], '";
803 803
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
804 804
 		</script>';
805 805
 
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 			{
832 832
 				echo '
833 833
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
834
-						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
834
+						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>
835 835
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
836 836
 					</ul>';
837 837
 			}
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 	<head>
919 919
 		<meta charset="', $context['character_set'], '">
920 920
 		<title>', $txt['spell_check'], '</title>
921
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
921
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
922 922
 		<style>
923 923
 			body, td
924 924
 			{
@@ -951,8 +951,8 @@  discard block
 block discarded – undo
951 951
 			var spell_formname = window.opener.spell_formname;
952 952
 			var spell_fieldname = window.opener.spell_fieldname;
953 953
 		</script>
954
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
955
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
954
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
955
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
956 956
 		<script>
957 957
 			', $context['spell_js'], '
958 958
 		</script>
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 	<head>
995 995
 		<meta charset="', $context['character_set'], '">
996 996
 		<title>', $txt['retrieving_quote'], '</title>
997
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
997
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
998 998
 	</head>
999 999
 	<body>
1000 1000
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Braces   +89 added lines, -61 removed lines patch added patch discarded remove patch
@@ -22,22 +22,24 @@  discard block
 block discarded – undo
22 22
 		<script>';
23 23
 
24 24
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
25
-	if (isBrowser('is_firefox'))
26
-		echo '
25
+	if (isBrowser('is_firefox')) {
26
+			echo '
27 27
 			window.addEventListener("pageshow", reActivate, false);';
28
+	}
28 29
 
29 30
 	// Start with message icons - and any missing from this theme.
30 31
 	echo '
31 32
 			var icon_urls = {';
32
-	foreach ($context['icons'] as $icon)
33
-		echo '
33
+	foreach ($context['icons'] as $icon) {
34
+			echo '
34 35
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
36
+	}
35 37
 	echo '
36 38
 			};';
37 39
 
38 40
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
39
-	if ($context['make_poll'])
40
-		echo '
41
+	if ($context['make_poll']) {
42
+			echo '
41 43
 			var pollOptionNum = 0, pollTabIndex;
42 44
 			var pollOptionId = ', $context['last_choice_id'], ';
43 45
 			function addPollOption()
@@ -56,11 +58,13 @@  discard block
 block discarded – undo
56 58
 
57 59
 				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), ');
58 60
 			}';
61
+	}
59 62
 
60 63
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
61
-	if ($context['make_event'])
62
-		echo '
64
+	if ($context['make_event']) {
65
+			echo '
63 66
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
67
+	}
64 68
 
65 69
 	// End of the javascript, start the form and display the link tree.
66 70
 	echo '
@@ -80,9 +84,10 @@  discard block
 block discarded – undo
80 84
 				</div>
81 85
 			</div><br>';
82 86
 
83
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
84
-		echo '
87
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
88
+			echo '
85 89
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
90
+	}
86 91
 
87 92
 	// Start the main table.
88 93
 	echo '
@@ -117,18 +122,20 @@  discard block
 block discarded – undo
117 122
 	}
118 123
 
119 124
 	// If it's locked, show a message to warn the replier.
120
-	if (!empty($context['locked']))
121
-	echo '
125
+	if (!empty($context['locked'])) {
126
+		echo '
122 127
 					<div class="errorbox">
123 128
 						', $txt['topic_locked_no_reply'], '
124 129
 					</div>';
130
+	}
125 131
 
126
-	if (!empty($modSettings['drafts_post_enabled']))
127
-		echo '
132
+	if (!empty($modSettings['drafts_post_enabled'])) {
133
+			echo '
128 134
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
129 135
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
130 136
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
131 137
 					</div>';
138
+	}
132 139
 
133 140
 	// The post header... important stuff
134 141
 	echo '
@@ -180,9 +187,10 @@  discard block
 block discarded – undo
180 187
 				{
181 188
 					echo '
182 189
 										<optgroup label="', $category['name'], '">';
183
-					foreach ($category['boards'] as $board)
184
-						echo '
190
+					foreach ($category['boards'] as $board) {
191
+											echo '
185 192
 											<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
193
+					}
186 194
 					echo '
187 195
 										</optgroup>';
188 196
 				}
@@ -218,9 +226,10 @@  discard block
 block discarded – undo
218 226
 									<span class="label">', $txt['calendar_timezone'], '</span>
219 227
 									<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
220 228
 
221
-			foreach ($context['all_timezones'] as $tz => $tzname)
222
-				echo '
229
+			foreach ($context['all_timezones'] as $tz => $tzname) {
230
+							echo '
223 231
 										<option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
232
+			}
224 233
 
225 234
 			echo '
226 235
 									</select>
@@ -286,14 +295,15 @@  discard block
 block discarded – undo
286 295
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
287 296
 								</dd>';
288 297
 
289
-		if ($context['poll_options']['guest_vote_enabled'])
290
-			echo '
298
+		if ($context['poll_options']['guest_vote_enabled']) {
299
+					echo '
291 300
 								<dt>
292 301
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
293 302
 								</dt>
294 303
 								<dd>
295 304
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '>
296 305
 								</dd>';
306
+		}
297 307
 
298 308
 		echo '
299 309
 								<dt>
@@ -314,8 +324,8 @@  discard block
 block discarded – undo
314 324
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
315 325
 
316 326
 	// If we're editing and displaying edit details, show a box where they can say why
317
-	if (isset($context['editing']) && $modSettings['show_modify'])
318
-		echo '
327
+	if (isset($context['editing']) && $modSettings['show_modify']) {
328
+			echo '
319 329
 					<dl>
320 330
 						<dt class="clear">
321 331
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -324,20 +334,23 @@  discard block
 block discarded – undo
324 334
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80">
325 335
 						</dd>
326 336
 					</dl>';
337
+	}
327 338
 
328 339
 	// If this message has been edited in the past - display when it was.
329
-	if (isset($context['last_modified']))
330
-		echo '
340
+	if (isset($context['last_modified'])) {
341
+			echo '
331 342
 					<div class="padding smalltext">
332 343
 						', $context['last_modified_text'], '
333 344
 					</div>';
345
+	}
334 346
 
335 347
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
336
-	if (!empty($modSettings['additional_options_collapsable']))
337
-		echo '
348
+	if (!empty($modSettings['additional_options_collapsable'])) {
349
+			echo '
338 350
 					<div id="postAdditionalOptionsHeader">
339 351
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
340 352
 					</div>';
353
+	}
341 354
 
342 355
 	echo '
343 356
 					<div id="postAdditionalOptions">';
@@ -369,19 +382,21 @@  discard block
 block discarded – undo
369 382
 								<input type="hidden" name="attach_del[]" value="0">
370 383
 								', $txt['uncheck_unwatchd_attach'], ':
371 384
 							</dd>';
372
-		foreach ($context['current_attachments'] as $attachment)
373
-			echo '
385
+		foreach ($context['current_attachments'] as $attachment) {
386
+					echo '
374 387
 							<dd class="smalltext">
375 388
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
376 389
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label>
377 390
 							</dd>';
391
+		}
378 392
 
379 393
 		echo '
380 394
 						</dl>';
381 395
 
382
-		if (!empty($context['files_in_session_warning']))
383
-			echo '
396
+		if (!empty($context['files_in_session_warning'])) {
397
+					echo '
384 398
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
399
+		}
385 400
 	}
386 401
 
387 402
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -445,8 +460,8 @@  discard block
 block discarded – undo
445 460
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">');
446 461
 
447 462
 		// Show more boxes if they aren't approaching that limit.
448
-		if ($context['num_allowed_attachments'] > 1)
449
-			echo '
463
+		if ($context['num_allowed_attachments'] > 1) {
464
+					echo '
450 465
 										<script>
451 466
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
452 467
 											var current_attachment = 1;
@@ -467,9 +482,10 @@  discard block
 block discarded – undo
467 482
 									</div>
468 483
 								</div>
469 484
 							</dd>';
470
-		else
471
-			echo '
485
+		} else {
486
+					echo '
472 487
 							</dd>';
488
+		}
473 489
 
474 490
 		// Add any template changes for an alternative upload system here.
475 491
 		call_integration_hook('integrate_upload_template');
@@ -478,21 +494,25 @@  discard block
 block discarded – undo
478 494
 							<dd class="smalltext">';
479 495
 
480 496
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
481
-		if (!empty($modSettings['attachmentCheckExtensions']))
482
-			echo '
497
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
498
+					echo '
483 499
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
500
+		}
484 501
 
485
-		if (!empty($context['attachment_restrictions']))
486
-			echo '
502
+		if (!empty($context['attachment_restrictions'])) {
503
+					echo '
487 504
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
505
+		}
488 506
 
489
-		if ($context['num_allowed_attachments'] == 0)
490
-			echo '
507
+		if ($context['num_allowed_attachments'] == 0) {
508
+					echo '
491 509
 								', $txt['attach_limit_nag'], '<br>';
510
+		}
492 511
 
493
-		if (!$context['can_post_attachment_unapproved'])
494
-			echo '
512
+		if (!$context['can_post_attachment_unapproved']) {
513
+					echo '
495 514
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
515
+		}
496 516
 
497 517
 		echo '
498 518
 							</dd>
@@ -515,10 +535,11 @@  discard block
 block discarded – undo
515 535
 							<dt><strong>', $txt['subject'], '</strong></dt>
516 536
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
517 537
 
518
-		foreach ($context['drafts'] as $draft)
519
-			echo '
538
+		foreach ($context['drafts'] as $draft) {
539
+					echo '
520 540
 							<dt>', $draft['link'], '</dt>
521 541
 							<dd>', $draft['poster_time'], '</dd>';
542
+		}
522 543
 		echo '
523 544
 						</dl>
524 545
 					</div>';
@@ -543,9 +564,10 @@  discard block
 block discarded – undo
543 564
 						', template_control_richedit_buttons($context['post_box_name']);
544 565
 
545 566
 	// Option to delete an event if user is editing one.
546
-	if ($context['make_event'] && !$context['event']['new'])
547
-		echo '
567
+	if ($context['make_event'] && !$context['event']['new']) {
568
+			echo '
548 569
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
570
+	}
549 571
 
550 572
 	echo '
551 573
 					</span>
@@ -554,9 +576,10 @@  discard block
 block discarded – undo
554 576
 			<br class="clear">';
555 577
 
556 578
 	// Assuming this isn't a new topic pass across the last message id.
557
-	if (isset($context['topic_last_message']))
558
-		echo '
579
+	if (isset($context['topic_last_message'])) {
580
+			echo '
559 581
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
582
+	}
560 583
 
561 584
 	echo '
562 585
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -698,9 +721,10 @@  discard block
 block discarded – undo
698 721
 
699 722
 						newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \'&nbsp;&#187;</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';';
700 723
 
701
-	if ($context['can_quote'])
702
-		echo '
724
+	if ($context['can_quote']) {
725
+			echo '
703 726
 						newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';';
727
+	}
704 728
 
705 729
 	echo '
706 730
 						newPostsHTML += \'<br class="clear">\';
@@ -743,8 +767,8 @@  discard block
 block discarded – undo
743 767
 			}';
744 768
 
745 769
 	// Code for showing and hiding additional options.
746
-	if (!empty($modSettings['additional_options_collapsable']))
747
-		echo '
770
+	if (!empty($modSettings['additional_options_collapsable'])) {
771
+			echo '
748 772
 			var oSwapAdditionalOptions = new smc_Toggle({
749 773
 				bToggleEnabled: true,
750 774
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -772,10 +796,11 @@  discard block
 block discarded – undo
772 796
 					}
773 797
 				]
774 798
 			});';
799
+	}
775 800
 
776 801
 	// Code for showing and hiding drafts
777
-	if (!empty($context['drafts']))
778
-		echo '
802
+	if (!empty($context['drafts'])) {
803
+			echo '
779 804
 			var oSwapDraftOptions = new smc_Toggle({
780 805
 				bToggleEnabled: true,
781 806
 				bCurrentlyCollapsed: true,
@@ -797,6 +822,7 @@  discard block
 block discarded – undo
797 822
 					}
798 823
 				]
799 824
 			});';
825
+	}
800 826
 
801 827
 	echo '
802 828
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -817,8 +843,9 @@  discard block
 block discarded – undo
817 843
 		foreach ($context['previous_posts'] as $post)
818 844
 		{
819 845
 			$ignoring = false;
820
-			if (!empty($post['is_ignored']))
821
-				$ignored_posts[] = $ignoring = $post['id'];
846
+			if (!empty($post['is_ignored'])) {
847
+							$ignored_posts[] = $ignoring = $post['id'];
848
+			}
822 849
 
823 850
 			echo '
824 851
 			<div class="windowbg">
@@ -1001,10 +1028,10 @@  discard block
 block discarded – undo
1001 1028
 		<div id="temporary_posting_area" style="display: none;"></div>
1002 1029
 		<script>';
1003 1030
 
1004
-	if ($context['close_window'])
1005
-		echo '
1031
+	if ($context['close_window']) {
1032
+			echo '
1006 1033
 			window.close();';
1007
-	else
1034
+	} else
1008 1035
 	{
1009 1036
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;).
1010 1037
 		echo '
@@ -1058,11 +1085,12 @@  discard block
 block discarded – undo
1058 1085
 				</p>
1059 1086
 				<ul>';
1060 1087
 
1061
-	foreach ($context['groups'] as $group)
1062
-		echo '
1088
+	foreach ($context['groups'] as $group) {
1089
+			echo '
1063 1090
 					<li>
1064 1091
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1065 1092
 					</li>';
1093
+	}
1066 1094
 
1067 1095
 	echo '
1068 1096
 					<li>
Please login to merge, or discard this patch.
Themes/default/ManageMembergroups.template.php 1 patch
Braces   +92 added lines, -65 removed lines patch added patch discarded remove patch
@@ -52,9 +52,10 @@  discard block
 block discarded – undo
52 52
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
53 53
 							<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>';
54 54
 
55
-		if ($context['allow_protected'])
56
-			echo '
55
+		if ($context['allow_protected']) {
56
+					echo '
57 57
 							<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>';
58
+		}
58 59
 
59 60
 		echo '
60 61
 							<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>
@@ -64,14 +65,15 @@  discard block
 block discarded – undo
64 65
 					</dd>';
65 66
 	}
66 67
 
67
-	if ($context['post_group'] || $context['undefined_group'])
68
-		echo '
68
+	if ($context['post_group'] || $context['undefined_group']) {
69
+			echo '
69 70
 					<dt id="min_posts_text">
70 71
 						<strong>', $txt['membergroups_min_posts'], ':</strong>
71 72
 					</dt>
72 73
 					<dd>
73 74
 						<input type="number" name="min_posts" id="min_posts_input" size="5">
74 75
 					</dd>';
76
+	}
75 77
 	if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups']))
76 78
 	{
77 79
 		echo '
@@ -87,9 +89,10 @@  discard block
 block discarded – undo
87 89
 							<select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;">
88 90
 								<option value="-1">', $txt['membergroups_guests'], '</option>
89 91
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
90
-		foreach ($context['groups'] as $group)
91
-			echo '
92
+		foreach ($context['groups'] as $group) {
93
+					echo '
92 94
 								<option value="', $group['id'], '">', $group['name'], '</option>';
95
+		}
93 96
 		echo '
94 97
 							</select>
95 98
 							<br>
@@ -98,9 +101,10 @@  discard block
 block discarded – undo
98 101
 							<select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;">
99 102
 								<option value="-1">', $txt['membergroups_guests'], '</option>
100 103
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
101
-		foreach ($context['groups'] as $group)
102
-			echo '
104
+		foreach ($context['groups'] as $group) {
105
+					echo '
103 106
 								<option value="', $group['id'], '">', $group['name'], '</option>';
107
+		}
104 108
 		echo '
105 109
 							</select>
106 110
 							<br>
@@ -173,8 +177,8 @@  discard block
 block discarded – undo
173 177
 						<input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30">
174 178
 					</dd>';
175 179
 
176
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
177
-		echo '
180
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
181
+			echo '
178 182
 
179 183
 					<dt id="group_desc_text">
180 184
 						<label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label>
@@ -182,6 +186,7 @@  discard block
 block discarded – undo
182 186
 					<dd>
183 187
 						<textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea>
184 188
 					</dd>';
189
+	}
185 190
 
186 191
 	// Group type...
187 192
 	if ($context['group']['allow_post_group'])
@@ -195,9 +200,10 @@  discard block
 block discarded – undo
195 200
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
196 201
 							<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>';
197 202
 
198
-		if ($context['group']['allow_protected'])
199
-			echo '
203
+		if ($context['group']['allow_protected']) {
204
+					echo '
200 205
 							<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>';
206
+		}
201 207
 
202 208
 		echo '
203 209
 							<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>
@@ -207,8 +213,8 @@  discard block
 block discarded – undo
207 213
 					</dd>';
208 214
 	}
209 215
 
210
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
211
-		echo '
216
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
217
+			echo '
212 218
 					<dt id="group_moderators_text">
213 219
 						<label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label>
214 220
 					</dt>
@@ -226,6 +232,7 @@  discard block
 block discarded – undo
226 232
 							<option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option>
227 233
 						</select>
228 234
 					</dd>';
235
+	}
229 236
 
230 237
 	// Can they inherit permissions?
231 238
 	if ($context['group']['id'] > 1 && $context['group']['id'] != 3)
@@ -242,9 +249,10 @@  discard block
 block discarded – undo
242 249
 							<option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>';
243 250
 
244 251
 		// For all the inheritable groups show an option.
245
-		foreach ($context['inheritable_groups'] as $id => $group)
246
-			echo '
252
+		foreach ($context['inheritable_groups'] as $id => $group) {
253
+					echo '
247 254
 							<option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>';
255
+		}
248 256
 
249 257
 		echo '
250 258
 						</select>
@@ -252,8 +260,8 @@  discard block
 block discarded – undo
252 260
 					</dd>';
253 261
 	}
254 262
 
255
-	if ($context['group']['allow_post_group'])
256
-		echo '
263
+	if ($context['group']['allow_post_group']) {
264
+			echo '
257 265
 
258 266
 					<dt id="min_posts_text">
259 267
 						<label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label>
@@ -261,6 +269,7 @@  discard block
 block discarded – undo
261 269
 					<dd>
262 270
 						<input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6">
263 271
 					</dd>';
272
+	}
264 273
 	echo '
265 274
 					<dt>
266 275
 						<label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label>
@@ -302,9 +311,10 @@  discard block
 block discarded – undo
302 311
 	}
303 312
 
304 313
 	// No? Hide the entire control.
305
-	else
306
-		echo '
314
+	else {
315
+			echo '
307 316
 					<input type="hidden" name="icon_image" value="">';
317
+	}
308 318
 
309 319
 	echo '
310 320
 					<dt>
@@ -315,8 +325,8 @@  discard block
 block discarded – undo
315 325
 						<input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled' : '', '>
316 326
 					</dd>';
317 327
 	//Force 2FA for this membergroup?
318
-	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2)
319
-	echo '
328
+	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) {
329
+		echo '
320 330
 					<dt>
321 331
 						<label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br>
322 332
 						<span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span>
@@ -324,6 +334,7 @@  discard block
 block discarded – undo
324 334
 					<dd>
325 335
 						<input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '>
326 336
 					</dd>';
337
+	}
327 338
 
328 339
 	if (!empty($context['categories']))
329 340
 	{
@@ -333,10 +344,11 @@  discard block
 block discarded – undo
333 344
 						<span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', '
334 345
 					</dt>
335 346
 					<dd>';
336
-		if (!empty($context['can_manage_boards']))
337
-			echo $txt['membergroups_can_manage_access'];
338
-		else
339
-			template_add_edit_group_boards_list();
347
+		if (!empty($context['can_manage_boards'])) {
348
+					echo $txt['membergroups_can_manage_access'];
349
+		} else {
350
+					template_add_edit_group_boards_list();
351
+		}
340 352
 
341 353
 		echo '
342 354
 					</dd>';
@@ -365,20 +377,21 @@  discard block
 block discarded – undo
365 377
 				sItemListContainerId: \'moderator_container\',
366 378
 				aListItems: [';
367 379
 
368
-			foreach ($context['group']['moderators'] as $id_member => $member_name)
369
-				echo '
380
+			foreach ($context['group']['moderators'] as $id_member => $member_name) {
381
+							echo '
370 382
 							{
371 383
 								sItemId: ', JavaScriptEscape($id_member), ',
372 384
 								sItemName: ', JavaScriptEscape($member_name), '
373 385
 							}', $id_member == $context['group']['last_moderator_id'] ? '' : ',';
386
+			}
374 387
 
375 388
 			echo '
376 389
 				]
377 390
 			});
378 391
 		</script>';
379 392
 
380
-	if ($context['group']['allow_post_group'])
381
-		echo '
393
+	if ($context['group']['allow_post_group']) {
394
+			echo '
382 395
 		<script>
383 396
 			function swapPostGroup(isChecked)
384 397
 			{
@@ -426,7 +439,8 @@  discard block
 block discarded – undo
426 439
 
427 440
 			swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', ');
428 441
 		</script>';
429
-}
442
+	}
443
+	}
430 444
 
431 445
 /**
432 446
  * The template for determining which boards a group has access to.
@@ -443,13 +457,13 @@  discard block
 block discarded – undo
443 457
 
444 458
 	foreach ($context['categories'] as $category)
445 459
 	{
446
-		if (empty($modSettings['deny_boards_access']))
447
-			echo '
460
+		if (empty($modSettings['deny_boards_access'])) {
461
+					echo '
448 462
 									<li class="category">
449 463
 										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a>
450 464
 									<ul style="width:100%">';
451
-		else
452
-			echo '
465
+		} else {
466
+					echo '
453 467
 									<li class="category">
454 468
 										<strong>', $category['name'], '</strong>
455 469
 										<span class="select_all_box">
@@ -462,16 +476,17 @@  discard block
 block discarded – undo
462 476
 											</select>
463 477
 										</span>
464 478
 										<ul style="width:100%" id="boards_list_', $category['id'], '">';
479
+		}
465 480
 
466 481
 		foreach ($category['boards'] as $board)
467 482
 		{
468
-			if (empty($modSettings['deny_boards_access']))
469
-				echo '
483
+			if (empty($modSettings['deny_boards_access'])) {
484
+							echo '
470 485
 										<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
471 486
 											<input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label>
472 487
 										</li>';
473
-			else
474
-				echo '
488
+			} else {
489
+							echo '
475 490
 											<li class="board" style="width:100%">
476 491
 												<span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span>
477 492
 												<span style="width:50%;float:right">
@@ -480,6 +495,7 @@  discard block
 block discarded – undo
480 495
 													<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>
481 496
 												</span>
482 497
 											</li>';
498
+			}
483 499
 		}
484 500
 
485 501
 		echo '
@@ -490,13 +506,13 @@  discard block
 block discarded – undo
490 506
 	echo '
491 507
 							</ul>';
492 508
 
493
-	if (empty($modSettings['deny_boards_access']))
494
-		echo '
509
+	if (empty($modSettings['deny_boards_access'])) {
510
+			echo '
495 511
 								<br class="clear"><br>
496 512
 								<input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');"> <label for="checkall_check"><em>', $txt['check_all'], '</em></label>
497 513
 							</fieldset>';
498
-	else
499
-		echo '
514
+	} else {
515
+			echo '
500 516
 								<br class="clear">
501 517
 								<span class="select_all_box">
502 518
 									<em>', $txt['all'], ': </em>
@@ -512,15 +528,17 @@  discard block
 block discarded – undo
512 528
 									});
513 529
 								});
514 530
 							</script>';
531
+	}
515 532
 
516
-	if ($collapse)
517
-		echo '
533
+	if ($collapse) {
534
+			echo '
518 535
 							<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>
519 536
 							<script>
520 537
 								document.getElementById("visible_boards_link").style.display = "";
521 538
 								document.getElementById("visible_boards").style.display = "none";
522 539
 							</script>';
523
-}
540
+	}
541
+	}
524 542
 
525 543
 /**
526 544
  * Templatine for viewing the members of a group.
@@ -544,14 +562,15 @@  discard block
 block discarded – undo
544 562
 						<span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['icons'], '
545 563
 					</dd>';
546 564
 	//Any description to show?
547
-	if (!empty($context['group']['description']))
548
-		echo '
565
+	if (!empty($context['group']['description'])) {
566
+			echo '
549 567
 					<dt>
550 568
 						<strong>' . $txt['membergroups_members_description'] . ':</strong>
551 569
 					</dt>
552 570
 					<dd>
553 571
 						', $context['group']['description'], '
554 572
 					</dd>';
573
+	}
555 574
 
556 575
 	echo '
557 576
 					<dt>
@@ -564,8 +583,9 @@  discard block
 block discarded – undo
564 583
 	if (!empty($context['group']['moderators']))
565 584
 	{
566 585
 		$moderators = array();
567
-		foreach ($context['group']['moderators'] as $moderator)
568
-			$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
586
+		foreach ($context['group']['moderators'] as $moderator) {
587
+					$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
588
+		}
569 589
 
570 590
 		echo '
571 591
 					<dt>
@@ -591,27 +611,30 @@  discard block
 block discarded – undo
591 611
 					<tr class="title_bar">
592 612
 						<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>';
593 613
 
594
-	if ($context['can_send_email'])
595
-		echo '
614
+	if ($context['can_send_email']) {
615
+			echo '
596 616
 						<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>';
617
+	}
597 618
 
598 619
 	echo '
599 620
 						<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>
600 621
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
601 622
 						<th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><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></th>';
602
-	if (!empty($context['group']['assignable']))
603
-		echo '
623
+	if (!empty($context['group']['assignable'])) {
624
+			echo '
604 625
 						<th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>';
626
+	}
605 627
 	echo '
606 628
 					</tr>
607 629
 				</thead>
608 630
 				<tbody>';
609 631
 
610
-	if (empty($context['members']))
611
-		echo '
632
+	if (empty($context['members'])) {
633
+			echo '
612 634
 					<tr class="windowbg">
613 635
 						<td colspan="6">', $txt['membergroups_members_no_members'], '</td>
614 636
 					</tr>';
637
+	}
615 638
 
616 639
 	foreach ($context['members'] as $member)
617 640
 	{
@@ -630,9 +653,10 @@  discard block
 block discarded – undo
630 653
 						<td>', $member['last_online'], '</td>
631 654
 						<td>', $member['registered'], '</td>
632 655
 						<td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';
633
-		if (!empty($context['group']['assignable']))
634
-			echo '
656
+		if (!empty($context['group']['assignable'])) {
657
+					echo '
635 658
 						<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>';
659
+		}
636 660
 		echo '
637 661
 					</tr>';
638 662
 	}
@@ -641,11 +665,12 @@  discard block
 block discarded – undo
641 665
 				</tbody>
642 666
 			</table>';
643 667
 
644
-	if (!empty($context['group']['assignable']))
645
-		echo '
668
+	if (!empty($context['group']['assignable'])) {
669
+			echo '
646 670
 			<div class="floatright">
647 671
 				<input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button ">
648 672
 			</div>';
673
+	}
649 674
 
650 675
 	echo '
651 676
 			<div class="pagesection flow_hidden">
@@ -679,8 +704,8 @@  discard block
 block discarded – undo
679 704
 		</form>
680 705
 	</div>';
681 706
 
682
-	if (!empty($context['group']['assignable']))
683
-		echo '
707
+	if (!empty($context['group']['assignable'])) {
708
+			echo '
684 709
 		<script>
685 710
 			var oAddMemberSuggest = new smc_AutoSuggest({
686 711
 				sSelf: \'oAddMemberSuggest\',
@@ -696,7 +721,8 @@  discard block
 block discarded – undo
696 721
 				sItemListContainerId: \'toAddItemContainer\'
697 722
 			});
698 723
 		</script>';
699
-}
724
+	}
725
+	}
700 726
 
701 727
 /**
702 728
  * Allow the moderator to enter a reason to each user being rejected.
@@ -716,8 +742,8 @@  discard block
 block discarded – undo
716 742
 				<dl class="settings">';
717 743
 
718 744
 	// Loop through and print out a reason box for each...
719
-	foreach ($context['group_requests'] as $request)
720
-		echo '
745
+	foreach ($context['group_requests'] as $request) {
746
+			echo '
721 747
 					<dt>
722 748
 						<strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong>
723 749
 					</dt>
@@ -725,6 +751,7 @@  discard block
 block discarded – undo
725 751
 						<input type="hidden" name="groupr[]" value="', $request['id'], '">
726 752
 						<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="min-width: 80%; max-width: 99%;"></textarea>
727 753
 					</dd>';
754
+	}
728 755
 
729 756
 	echo '
730 757
 				</dl>
Please login to merge, or discard this patch.
Themes/default/Search.template.php 1 patch
Braces   +85 added lines, -60 removed lines patch added patch discarded remove patch
@@ -25,13 +25,15 @@  discard block
 block discarded – undo
25 25
 			</h3>
26 26
 		</div>';
27 27
 
28
-	if (!empty($context['search_errors']))
29
-		echo '
28
+	if (!empty($context['search_errors'])) {
29
+			echo '
30 30
 		<div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>';
31
+	}
31 32
 
32
-	if (!empty($context['search_ignored']))
33
-		echo '
33
+	if (!empty($context['search_ignored'])) {
34
+			echo '
34 35
 		<p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
36
+	}
35 37
 
36 38
 	echo '
37 39
 		<div id="advanced_search" class="roundframe">
@@ -42,9 +44,10 @@  discard block
 block discarded – undo
42 44
 				<dd>
43 45
 					<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">';
44 46
 
45
-	if (empty($modSettings['search_simple_fulltext']))
46
-		echo '
47
+	if (empty($modSettings['search_simple_fulltext'])) {
48
+			echo '
47 49
 					<br><em class="smalltext">', $txt['search_example'], '</em>';
50
+	}
48 51
 
49 52
 	echo '
50 53
 				</dd>
@@ -115,11 +118,12 @@  discard block
 block discarded – undo
115 118
 	}
116 119
 
117 120
 	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
118
-	if (!empty($context['search_params']['topic']))
119
-		echo '
121
+	if (!empty($context['search_params']['topic'])) {
122
+			echo '
120 123
 				<p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
121 124
 				<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
122 125
 				<input type="submit" name="b_search" value="', $txt['search'], '" class="button">';
126
+	}
123 127
 
124 128
 	echo '
125 129
 			</div>
@@ -150,14 +154,15 @@  discard block
 block discarded – undo
150 154
 
151 155
 			foreach ($category['boards'] as $board)
152 156
 			{
153
-				if ($i == $limit)
154
-					echo '
157
+				if ($i == $limit) {
158
+									echo '
155 159
 							</ul>
156 160
 						</li>
157 161
 					</ul>
158 162
 					<ul class="ignoreboards floatright">
159 163
 						<li class="category">
160 164
 							<ul>';
165
+				}
161 166
 
162 167
 				echo '
163 168
 								<li class="board">
@@ -245,13 +250,15 @@  discard block
 block discarded – undo
245 250
 		<div class="roundframe">';
246 251
 
247 252
 		// Did they make any typos or mistakes, perhaps?
248
-		if (isset($context['did_you_mean']))
249
-			echo '
253
+		if (isset($context['did_you_mean'])) {
254
+					echo '
250 255
 			<p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>';
256
+		}
251 257
 
252
-		if (!empty($context['search_ignored']))
253
-			echo '
258
+		if (!empty($context['search_ignored'])) {
259
+					echo '
254 260
 			<p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
261
+		}
255 262
 
256 263
 		echo '
257 264
 			<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
@@ -273,10 +280,11 @@  discard block
 block discarded – undo
273 280
 					<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '">
274 281
 					<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">
275 282
 				</div>';
276
-		if (!empty($context['search_params']['brd']))
277
-			foreach ($context['search_params']['brd'] as $board_id)
283
+		if (!empty($context['search_params']['brd'])) {
284
+					foreach ($context['search_params']['brd'] as $board_id)
278 285
 				echo '
279 286
 				<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
287
+		}
280 288
 
281 289
 		echo '
282 290
 			</form>
@@ -287,17 +295,19 @@  discard block
 block discarded – undo
287 295
 	if ($context['compact'])
288 296
 	{
289 297
 		// Quick moderation set to checkboxes? Oh, how fun :/.
290
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
291
-			echo '
298
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
299
+					echo '
292 300
 	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
301
+		}
293 302
 
294 303
 	echo '
295 304
 		<div class="cat_bar">
296 305
 			<h3 class="catbg">
297 306
 				<span class="floatright">';
298
-					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
299
-					echo '
307
+					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
308
+										echo '
300 309
 							<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">';
310
+					}
301 311
 				echo '
302 312
 				</span>
303 313
 				<span class="generic_icons filter"></span>&nbsp;', $txt['mlist_search_results'], ':&nbsp;', $context['search_params']['search'], '
@@ -305,14 +315,15 @@  discard block
 block discarded – undo
305 315
 		</div>';
306 316
 
307 317
 		// was anything even found?
308
-		if (!empty($context['topics']))
309
-		echo'
318
+		if (!empty($context['topics'])) {
319
+				echo'
310 320
 		<div class="pagesection">
311 321
 			<span>', $context['page_index'], '</span>
312 322
 		</div>';
313
-		else
314
-			echo '
323
+		} else {
324
+					echo '
315 325
 			<div class="roundframe">', $txt['find_no_results'], '</div>';
326
+		}
316 327
 
317 328
 		// while we have results to show ...
318 329
 		while ($topic = $context['get_topics']())
@@ -340,38 +351,43 @@  discard block
 block discarded – undo
340 351
 					{
341 352
 						echo '
342 353
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '">';
343
-					}
344
-					else
354
+					} else
345 355
 					{
346
-						if ($topic['quick_mod']['remove'])
347
-							echo '
356
+						if ($topic['quick_mod']['remove']) {
357
+													echo '
348 358
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;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>';
359
+						}
349 360
 
350
-						if ($topic['quick_mod']['lock'])
351
-							echo '
361
+						if ($topic['quick_mod']['lock']) {
362
+													echo '
352 363
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;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>';
364
+						}
353 365
 
354
-						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
355
-							echo '
366
+						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
367
+													echo '
356 368
 						<br>';
369
+						}
357 370
 
358
-						if ($topic['quick_mod']['sticky'])
359
-							echo '
371
+						if ($topic['quick_mod']['sticky']) {
372
+													echo '
360 373
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;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>';
374
+						}
361 375
 
362
-						if ($topic['quick_mod']['move'])
363
-							echo '
376
+						if ($topic['quick_mod']['move']) {
377
+													echo '
364 378
 						<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
379
+						}
365 380
 					}
366 381
 
367 382
 					echo '
368 383
 					</div>';
369 384
 				}
370 385
 
371
-				if ($message['body_highlighted'] != '')
372
-					echo '
386
+				if ($message['body_highlighted'] != '') {
387
+									echo '
373 388
 					<br class="clear">
374 389
 					<div class="list_posts double_height">', $message['body_highlighted'], '</div>';
390
+				}
375 391
 			}
376 392
 
377 393
 			echo '
@@ -379,11 +395,12 @@  discard block
 block discarded – undo
379 395
 			</div>';
380 396
 
381 397
 		}
382
-		if (!empty($context['topics']))
383
-		echo '
398
+		if (!empty($context['topics'])) {
399
+				echo '
384 400
 		<div class="pagesection">
385 401
 			<span>', $context['page_index'], '</span>
386 402
 		</div>';
403
+		}
387 404
 
388 405
 		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
389 406
 		{
@@ -393,17 +410,19 @@  discard block
 block discarded – undo
393 410
 					<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
394 411
 						<option value="">--------</option>';
395 412
 
396
-			foreach ($context['qmod_actions'] as $qmod_action)
397
-				if ($context['can_' . $qmod_action])
413
+			foreach ($context['qmod_actions'] as $qmod_action) {
414
+							if ($context['can_' . $qmod_action])
398 415
 					echo '
399 416
 							<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
417
+			}
400 418
 
401 419
 			echo '
402 420
 					</select>';
403 421
 
404
-			if ($context['can_move'])
405
-				echo '
422
+			if ($context['can_move']) {
423
+							echo '
406 424
 				<span id="quick_mod_jump_to">&nbsp;</span>';
425
+			}
407 426
 
408 427
 			echo '
409 428
 					<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '">
@@ -413,13 +432,13 @@  discard block
 block discarded – undo
413 432
 		}
414 433
 
415 434
 
416
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
417
-			echo '
435
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
436
+					echo '
418 437
 			<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
419 438
 		</form>';
439
+		}
420 440
 
421
-	}
422
-	else
441
+	} else
423 442
 	{
424 443
 		echo '
425 444
 		<div class="cat_bar">
@@ -431,9 +450,10 @@  discard block
 block discarded – undo
431 450
 			<span>', $context['page_index'], '</span>
432 451
 		</div>';
433 452
 
434
-		if (empty($context['topics']))
435
-			echo '
453
+		if (empty($context['topics'])) {
454
+					echo '
436 455
 		<div class="information">(', $txt['search_no_results'], ')</div>';
456
+		}
437 457
 
438 458
 		while ($topic = $context['get_topics']())
439 459
 		{
@@ -448,23 +468,27 @@  discard block
 block discarded – undo
448 468
 					</div>
449 469
 					<div class="list_posts">', $message['body_highlighted'], '</div>';
450 470
 
451
-			if ($topic['can_reply'])
452
-				echo '
471
+			if ($topic['can_reply']) {
472
+							echo '
453 473
 						<ul class="quickbuttons">';
474
+			}
454 475
 
455 476
 				// If they *can* reply?
456
-			if ($topic['can_reply'])
457
-				echo '
477
+			if ($topic['can_reply']) {
478
+							echo '
458 479
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
480
+			}
459 481
 
460 482
 				// If they *can* quote?
461
-			if ($topic['can_quote'])
462
-				echo '
483
+			if ($topic['can_quote']) {
484
+							echo '
463 485
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
486
+			}
464 487
 
465
-			if ($topic['can_reply'])
466
-				echo '
488
+			if ($topic['can_reply']) {
489
+							echo '
467 490
 						</ul>';
491
+			}
468 492
 			echo '
469 493
 					<br class="clear">
470 494
 				</div>';
@@ -483,8 +507,8 @@  discard block
 block discarded – undo
483 507
 		<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
484 508
 		<script>';
485 509
 
486
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
487
-		echo '
510
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
511
+			echo '
488 512
 				if (typeof(window.XMLHttpRequest) != "undefined")
489 513
 					aJumpTo[aJumpTo.length] = new JumpTo({
490 514
 						sContainerId: "quick_mod_jump_to",
@@ -499,6 +523,7 @@  discard block
 block discarded – undo
499 523
 						bDisabled: true,
500 524
 						sCustomName: "move_to"
501 525
 					});';
526
+	}
502 527
 
503 528
 	echo '
504 529
 			if (typeof(window.XMLHttpRequest) != "undefined")
Please login to merge, or discard this patch.
Themes/default/ManageSmileys.template.php 1 patch
Braces   +55 added lines, -41 removed lines patch added patch discarded remove patch
@@ -63,18 +63,19 @@  discard block
 block discarded – undo
63 63
 					</dt>
64 64
 					<dd>
65 65
 						', $modSettings['smileys_url'], '/';
66
-		if ($context['current_set']['id'] == 'default')
67
-			echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
68
-		elseif (empty($context['smiley_set_dirs']))
69
-			echo '
66
+		if ($context['current_set']['id'] == 'default') {
67
+					echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
68
+		} elseif (empty($context['smiley_set_dirs'])) {
69
+					echo '
70 70
 						<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> ';
71
-		else
71
+		} else
72 72
 		{
73 73
 			echo '
74 74
 						<select name="smiley_sets_path" id="smiley_sets_path">';
75
-			foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
76
-				echo '
75
+			foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
76
+							echo '
77 77
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
78
+			}
78 79
 			echo '
79 80
 						</select> ';
80 81
 		}
@@ -89,14 +90,15 @@  discard block
 block discarded – undo
89 90
 					</dd>';
90 91
 
91 92
 		// If this is a new smiley set they have the option to import smileys already in the directory.
92
-		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
93
-			echo '
93
+		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
94
+					echo '
94 95
 					<dt>
95 96
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
96 97
 					</dt>
97 98
 					<dd>
98 99
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1">
99 100
 					</dd>';
101
+		}
100 102
 
101 103
 		echo '
102 104
 				</dl>
@@ -130,9 +132,10 @@  discard block
 block discarded – undo
130 132
 					<dd>
131 133
 						<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">';
132 134
 
133
-		foreach ($context['smiley_sets'] as $smiley_set)
134
-			echo '
135
+		foreach ($context['smiley_sets'] as $smiley_set) {
136
+					echo '
135 137
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
138
+		}
136 139
 
137 140
 		echo '
138 141
 						</select>)
@@ -147,16 +150,17 @@  discard block
 block discarded – undo
147 150
 						<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
148 151
 					</dt>
149 152
 					<dd>';
150
-			if (empty($context['filenames']))
151
-				echo '
153
+			if (empty($context['filenames'])) {
154
+							echo '
152 155
 						<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">';
153
-			else
156
+			} else
154 157
 			{
155 158
 				echo '
156 159
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
157
-				foreach ($context['filenames'] as $filename)
158
-					echo '
160
+				foreach ($context['filenames'] as $filename) {
161
+									echo '
159 162
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
163
+				}
160 164
 				echo '
161 165
 						</select>';
162 166
 			}
@@ -225,9 +229,10 @@  discard block
 block discarded – undo
225 229
 						<dd>
226 230
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
227 231
 
228
-		foreach ($context['smiley_sets'] as $smiley_set)
229
-			echo '
232
+		foreach ($context['smiley_sets'] as $smiley_set) {
233
+					echo '
230 234
 							<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
235
+		}
231 236
 
232 237
 		echo '
233 238
 							</select>
@@ -236,16 +241,17 @@  discard block
 block discarded – undo
236 241
 							<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
237 242
 						</dt>
238 243
 						<dd>';
239
-	if (empty($context['filenames']))
240
-		echo '
244
+	if (empty($context['filenames'])) {
245
+			echo '
241 246
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">';
242
-	else
247
+	} else
243 248
 	{
244 249
 		echo '
245 250
 								<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
246
-		foreach ($context['filenames'] as $filename)
247
-			echo '
251
+		foreach ($context['filenames'] as $filename) {
252
+					echo '
248 253
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
254
+		}
249 255
 		echo '
250 256
 							</select>';
251 257
 	}
@@ -273,14 +279,15 @@  discard block
 block discarded – undo
273 279
 				</fieldset>
274 280
 
275 281
 				<dl id="uploadMore" style="display: none;" class="settings">';
276
-	foreach ($context['smiley_sets'] as $smiley_set)
277
-		echo '
282
+	foreach ($context['smiley_sets'] as $smiley_set) {
283
+			echo '
278 284
 					<dt>
279 285
 						', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ':
280 286
 					</dt>
281 287
 					<dd>
282 288
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');">
283 289
 					</dd>';
290
+	}
284 291
 	echo '
285 292
 				</dl>
286 293
 			</div>
@@ -349,24 +356,27 @@  discard block
 block discarded – undo
349 356
 				<strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>';
350 357
 		foreach ($location['rows'] as $row)
351 358
 		{
352
-			if (!empty($context['move_smiley']))
353
-				echo '
359
+			if (!empty($context['move_smiley'])) {
360
+							echo '
354 361
 					<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
362
+			}
355 363
 
356 364
 			foreach ($row as $smiley)
357 365
 			{
358
-				if (empty($context['move_smiley']))
359
-					echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>';
360
-				else
361
-					echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
366
+				if (empty($context['move_smiley'])) {
367
+									echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>';
368
+				} else {
369
+									echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
370
+				}
362 371
 			}
363 372
 
364 373
 			echo '
365 374
 				<br>';
366 375
 		}
367
-		if (!empty($context['move_smiley']))
368
-			echo '
376
+		if (!empty($context['move_smiley'])) {
377
+					echo '
369 378
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
379
+		}
370 380
 		echo '
371 381
 			</div>
372 382
 		<input type="hidden" name="reorder" value="1">
@@ -402,14 +412,15 @@  discard block
 block discarded – undo
402 412
 			</div>
403 413
 			<div class="windowbg2">
404 414
 				<dl class="settings">';
405
-	if (!$context['new_icon'])
406
-		echo '
415
+	if (!$context['new_icon']) {
416
+			echo '
407 417
 					<dt>
408 418
 						<strong>', $txt['smiley_preview'], ': </strong>
409 419
 					</dt>
410 420
 					<dd>
411 421
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
412 422
 					</dd>';
423
+	}
413 424
 	echo '
414 425
 					<dt>
415 426
 						<strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', $txt['icons_filename_all_png'], '</span>
@@ -434,9 +445,10 @@  discard block
 block discarded – undo
434 445
 	{
435 446
 		echo '
436 447
 							<optgroup label="', $category['name'], '">';
437
-		foreach ($category['boards'] as $board)
438
-			echo '
448
+		foreach ($category['boards'] as $board) {
449
+					echo '
439 450
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
451
+		}
440 452
 		echo '
441 453
 							</optgroup>';
442 454
 	}
@@ -451,19 +463,21 @@  discard block
 block discarded – undo
451 463
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
452 464
 
453 465
 	// Print the list of all the icons it can be put after...
454
-	foreach ($context['icons'] as $id => $data)
455
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
466
+	foreach ($context['icons'] as $id => $data) {
467
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
456 468
 			echo '
457 469
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
470
+	}
458 471
 
459 472
 	echo '
460 473
 						</select>
461 474
 					</dd>
462 475
 				</dl>';
463 476
 
464
-	if (!$context['new_icon'])
465
-		echo '
477
+	if (!$context['new_icon']) {
478
+			echo '
466 479
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
480
+	}
467 481
 
468 482
 	echo '
469 483
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/Register.template.php 1 patch
Braces   +72 added lines, -52 removed lines patch added patch discarded remove patch
@@ -28,13 +28,14 @@  discard block
 block discarded – undo
28 28
 			<div id="confirm_buttons">';
29 29
 
30 30
 	// Age restriction in effect?
31
-	if ($context['show_coppa'])
32
-		echo '
31
+	if ($context['show_coppa']) {
32
+			echo '
33 33
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br><br>
34 34
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
35
-	else
36
-		echo '
35
+	} else {
36
+			echo '
37 37
 				<input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button">';
38
+	}
38 39
 
39 40
 	echo '
40 41
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -77,9 +78,10 @@  discard block
 block discarded – undo
77 78
 			<ul>';
78 79
 
79 80
 		// Cycle through each error and display an error message.
80
-		foreach ($context['registration_errors'] as $error)
81
-			echo '
81
+		foreach ($context['registration_errors'] as $error) {
82
+					echo '
82 83
 				<li>', $error, '</li>';
84
+		}
83 85
 
84 86
 		echo '
85 87
 			</ul>
@@ -143,14 +145,15 @@  discard block
 block discarded – undo
143 145
 
144 146
 					<dl class="register_form">';
145 147
 
146
-		foreach ($context['custom_fields'] as $field)
147
-			if ($field['show_reg'] > 1)
148
+		foreach ($context['custom_fields'] as $field) {
149
+					if ($field['show_reg'] > 1)
148 150
 				echo '
149 151
 						<dt>
150 152
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
151 153
 							<span class="smalltext">', $field['desc'], '</span>
152 154
 						</dt>
153 155
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
156
+		}
154 157
 
155 158
 		echo '
156 159
 					</dl>';
@@ -184,41 +187,45 @@  discard block
 block discarded – undo
184 187
 					$callback_func = 'template_profile_' . $field['callback_func'];
185 188
 					$callback_func();
186 189
 				}
187
-			}
188
-			else
190
+			} else
189 191
 			{
190 192
 					echo '
191 193
 						<dt>
192 194
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>';
193 195
 
194 196
 				// Does it have any subtext to show?
195
-				if (!empty($field['subtext']))
196
-					echo '
197
+				if (!empty($field['subtext'])) {
198
+									echo '
197 199
 							<span class="smalltext">', $field['subtext'], '</span>';
200
+				}
198 201
 
199 202
 				echo '
200 203
 						</dt>
201 204
 						<dd>';
202 205
 
203 206
 				// Want to put something infront of the box?
204
-				if (!empty($field['preinput']))
205
-					echo '
207
+				if (!empty($field['preinput'])) {
208
+									echo '
206 209
 							', $field['preinput'];
210
+				}
207 211
 
208 212
 				// What type of data are we showing?
209
-				if ($field['type'] == 'label')
210
-					echo '
213
+				if ($field['type'] == 'label') {
214
+									echo '
211 215
 							', $field['value'];
216
+				}
212 217
 
213 218
 				// Maybe it's a text box - very likely!
214
-				elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
215
-					echo '
219
+				elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) {
220
+									echo '
216 221
 							<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
222
+				}
217 223
 
218 224
 				// You "checking" me out? ;)
219
-				elseif ($field['type'] == 'check')
220
-					echo '
225
+				elseif ($field['type'] == 'check') {
226
+									echo '
221 227
 							<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
228
+				}
222 229
 
223 230
 				// Always fun - select boxes!
224 231
 				elseif ($field['type'] == 'select')
@@ -229,13 +236,15 @@  discard block
 block discarded – undo
229 236
 					if (isset($field['options']))
230 237
 					{
231 238
 						// Is this some code to generate the options?
232
-						if (!is_array($field['options']))
233
-							$field['options'] = eval($field['options']);
239
+						if (!is_array($field['options'])) {
240
+													$field['options'] = eval($field['options']);
241
+						}
234 242
 						// Assuming we now have some!
235
-						if (is_array($field['options']))
236
-							foreach ($field['options'] as $value => $name)
243
+						if (is_array($field['options'])) {
244
+													foreach ($field['options'] as $value => $name)
237 245
 								echo '
238 246
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
247
+						}
239 248
 					}
240 249
 
241 250
 					echo '
@@ -243,9 +252,10 @@  discard block
 block discarded – undo
243 252
 				}
244 253
 
245 254
 				// Something to end with?
246
-				if (!empty($field['postinput']))
247
-					echo '
255
+				if (!empty($field['postinput'])) {
256
+									echo '
248 257
 							', $field['postinput'];
258
+				}
249 259
 
250 260
 				echo '
251 261
 						</dd>';
@@ -258,13 +268,14 @@  discard block
 block discarded – undo
258 268
 	{
259 269
 		foreach ($context['custom_fields'] as $field)
260 270
 		{
261
-			if ($field['show_reg'] < 2)
262
-				echo '
271
+			if ($field['show_reg'] < 2) {
272
+							echo '
263 273
 						<dt>
264 274
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
265 275
 							<span class="smalltext">', $field['desc'], '</span>
266 276
 						</dt>
267 277
 						<dd>', $field['input_html'], '</dd>';
278
+			}
268 279
 		}
269 280
 	}
270 281
 
@@ -294,13 +305,14 @@  discard block
 block discarded – undo
294 305
 			<div id="confirm_buttons" class="flow_auto">';
295 306
 
296 307
 	// Age restriction in effect?
297
-	if (!$context['require_agreement'] && $context['show_coppa'])
298
-		echo '
308
+	if (!$context['require_agreement'] && $context['show_coppa']) {
309
+			echo '
299 310
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br><br>
300 311
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
301
-	else
302
-		echo '
312
+	} else {
313
+			echo '
303 314
 				<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">';
315
+	}
304 316
 	echo '
305 317
 			</div>
306 318
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -445,19 +457,20 @@  discard block
 block discarded – undo
445 457
 	</head>
446 458
 	<body style="margin: 1ex;">
447 459
 		<div class="windowbg description" style="text-align: center;">';
448
-	if (isBrowser('is_ie') || isBrowser('is_ie11'))
449
-		echo '
460
+	if (isBrowser('is_ie') || isBrowser('is_ie11')) {
461
+			echo '
450 462
 			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
451 463
 				<param name="AutoStart" value="1">
452 464
 				<param name="FileName" value="', $context['verification_sound_href'], '">
453 465
 			</object>';
454
-	else
455
-		echo '
466
+	} else {
467
+			echo '
456 468
 			<audio src="', $context['verification_sound_href'], '" controls>
457 469
 				<object type="audio/x-wav" data="', $context['verification_sound_href'], '">
458 470
 					<a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
459 471
 				</object>
460 472
 			</audio>';
473
+	}
461 474
 	echo '
462 475
 		<br>
463 476
 		<a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br>
@@ -484,11 +497,12 @@  discard block
 block discarded – undo
484 497
 				</div>
485 498
 				<div id="register_screen" class="windowbg2 noup">';
486 499
 
487
-	if (!empty($context['registration_done']))
488
-		echo '
500
+	if (!empty($context['registration_done'])) {
501
+			echo '
489 502
 					<div class="infobox">
490 503
 						', $context['registration_done'], '
491 504
 					</div>';
505
+	}
492 506
 
493 507
 	echo '
494 508
 					<dl class="register_form" id="admin_register_form">
@@ -524,9 +538,10 @@  discard block
 block discarded – undo
524 538
 						<dd>
525 539
 							<select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
526 540
 
527
-		foreach ($context['member_groups'] as $id => $name)
528
-			echo '
541
+		foreach ($context['member_groups'] as $id => $name) {
542
+					echo '
529 543
 								<option value="', $id, '">', $name, '</option>';
544
+		}
530 545
 
531 546
 		echo '
532 547
 							</select>
@@ -534,8 +549,8 @@  discard block
 block discarded – undo
534 549
 	}
535 550
 
536 551
 	// If there is any field marked as required, show it here!
537
-	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
538
-		foreach ($context['custom_fields'] as $field)
552
+	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) {
553
+			foreach ($context['custom_fields'] as $field)
539 554
 			if ($field['show_reg'] > 1)
540 555
 				echo '
541 556
 						<dt>
@@ -543,6 +558,7 @@  discard block
 block discarded – undo
543 558
 							<span class="smalltext">', $field['desc'], '</span>
544 559
 						</dt>
545 560
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
561
+	}
546 562
 
547 563
 	echo '
548 564
 						<dt>
@@ -579,12 +595,13 @@  discard block
 block discarded – undo
579 595
 {
580 596
 	global $context, $scripturl, $txt;
581 597
 
582
-	if (!empty($context['saved_successful']))
583
-		echo '
598
+	if (!empty($context['saved_successful'])) {
599
+			echo '
584 600
 					<div class="infobox">', $txt['settings_saved'], '</div>';
585
-	elseif (!empty($context['could_not_save']))
586
-		echo '
601
+	} elseif (!empty($context['could_not_save'])) {
602
+			echo '
587 603
 					<div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
604
+	}
588 605
 
589 606
 	// Just a big box to edit the text file ;).
590 607
 	echo '
@@ -594,9 +611,10 @@  discard block
 block discarded – undo
594 611
 			</div>';
595 612
 
596 613
 	// Warning for if the file isn't writable.
597
-	if (!empty($context['warning']))
598
-		echo '
614
+	if (!empty($context['warning'])) {
615
+			echo '
599 616
 			<p class="error">', $context['warning'], '</p>';
617
+	}
600 618
 
601 619
 	echo '
602 620
 			<div class="windowbg2 noup" id="registration_agreement">';
@@ -613,9 +631,10 @@  discard block
 block discarded – undo
613 631
 						<strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
614 632
 						<select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
615 633
 
616
-		foreach ($context['editable_agreements'] as $file => $name)
617
-			echo '
634
+		foreach ($context['editable_agreements'] as $file => $name) {
635
+					echo '
618 636
 							<option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
637
+		}
619 638
 
620 639
 		echo '
621 640
 						</select>
@@ -655,9 +674,10 @@  discard block
 block discarded – undo
655 674
 {
656 675
 	global $context, $scripturl, $txt;
657 676
 
658
-	if (!empty($context['saved_successful']))
659
-		echo '
677
+	if (!empty($context['saved_successful'])) {
678
+			echo '
660 679
 	<div class="infobox">', $txt['settings_saved'], '</div>';
680
+	}
661 681
 
662 682
 	echo '
663 683
 		<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
Please login to merge, or discard this patch.
Themes/default/Memberlist.template.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['members_list'], '</span>';
29
-		if (!isset($context['old_search']))
30
-				echo '
29
+		if (!isset($context['old_search'])) {
30
+						echo '
31 31
 				<span class="floatright">', $context['letter_links'], '</span>';
32
+		}
32 33
 		echo '
33 34
 			</h3>
34 35
 		</div>';
@@ -43,19 +44,22 @@  discard block
 block discarded – undo
43 44
 	foreach ($context['columns'] as $key => $column)
44 45
 	{
45 46
 		// @TODO maybe find something nicer?
46
-		if ($key == 'email_address' && !$context['can_send_email'])
47
-			continue;
47
+		if ($key == 'email_address' && !$context['can_send_email']) {
48
+					continue;
49
+		}
48 50
 
49 51
 		// This is a selected column, so underline it or some such.
50
-		if ($column['selected'])
51
-			echo '
52
+		if ($column['selected']) {
53
+					echo '
52 54
 					<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '>
53 55
 						<a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>';
56
+		}
54 57
 		// This is just some column... show the link and be done with it.
55
-		else
56
-			echo '
58
+		else {
59
+					echo '
57 60
 					<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
58 61
 						', $column['link'], '</th>';
62
+		}
59 63
 	}
60 64
 	echo '
61 65
 				</tr>
@@ -74,9 +78,10 @@  discard block
 block discarded – undo
74 78
 					</td>
75 79
 					<td class="lefttext">', $member['link'], '</td>';
76 80
 
77
-		if (!isset($context['disabled_fields']['website']))
78
-			echo '
81
+		if (!isset($context['disabled_fields']['website'])) {
82
+					echo '
79 83
 					<td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>';
84
+		}
80 85
 
81 86
 		// Group and date.
82 87
 		echo '
@@ -89,11 +94,12 @@  discard block
 block discarded – undo
89 94
 					<td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td>
90 95
 					<td class="centertext statsbar" style="width: 120px">';
91 96
 
92
-			if (!empty($member['post_percent']))
93
-				echo '
97
+			if (!empty($member['post_percent'])) {
98
+							echo '
94 99
 						<div class="bar" style="width: ', $member['post_percent'] + 4, 'px;">
95 100
 							<div style="width: ', $member['post_percent'], 'px;"></div>
96 101
 						</div>';
102
+			}
97 103
 
98 104
 			echo '
99 105
 					</td>';
@@ -102,9 +108,10 @@  discard block
 block discarded – undo
102 108
 		// Show custom fields marked to be shown here
103 109
 		if (!empty($context['custom_profile_fields']['columns']))
104 110
 		{
105
-			foreach ($context['custom_profile_fields']['columns'] as $key => $column)
106
-				echo '
111
+			foreach ($context['custom_profile_fields']['columns'] as $key => $column) {
112
+							echo '
107 113
 					<td class="righttext">', $member['options'][$key], '</td>';
114
+			}
108 115
 		}
109 116
 
110 117
 		echo '
@@ -112,11 +119,12 @@  discard block
 block discarded – undo
112 119
 		}
113 120
 	}
114 121
 	// No members?
115
-	else
116
-		echo '
122
+	else {
123
+			echo '
117 124
 				<tr>
118 125
 					<td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td>
119 126
 				</tr>';
127
+	}
120 128
 
121 129
 				echo '
122 130
 			</tbody>
@@ -129,9 +137,10 @@  discard block
 block discarded – undo
129 137
 			<div class="pagelinks floatleft">', $context['page_index'], '</div>';
130 138
 
131 139
 	// If it is displaying the result of a search show a "search again" link to edit their criteria.
132
-	if (isset($context['old_search']))
133
-		echo '
140
+	if (isset($context['old_search'])) {
141
+			echo '
134 142
 			<a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>';
143
+	}
135 144
 	echo '
136 145
 		</div>
137 146
 	</div>';
Please login to merge, or discard this patch.
Themes/default/Poll.template.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 				<h3 class="catbg">', $context['page_title'], '</h3>
47 47
 			</div>';
48 48
 
49
-	if (!empty($context['poll_error']['messages']))
50
-		echo '
49
+	if (!empty($context['poll_error']['messages'])) {
50
+			echo '
51 51
 			<div class="errorbox">
52 52
 				<dl class="poll_error">
53 53
 					<dt>
@@ -58,6 +58,7 @@  discard block
 block discarded – undo
58 58
 					</dt>
59 59
 				</dl>
60 60
 			</div>';
61
+	}
61 62
 
62 63
 	echo '
63 64
 			<div>
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 								<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" size="80" maxlength="255">';
80 81
 
81 82
 		// Does this option have a vote count yet, or is it new?
82
-		if ($choice['votes'] != -1)
83
-			echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
83
+		if ($choice['votes'] != -1) {
84
+					echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
85
+		}
84 86
 
85 87
 		echo '
86 88
 							</dd>';
@@ -118,14 +120,15 @@  discard block
 block discarded – undo
118 120
 								<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
119 121
 							</dd>';
120 122
 
121
-		if ($context['poll']['guest_vote_allowed'])
122
-			echo '
123
+		if ($context['poll']['guest_vote_allowed']) {
124
+					echo '
123 125
 							<dt>
124 126
 								<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
125 127
 							</dt>
126 128
 							<dd>
127 129
 								<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', '>
128 130
 							</dd>';
131
+		}
129 132
 	}
130 133
 
131 134
 	echo '
@@ -140,12 +143,13 @@  discard block
 block discarded – undo
140 143
 						</dl>
141 144
 					</fieldset>';
142 145
 	// If this is an edit, we can allow them to reset the vote counts.
143
-	if ($context['is_edit'])
144
-		echo '
146
+	if ($context['is_edit']) {
147
+			echo '
145 148
 					<fieldset id="poll_reset">
146 149
 						<legend>', $txt['reset_votes'], '</legend>
147 150
 						<input type="checkbox" name="resetVoteCount" value="on"> ' . $txt['reset_votes_check'] . '
148 151
 					</fieldset>';
152
+	}
149 153
 	echo '
150 154
 					<input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
151 155
 				</div>
Please login to merge, or discard this patch.
Themes/default/ManagePaid.template.php 1 patch
Braces   +61 added lines, -44 removed lines patch added patch discarded remove patch
@@ -24,11 +24,12 @@  discard block
 block discarded – undo
24 24
 				<h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3>
25 25
 			</div>';
26 26
 
27
-	if (!empty($context['disable_groups']))
28
-		echo '
27
+	if (!empty($context['disable_groups'])) {
28
+			echo '
29 29
 			<div class="information">
30 30
 				<span class="alert">', $txt['paid_mod_edit_note'], '</span>
31 31
 			</div>';
32
+	}
32 33
 
33 34
 	echo '
34 35
 			<div class="windowbg2">
@@ -68,9 +69,10 @@  discard block
 block discarded – undo
68 69
 							<option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>';
69 70
 
70 71
 	// Put each group into the box.
71
-	foreach ($context['groups'] as $id => $name)
72
-		echo '
72
+	foreach ($context['groups'] as $id => $name) {
73
+			echo '
73 74
 							<option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>';
75
+	}
74 76
 
75 77
 	echo '
76 78
 						</select>
@@ -81,9 +83,10 @@  discard block
 block discarded – undo
81 83
 					<dd>';
82 84
 
83 85
 	// Put a checkbox in for each group
84
-	foreach ($context['groups'] as $id => $name)
85
-		echo '
86
+	foreach ($context['groups'] as $id => $name) {
87
+			echo '
86 88
 						<label for="addgroup_', $id, '"><input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '>&nbsp;<span class="smalltext">', $name, '</span></label><br>';
89
+	}
87 90
 
88 91
 	echo '
89 92
 					</dd>
@@ -135,8 +138,8 @@  discard block
 block discarded – undo
135 138
 					<fieldset>';
136 139
 
137 140
 	//!! Removed until implemented
138
-	if (!empty($sdflsdhglsdjgs))
139
-		echo '
141
+	if (!empty($sdflsdhglsdjgs)) {
142
+			echo '
140 143
 						<dl class="settings">
141 144
 							<dt>
142 145
 								<label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span>
@@ -145,6 +148,7 @@  discard block
 block discarded – undo
145 148
 								<input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', '>
146 149
 							</dd>
147 150
 						</dl>';
151
+	}
148 152
 
149 153
 	echo '
150 154
 						<div class="information">
@@ -245,8 +249,8 @@  discard block
 block discarded – undo
245 249
 				<dl class="settings">';
246 250
 
247 251
 	// Do we need a username?
248
-	if ($context['action_type'] == 'add')
249
-		echo '
252
+	if ($context['action_type'] == 'add') {
253
+			echo '
250 254
 
251 255
 					<dt>
252 256
 						<strong>', $txt['paid_username'], ':</strong><br>
@@ -255,6 +259,7 @@  discard block
 block discarded – undo
255 259
 					<dd>
256 260
 						<input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30">
257 261
 					</dd>';
262
+	}
258 263
 
259 264
 	echo '
260 265
 					<dt>
@@ -272,9 +277,10 @@  discard block
 block discarded – undo
272 277
 					<select name="year" id="year" onchange="generateDays();">';
273 278
 
274 279
 	// Show a list of all the years we allow...
275
-	for ($year = 2005; $year <= 2030; $year++)
276
-		echo '
280
+	for ($year = 2005; $year <= 2030; $year++) {
281
+			echo '
277 282
 						<option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>';
283
+	}
278 284
 
279 285
 	echo '
280 286
 					</select>&nbsp;
@@ -282,9 +288,10 @@  discard block
 block discarded – undo
282 288
 					<select name="month" id="month" onchange="generateDays();">';
283 289
 
284 290
 	// There are 12 months per year - ensure that they all get listed.
285
-	for ($month = 1; $month <= 12; $month++)
286
-		echo '
291
+	for ($month = 1; $month <= 12; $month++) {
292
+			echo '
287 293
 						<option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
294
+	}
288 295
 
289 296
 	echo '
290 297
 					</select>&nbsp;
@@ -292,9 +299,10 @@  discard block
 block discarded – undo
292 299
 					<select name="day" id="day">';
293 300
 
294 301
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
295
-	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
296
-		echo '
302
+	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) {
303
+			echo '
297 304
 						<option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>';
305
+	}
298 306
 
299 307
 	echo '
300 308
 					</select>
@@ -306,9 +314,10 @@  discard block
 block discarded – undo
306 314
 					<select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
307 315
 
308 316
 	// Show a list of all the years we allow...
309
-	for ($year = 2005; $year <= 2030; $year++)
310
-		echo '
317
+	for ($year = 2005; $year <= 2030; $year++) {
318
+			echo '
311 319
 						<option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>';
320
+	}
312 321
 
313 322
 	echo '
314 323
 					</select>&nbsp;
@@ -316,9 +325,10 @@  discard block
 block discarded – undo
316 325
 					<select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
317 326
 
318 327
 	// There are 12 months per year - ensure that they all get listed.
319
-	for ($month = 1; $month <= 12; $month++)
320
-		echo '
328
+	for ($month = 1; $month <= 12; $month++) {
329
+			echo '
321 330
 						<option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
331
+	}
322 332
 
323 333
 	echo '
324 334
 					</select>&nbsp;
@@ -326,9 +336,10 @@  discard block
 block discarded – undo
326 336
 					<select name="dayend" id="dayend">';
327 337
 
328 338
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
329
-	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
330
-		echo '
339
+	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) {
340
+			echo '
331 341
 						<option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>';
342
+	}
332 343
 
333 344
 	echo '
334 345
 					</select>
@@ -410,8 +421,7 @@  discard block
 block discarded – undo
410 421
 			<div class="information">
411 422
 				', $txt['paid_subs_none'], '
412 423
 			</div>';
413
-	}
414
-	else
424
+	} else
415 425
 	{
416 426
 		echo '
417 427
 			<div class="information">
@@ -423,8 +433,9 @@  discard block
 block discarded – undo
423 433
 		{
424 434
 
425 435
 			// Ignore the inactive ones...
426
-			if (empty($subscription['active']))
427
-				continue;
436
+			if (empty($subscription['active'])) {
437
+							continue;
438
+			}
428 439
 
429 440
 			echo '
430 441
 			<div class="cat_bar">
@@ -434,9 +445,10 @@  discard block
 block discarded – undo
434 445
 				<p><strong>', $subscription['name'], '</strong></p>
435 446
 				<p class="smalltext">', $subscription['desc'], '</p>';
436 447
 
437
-			if (!$subscription['flexible'])
438
-				echo '
448
+			if (!$subscription['flexible']) {
449
+							echo '
439 450
 					<div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>';
451
+			}
440 452
 
441 453
 			if ($context['user']['is_owner'])
442 454
 			{
@@ -449,24 +461,25 @@  discard block
 block discarded – undo
449 461
 					<select name="cur[', $subscription['id'], ']">';
450 462
 
451 463
 					// Print out the costs for this one.
452
-					foreach ($subscription['costs'] as $duration => $value)
453
-						echo '
464
+					foreach ($subscription['costs'] as $duration => $value) {
465
+											echo '
454 466
 						<option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>';
467
+					}
455 468
 
456 469
 					echo '
457 470
 					</select>';
458
-				}
459
-				else
460
-					echo '
471
+				} else {
472
+									echo '
461 473
 					', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']);
474
+				}
462 475
 
463 476
 				echo '
464 477
 					<hr>
465 478
 					<input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">';
466
-			}
467
-			else
468
-				echo '
479
+			} else {
480
+							echo '
469 481
 					<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>';
482
+			}
470 483
 
471 484
 			echo '
472 485
 			</div>';
@@ -493,19 +506,20 @@  discard block
 block discarded – undo
493 506
 			</thead>
494 507
 			<tbody>';
495 508
 
496
-	if (empty($context['current']))
497
-		echo '
509
+	if (empty($context['current'])) {
510
+			echo '
498 511
 				<tr class="windowbg">
499 512
 					<td colspan="4">
500 513
 						', $txt['paid_none_yet'], '
501 514
 					</td>
502 515
 				</tr>';
516
+	}
503 517
 
504 518
 	foreach ($context['current'] as $sub)
505 519
 	{
506 520
 
507
-		if (!$sub['hide'])
508
-			echo '
521
+		if (!$sub['hide']) {
522
+					echo '
509 523
 				<tr class="windowbg">
510 524
 					<td>
511 525
 						', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
@@ -517,6 +531,7 @@  discard block
 block discarded – undo
517 531
 						', $sub['end'], '
518 532
 					</td>
519 533
 				</tr>';
534
+		}
520 535
 	}
521 536
 	echo '
522 537
 			</tbody>
@@ -567,15 +582,17 @@  discard block
 block discarded – undo
567 582
 			', $gateway['desc'], '<br>
568 583
 				<form action="', $gateway['form'], '" method="post">';
569 584
 
570
-		if (!empty($gateway['javascript']))
571
-			echo '
585
+		if (!empty($gateway['javascript'])) {
586
+					echo '
572 587
 					<script>
573 588
 						', $gateway['javascript'], '
574 589
 					</script>';
590
+		}
575 591
 
576
-		foreach ($gateway['hidden'] as $name => $value)
577
-			echo '
592
+		foreach ($gateway['hidden'] as $name => $value) {
593
+					echo '
578 594
 					<input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">';
595
+		}
579 596
 
580 597
 		echo '
581 598
 					<br><input type="submit" value="', $gateway['submit'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/Login.template.php 1 patch
Braces   +35 added lines, -24 removed lines patch added patch discarded remove patch
@@ -28,14 +28,16 @@  discard block
 block discarded – undo
28 28
 				<form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">';
29 29
 
30 30
 	// Did they make a mistake last time?
31
-	if (!empty($context['login_errors']))
32
-		echo '
31
+	if (!empty($context['login_errors'])) {
32
+			echo '
33 33
 					<div class="errorbox">', implode('<br>', $context['login_errors']), '</div><br>';
34
+	}
34 35
 
35 36
 	// Or perhaps there's some special description for this time?
36
-	if (isset($context['description']))
37
-		echo '
37
+	if (isset($context['description'])) {
38
+			echo '
38 39
 					<div class="information">', $context['description'], '</div>';
40
+	}
39 41
 
40 42
 	// Now just get the basic information - username, password, etc.
41 43
 	echo '
@@ -51,10 +53,11 @@  discard block
 block discarded – undo
51 53
 						<dt>', $txt['always_logged_in'], ':</dt>
52 54
 						<dd><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked' : '', ' onclick="this.form.cookielength.disabled = this.checked;"></dd>';
53 55
 	// If they have deleted their account, give them a chance to change their mind.
54
-	if (isset($context['login_show_undelete']))
55
-		echo '
56
+	if (isset($context['login_show_undelete'])) {
57
+			echo '
56 58
 						<dt class="alert">', $txt['undelete_account'], ':</dt>
57 59
 						<dd><input type="checkbox" name="undelete"></dd>';
60
+	}
58 61
 	echo '
59 62
 					</dl>
60 63
 					<p><input type="submit" value="', $txt['login'], '" class="button"></p>
@@ -66,8 +69,8 @@  discard block
 block discarded – undo
66 69
 						setTimeout(function() {
67 70
 							document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus();
68 71
 						}, 150);';
69
-	if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2))
70
-		echo '
72
+	if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) {
73
+			echo '
71 74
 						form = $("#frmLogin");
72 75
 						form.submit(function(e) {
73 76
 							e.preventDefault();
@@ -100,16 +103,18 @@  discard block
 block discarded – undo
100 103
 
101 104
 							return false;
102 105
 						});';
106
+	}
103 107
 
104 108
 	echo '
105 109
 					</script>
106 110
 				</form>';
107 111
 
108 112
 	// It is a long story as to why we have this when we're clearly not going to use it.
109
-	if (!empty($context['from_ajax']))
110
-		echo '
113
+	if (!empty($context['from_ajax'])) {
114
+			echo '
111 115
 					<br>
112 116
 					<a href="javascript:self.close();"></a>';
117
+	}
113 118
 	echo '
114 119
 			</div>
115 120
 		</div>';
@@ -130,9 +135,10 @@  discard block
 block discarded – undo
130 135
 				</h3>
131 136
 			</div>
132 137
 			<div class="roundframe noup">';
133
-	if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error']))
134
-		echo '
138
+	if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) {
139
+			echo '
135 140
 				<div class="error">', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], '</div>';
141
+	}
136 142
 	echo '
137 143
 				<form action="', $context['tfa_url'], '" method="post" id="frmTfa">
138 144
 					<div id="tfaCode">
@@ -155,8 +161,8 @@  discard block
 block discarded – undo
155 161
 				</form>
156 162
 				<script>
157 163
 						form = $("#frmTfa");';
158
-	if (!empty($context['from_ajax']))
159
-		echo '
164
+	if (!empty($context['from_ajax'])) {
165
+			echo '
160 166
 						form.submit(function(e) {
161 167
 							// If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page
162 168
 							if (form.find("input[name=tfa_backup]:first").val().length > 0)
@@ -175,6 +181,7 @@  discard block
 block discarded – undo
175 181
 
176 182
 							return false;
177 183
 						});';
184
+	}
178 185
 	echo '
179 186
 						form.find("input[name=backup]").click(function(e) {
180 187
 							$("#tfaBackup").show();
@@ -206,10 +213,11 @@  discard block
 block discarded – undo
206 213
 				', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>';
207 214
 
208 215
 
209
-	if ($context['can_register'])
210
-		echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
211
-	else
212
-		echo $txt['login_below'];
216
+	if ($context['can_register']) {
217
+			echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
218
+	} else {
219
+			echo $txt['login_below'];
220
+	}
213 221
 
214 222
 	// And now the login information.
215 223
 	echo '
@@ -305,9 +313,10 @@  discard block
 block discarded – undo
305 313
 		</div>
306 314
 		<div class="roundframe centertext noup">';
307 315
 
308
-	if (!empty($context['incorrect_password']))
309
-		echo '
316
+	if (!empty($context['incorrect_password'])) {
317
+			echo '
310 318
 			<div class="error">', $txt['admin_incorrect_password'], '</div>';
319
+	}
311 320
 
312 321
 	echo '
313 322
 			<strong>', $txt['password'], ':</strong>
@@ -347,11 +356,12 @@  discard block
 block discarded – undo
347 356
 			<div class="roundframe">';
348 357
 
349 358
 	// You didn't even have an ID?
350
-	if (empty($context['member_id']))
351
-		echo '
359
+	if (empty($context['member_id'])) {
360
+			echo '
352 361
 				<dl>
353 362
 					<dt>', $txt['invalid_activation_username'], ':</dt>
354 363
 					<dd><input type="text" name="user" size="30"></dd>';
364
+	}
355 365
 
356 366
 	echo '
357 367
 					<dt>', $txt['invalid_activation_retry'], ':</dt>
@@ -388,13 +398,14 @@  discard block
 block discarded – undo
388 398
 					<dd><input type="password" name="passwd" size="30"></dd>
389 399
 				</dl>';
390 400
 
391
-	if ($context['can_activate'])
392
-		echo '
401
+	if ($context['can_activate']) {
402
+			echo '
393 403
 				<p>', $txt['invalid_activation_known'], '</p>
394 404
 				<dl>
395 405
 					<dt>', $txt['invalid_activation_retry'], ':</dt>
396 406
 					<dd><input type="text" name="code" size="30"></dd>
397 407
 				</dl>';
408
+	}
398 409
 
399 410
 	echo '
400 411
 				<p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p>
Please login to merge, or discard this patch.