Completed
Pull Request — release-2.1 (#4265)
by Rick
08:35
created
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_submit ">
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/ManageNews.template.php 1 patch
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,9 +18,10 @@  discard block
 block discarded – undo
18 18
 	global $context, $txt, $scripturl;
19 19
 
20 20
 	// Are we done sending the newsletter?
21
-	if (!empty($context['newsletter_sent']))
22
-		echo '
21
+	if (!empty($context['newsletter_sent'])) {
22
+			echo '
23 23
 	<div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>';
24
+	}
24 25
 
25 26
 	echo '
26 27
 	<div id="admincenter">
@@ -39,9 +40,10 @@  discard block
 block discarded – undo
39 40
 					</dt>
40 41
 					<dd>';
41 42
 
42
-	foreach ($context['groups'] as $group)
43
-				echo '
43
+	foreach ($context['groups'] as $group) {
44
+					echo '
44 45
 						<label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
46
+	}
45 47
 
46 48
 	echo '
47 49
 						<br>
@@ -82,9 +84,10 @@  discard block
 block discarded – undo
82 84
 						</dt>
83 85
 						<dd>';
84 86
 
85
-	foreach ($context['groups'] as $group)
86
-				echo '
87
+	foreach ($context['groups'] as $group) {
88
+					echo '
87 89
 							<label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
90
+	}
88 91
 
89 92
 	echo '
90 93
 							<br>
@@ -228,9 +231,10 @@  discard block
 block discarded – undo
228 231
 				<div id="bbcBox_message"></div>';
229 232
 
230 233
 	// What about smileys?
231
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
232
-		echo '
234
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
235
+			echo '
233 236
 				<div id="smileyBox_message"></div>';
237
+	}
234 238
 
235 239
 	// Show BBC buttons, smileys and textbox.
236 240
 	echo '
@@ -251,9 +255,10 @@  discard block
 block discarded – undo
251 255
 			<input type="hidden" name="email_force" value="', $context['email_force'], '">
252 256
 			<input type="hidden" name="total_emails" value="', $context['total_emails'], '">';
253 257
 
254
-	foreach ($context['recipients'] as $key => $values)
255
-		echo '
258
+	foreach ($context['recipients'] as $key => $values) {
259
+			echo '
256 260
 			<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
261
+	}
257 262
 
258 263
 	echo '
259 264
 		<script>';
@@ -408,9 +413,10 @@  discard block
 block discarded – undo
408 413
 				<input type="hidden" name="parse_html" value="', $context['parse_html'], '">';
409 414
 
410 415
 	// All the things we must remember!
411
-	foreach ($context['recipients'] as $key => $values)
412
-		echo '
416
+	foreach ($context['recipients'] as $key => $values) {
417
+			echo '
413 418
 				<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
419
+	}
414 420
 
415 421
 	echo '
416 422
 			</div>
@@ -443,9 +449,10 @@  discard block
 block discarded – undo
443 449
 {
444 450
 	global $context, $txt;
445 451
 
446
-	if (!empty($context['saved_successful']))
447
-		echo '
452
+	if (!empty($context['saved_successful'])) {
453
+			echo '
448 454
 					<div class="infobox">', $txt['settings_saved'], '</div>';
455
+	}
449 456
 
450 457
 	template_show_list('news_lists');
451 458
 }
Please login to merge, or discard this patch.
Themes/default/ManagePermissions.template.php 1 patch
Braces   +162 added lines, -125 removed lines patch added patch discarded remove patch
@@ -19,26 +19,28 @@  discard block
 block discarded – undo
19 19
 	global $context, $settings, $scripturl, $txt, $modSettings;
20 20
 
21 21
 	// Not allowed to edit?
22
-	if (!$context['can_modify'])
23
-		echo '
22
+	if (!$context['can_modify']) {
23
+			echo '
24 24
 	<div class="errorbox">
25 25
 		', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
26 26
 	</div>';
27
+	}
27 28
 
28 29
 	echo '
29 30
 	<div id="admin_form_wrapper">
30 31
 		<form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">';
31 32
 
32
-		if (!empty($context['profile']))
33
-			echo '
33
+		if (!empty($context['profile'])) {
34
+					echo '
34 35
 			<div class="cat_bar">
35 36
 				<h3 class="catbg">', $txt['permissions_for_profile'], ': &quot;', $context['profile']['name'], '&quot;</h3>
36 37
 			</div>';
37
-		else
38
-			echo '
38
+		} else {
39
+					echo '
39 40
 			<div class="cat_bar">
40 41
 				<h3 class="catbg">', $txt['permissions_title'], '</h3>
41 42
 			</div>';
43
+		}
42 44
 
43 45
 		echo '
44 46
 			<table class="table_grid">
@@ -47,13 +49,14 @@  discard block
 block discarded – undo
47 49
 						<th>', $txt['membergroups_name'], '</th>
48 50
 						<th class="small_table">', $txt['membergroups_members_top'], '</th>';
49 51
 
50
-			if (empty($modSettings['permission_enable_deny']))
51
-				echo '
52
+			if (empty($modSettings['permission_enable_deny'])) {
53
+							echo '
52 54
 						<th class="small_table">', $txt['membergroups_permissions'], '</th>';
53
-			else
54
-				echo '
55
+			} else {
56
+							echo '
55 57
 						<th class="small_table">', $txt['permissions_allowed'], '</th>
56 58
 						<th class="small_table">', $txt['permissions_denied'], '</th>';
59
+			}
57 60
 
58 61
 			echo '
59 62
 						<th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th>
@@ -71,22 +74,24 @@  discard block
 block discarded – undo
71 74
 						<td>
72 75
 							', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '&nbsp;<span>', $group['name'], '</span>';
73 76
 
74
-		if (!empty($group['children']))
75
-			echo '
77
+		if (!empty($group['children'])) {
78
+					echo '
76 79
 							<br>
77 80
 							<span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
81
+		}
78 82
 
79 83
 		echo '
80 84
 						</td>
81 85
 						<td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>';
82 86
 
83
-		if (empty($modSettings['permission_enable_deny']))
84
-			echo '
87
+		if (empty($modSettings['permission_enable_deny'])) {
88
+					echo '
85 89
 						<td>', $group['num_permissions']['allowed'], '</td>';
86
-		else
87
-			echo '
90
+		} else {
91
+					echo '
88 92
 						<td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>', $group['num_permissions']['allowed'], '</td>
89 93
 						<td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>';
94
+		}
90 95
 
91 96
 		echo '
92 97
 						<td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']) . '</a>' : '', '</td>
@@ -133,9 +138,10 @@  discard block
 block discarded – undo
133 138
 								<option value="empty">(', $txt['permissions_select_membergroup'], ')</option>';
134 139
 		foreach ($context['groups'] as $group)
135 140
 		{
136
-			if ($group['id'] != 1)
137
-				echo '
141
+			if ($group['id'] != 1) {
142
+							echo '
138 143
 								<option value="', $group['id'], '">', $group['name'], '</option>';
144
+			}
139 145
 		}
140 146
 
141 147
 		echo '
@@ -145,9 +151,10 @@  discard block
 block discarded – undo
145 151
 							<select name="add_remove">
146 152
 								<option value="add">', $txt['permissions_add'], '...</option>
147 153
 								<option value="clear">', $txt['permissions_remove'], '...</option>';
148
-		if (!empty($modSettings['permission_enable_deny']))
149
-			echo '
154
+		if (!empty($modSettings['permission_enable_deny'])) {
155
+					echo '
150 156
 								<option value="deny">', $txt['permissions_deny'], '...</option>';
157
+		}
151 158
 		echo '
152 159
 							</select>
153 160
 						</dt>
@@ -156,30 +163,34 @@  discard block
 block discarded – undo
156 163
 								<option value="">(', $txt['permissions_select_permission'], ')</option>';
157 164
 		foreach ($context['permissions'] as $permissionType)
158 165
 		{
159
-			if ($permissionType['id'] == 'membergroup' && !empty($context['profile']))
160
-				continue;
166
+			if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) {
167
+							continue;
168
+			}
161 169
 
162 170
 			foreach ($permissionType['columns'] as $column)
163 171
 			{
164 172
 				foreach ($column as $permissionGroup)
165 173
 				{
166
-					if ($permissionGroup['hidden'])
167
-						continue;
174
+					if ($permissionGroup['hidden']) {
175
+											continue;
176
+					}
168 177
 
169 178
 					echo '
170 179
 								<option value="" disabled>[', $permissionGroup['name'], ']</option>';
171 180
 					foreach ($permissionGroup['permissions'] as $perm)
172 181
 					{
173
-						if ($perm['hidden'])
174
-							continue;
182
+						if ($perm['hidden']) {
183
+													continue;
184
+						}
175 185
 
176
-						if ($perm['has_own_any'])
177
-							echo '
186
+						if ($perm['has_own_any']) {
187
+													echo '
178 188
 								<option value="', $permissionType['id'], '/', $perm['own']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['own']['name'], ')</option>
179 189
 								<option value="', $permissionType['id'], '/', $perm['any']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['any']['name'], ')</option>';
180
-						else
181
-							echo '
190
+						} else {
191
+													echo '
182 192
 								<option value="', $permissionType['id'], '/', $perm['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], '</option>';
193
+						}
183 194
 					}
184 195
 				}
185 196
 			}
@@ -246,17 +257,18 @@  discard block
 block discarded – undo
246 257
 		}
247 258
 	</script>';
248 259
 
249
-		if (!empty($context['profile']))
250
-			echo '
260
+		if (!empty($context['profile'])) {
261
+					echo '
251 262
 			<input type="hidden" name="pid" value="', $context['profile']['id'], '">';
263
+		}
252 264
 
253 265
 		echo '
254 266
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
255 267
 			<input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">';
256
-	}
257
-	else
258
-		echo '
268
+	} else {
269
+			echo '
259 270
 			</table>';
271
+	}
260 272
 
261 273
 	echo '
262 274
 		</form>
@@ -296,9 +308,10 @@  discard block
 block discarded – undo
296 308
 				<h3 class="subbg">', $category['name'], '</h3>
297 309
 			</div>';
298 310
 
299
-		if (!empty($category['boards']))
300
-			echo '
311
+		if (!empty($category['boards'])) {
312
+					echo '
301 313
 				<ul class="perm_boards flow_hidden">';
314
+		}
302 315
 
303 316
 		foreach ($category['boards'] as $board)
304 317
 		{
@@ -315,33 +328,36 @@  discard block
 block discarded – undo
315 328
 				echo '
316 329
 							<select name="boardprofile[', $board['id'], ']">';
317 330
 
318
-				foreach ($context['profiles'] as $id => $profile)
319
-					echo '
331
+				foreach ($context['profiles'] as $id => $profile) {
332
+									echo '
320 333
 								<option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
334
+				}
321 335
 
322 336
 				echo '
323 337
 							</select>';
324
-			}
325
-			else
326
-				echo '
338
+			} else {
339
+							echo '
327 340
 							<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>';
341
+			}
328 342
 
329 343
 			echo '
330 344
 						</span>
331 345
 					</li>';
332 346
 		}
333 347
 
334
-		if (!empty($category['boards']))
335
-			echo '
348
+		if (!empty($category['boards'])) {
349
+					echo '
336 350
 				</ul>';
351
+		}
337 352
 	}
338 353
 
339
-	if ($context['edit_all'])
340
-		echo '
354
+	if ($context['edit_all']) {
355
+			echo '
341 356
 			<input type="submit" name="save_changes" value="', $txt['save'], '" class="button_submit">';
342
-	else
343
-		echo '
357
+	} else {
358
+			echo '
344 359
 			<a class="button_link" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>';
360
+	}
345 361
 
346 362
 	echo '
347 363
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -381,12 +397,13 @@  discard block
 block discarded – undo
381 397
 					<tr class="windowbg">
382 398
 						<td>';
383 399
 
384
-		if (!empty($context['show_rename_boxes']) && $profile['can_edit'])
385
-			echo '
400
+		if (!empty($context['show_rename_boxes']) && $profile['can_edit']) {
401
+					echo '
386 402
 							<input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '">';
387
-		else
388
-			echo '
403
+		} else {
404
+					echo '
389 405
 							<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>';
406
+		}
390 407
 
391 408
 		echo '
392 409
 						</td>
@@ -406,9 +423,10 @@  discard block
 block discarded – undo
406 423
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
407 424
 				<input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">';
408 425
 
409
-	if ($context['can_edit_something'])
410
-		echo '
426
+	if ($context['can_edit_something']) {
427
+			echo '
411 428
 				<input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button_submit">';
429
+	}
412 430
 
413 431
 	echo '
414 432
 				<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button_submit" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/>
@@ -433,9 +451,10 @@  discard block
 block discarded – undo
433 451
 					<dd>
434 452
 						<select name="copy_from">';
435 453
 
436
-	foreach ($context['profiles'] as $id => $profile)
437
-		echo '
454
+	foreach ($context['profiles'] as $id => $profile) {
455
+			echo '
438 456
 							<option value="', $id, '">', $profile['name'], '</option>';
457
+	}
439 458
 
440 459
 	echo '
441 460
 						</select>
@@ -463,8 +482,7 @@  discard block
 block discarded – undo
463 482
 		<div class="errorbox">
464 483
 			', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
465 484
 		</div>';
466
-	}
467
-	else
485
+	} else
468 486
 	{
469 487
 		echo '
470 488
 		<script>
@@ -484,21 +502,23 @@  discard block
 block discarded – undo
484 502
 	<div id="admincenter">
485 503
 		<form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">';
486 504
 
487
-	if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1)
488
-		echo '
505
+	if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) {
506
+			echo '
489 507
 			<div class="information">
490 508
 				', $txt['permissions_option_desc'], '
491 509
 			</div>';
510
+	}
492 511
 
493 512
 	echo '
494 513
 			<div class="cat_bar">
495 514
 				<h3 class="catbg">';
496
-	if ($context['permission_type'] == 'board')
497
-		echo '
515
+	if ($context['permission_type'] == 'board') {
516
+			echo '
498 517
 				', $txt['permissions_local_for'], ' &quot;', $context['group']['name'], '&quot; ', $txt['permissions_on'], ' &quot;', $context['profile']['name'], '&quot;';
499
-	else
500
-		echo '
518
+	} else {
519
+			echo '
501 520
 				', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - &quot;', $context['group']['name'], '&quot;';
521
+	}
502 522
 	echo '
503 523
 				</h3>
504 524
 			</div>';
@@ -521,15 +541,17 @@  discard block
 block discarded – undo
521 541
 		template_modify_group_display('board');
522 542
 	}
523 543
 
524
-	if ($context['profile']['can_modify'])
525
-		echo '
544
+	if ($context['profile']['can_modify']) {
545
+			echo '
526 546
 			<div class="padding">
527 547
 				<input type="submit" value="', $txt['permissions_commit'], '" class="button_submit">
528 548
 			</div>';
549
+	}
529 550
 
530
-	foreach ($context['hidden_perms'] as $hidden_perm)
531
-		echo '
551
+	foreach ($context['hidden_perms'] as $hidden_perm) {
552
+			echo '
532 553
 			<input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">';
554
+	}
533 555
 
534 556
 	echo '
535 557
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -557,17 +579,19 @@  discard block
 block discarded – undo
557 579
 
558 580
 		foreach ($column as $permissionGroup)
559 581
 		{
560
-			if (empty($permissionGroup['permissions']))
561
-				continue;
582
+			if (empty($permissionGroup['permissions'])) {
583
+							continue;
584
+			}
562 585
 
563 586
 			// Are we likely to have something in this group to display or is it all hidden?
564 587
 			$has_display_content = false;
565 588
 			if (!$permissionGroup['hidden'])
566 589
 			{
567 590
 				// Before we go any further check we are going to have some data to print otherwise we just have a silly heading.
568
-				foreach ($permissionGroup['permissions'] as $permission)
569
-					if (!$permission['hidden'])
591
+				foreach ($permissionGroup['permissions'] as $permission) {
592
+									if (!$permission['hidden'])
570 593
 						$has_display_content = true;
594
+				}
571 595
 
572 596
 				if ($has_display_content)
573 597
 				{
@@ -576,10 +600,11 @@  discard block
 block discarded – undo
576 600
 							<th></th>
577 601
 							<th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>';
578 602
 
579
-					if ($context['group']['id'] != -1)
580
-						echo '
603
+					if ($context['group']['id'] != -1) {
604
+											echo '
581 605
 							<th>', $txt['permissions_option_own'], '</th>
582 606
 							<th>', $txt['permissions_option_any'], '</th>';
607
+					}
583 608
 
584 609
 						echo '
585 610
 						</tr>';
@@ -602,17 +627,18 @@  discard block
 block discarded – undo
602 627
 						// Guests can't do their own thing.
603 628
 						if ($context['group']['id'] != -1)
604 629
 						{
605
-							if (empty($modSettings['permission_enable_deny']))
606
-								echo '
630
+							if (empty($modSettings['permission_enable_deny'])) {
631
+															echo '
607 632
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" ', $disable_field, '/>';
608
-							else
633
+							} else
609 634
 							{
610 635
 								echo '
611 636
 								<select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>';
612 637
 
613
-								foreach (array('on', 'off', 'deny') as $c)
614
-									echo '
638
+								foreach (array('on', 'off', 'deny') as $c) {
639
+																	echo '
615 640
 									<option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
641
+								}
616 642
 							echo '
617 643
 								</select>';
618 644
 							}
@@ -622,39 +648,41 @@  discard block
 block discarded – undo
622 648
 							<td>';
623 649
 						}
624 650
 
625
-						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
626
-							echo '
651
+						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) {
652
+													echo '
627 653
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '/>';
628
-						else
654
+						} else
629 655
 						{
630 656
 							echo '
631 657
 								<select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>';
632 658
 
633
-							foreach (array('on', 'off', 'deny') as $c)
634
-								echo '
659
+							foreach (array('on', 'off', 'deny') as $c) {
660
+															echo '
635 661
 									<option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
662
+							}
636 663
 							echo '
637 664
 								</select>';
638 665
 						}
639
-					}
640
-					else
666
+					} else
641 667
 					{
642
-						if ($context['group']['id'] != -1)
643
-							echo '
668
+						if ($context['group']['id'] != -1) {
669
+													echo '
644 670
 							</td>
645 671
 							<td>';
672
+						}
646 673
 
647
-						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
648
-							echo '
674
+						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) {
675
+													echo '
649 676
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" ', $disable_field, '/>';
650
-						else
677
+						} else
651 678
 						{
652 679
 							echo '
653 680
 								<select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>';
654 681
 
655
-							foreach (array('on', 'off', 'deny') as $c)
656
-								echo '
682
+							foreach (array('on', 'off', 'deny') as $c) {
683
+															echo '
657 684
 									<option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
685
+							}
658 686
 							echo '
659 687
 								</select>';
660 688
 						}
@@ -684,11 +712,11 @@  discard block
 block discarded – undo
684 712
 	echo '
685 713
 											<fieldset id="', $context['current_permission'], '">
686 714
 												<legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>';
687
-	if (empty($modSettings['permission_enable_deny']))
688
-		echo '
715
+	if (empty($modSettings['permission_enable_deny'])) {
716
+			echo '
689 717
 												<ul>';
690
-	else
691
-		echo '
718
+	} else {
719
+			echo '
692 720
 												<div class="information">', $txt['permissions_option_desc'], '</div>
693 721
 												<dl class="settings">
694 722
 													<dt>
@@ -698,46 +726,51 @@  discard block
 block discarded – undo
698 726
 													</dt>
699 727
 													<dd>
700 728
 													</dd>';
729
+	}
701 730
 	foreach ($context['member_groups'] as $group)
702 731
 	{
703
-		if (!empty($modSettings['permission_enable_deny']))
704
-			echo '
732
+		if (!empty($modSettings['permission_enable_deny'])) {
733
+					echo '
705 734
 													<dt>';
706
-		else
707
-			echo '
735
+		} else {
736
+					echo '
708 737
 													<li>';
738
+		}
709 739
 
710
-		if (empty($modSettings['permission_enable_deny']))
711
-			echo '
740
+		if (empty($modSettings['permission_enable_deny'])) {
741
+					echo '
712 742
 														<input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '>';
713
-		else
714
-			echo '
743
+		} else {
744
+					echo '
715 745
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', '></span>
716 746
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', '></span>
717 747
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', '></span>';
748
+		}
718 749
 
719
-		if (!empty($modSettings['permission_enable_deny']))
720
-			echo '
750
+		if (!empty($modSettings['permission_enable_deny'])) {
751
+					echo '
721 752
 													</dt>
722 753
 													<dd>
723 754
 														<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
724 755
 													</dd>';
725
-		else
726
-			echo '
756
+		} else {
757
+					echo '
727 758
 														<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
728 759
 													</li>';
760
+		}
729 761
 	}
730 762
 
731
-	if (empty($modSettings['permission_enable_deny']))
732
-		echo '
763
+	if (empty($modSettings['permission_enable_deny'])) {
764
+			echo '
733 765
 													<li>
734 766
 														<input type="checkbox" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');">
735 767
 														<span>', $txt['check_all'], '</span>
736 768
 													</li>
737 769
 												</ul>';
738
-	else
739
-		echo '
770
+	} else {
771
+			echo '
740 772
 												</dl>';
773
+	}
741 774
 
742 775
 	echo '
743 776
 											</fieldset>
@@ -777,9 +810,10 @@  discard block
 block discarded – undo
777 810
 	if (!empty($modSettings['postmod_active']))
778 811
 	{
779 812
 		// Got advanced permissions - if so warn!
780
-		if (!empty($modSettings['permission_enable_deny']))
781
-			echo '
813
+		if (!empty($modSettings['permission_enable_deny'])) {
814
+					echo '
782 815
 							<div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>';
816
+		}
783 817
 
784 818
 		echo '
785 819
 							<div class="padding">
@@ -794,10 +828,11 @@  discard block
 block discarded – undo
794 828
 									', $txt['permissions_post_moderation_select'], ':
795 829
 									<select name="pid" onchange="document.forms.postmodForm.submit();">';
796 830
 
797
-		foreach ($context['profiles'] as $profile)
798
-			if ($profile['can_modify'])
831
+		foreach ($context['profiles'] as $profile) {
832
+					if ($profile['can_modify'])
799 833
 				echo '
800 834
 										<option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
835
+		}
801 836
 
802 837
 		echo '
803 838
 									</select>
@@ -818,11 +853,12 @@  discard block
 block discarded – undo
818 853
 											', $txt['permissions_post_moderation_replies_any'], '
819 854
 										</th>';
820 855
 
821
-		if ($modSettings['attachmentEnable'] == 1)
822
-			echo '
856
+		if ($modSettings['attachmentEnable'] == 1) {
857
+					echo '
823 858
 										<th class="centercol" colspan="3">
824 859
 											', $txt['permissions_post_moderation_attachments'], '
825 860
 										</th>';
861
+		}
826 862
 
827 863
 		echo '
828 864
 									</tr>
@@ -840,11 +876,12 @@  discard block
 block discarded – undo
840 876
 										<th><span class="generic_icons post_moderation_moderate"></span></th>
841 877
 										<th><span class="generic_icons post_moderation_deny"></span></th>';
842 878
 
843
-		if ($modSettings['attachmentEnable'] == 1)
844
-			echo '
879
+		if ($modSettings['attachmentEnable'] == 1) {
880
+					echo '
845 881
 										<th><span class="generic_icons post_moderation_allow"></span></th>
846 882
 										<th><span class="generic_icons post_moderation_moderate"></span></th>
847 883
 										<th><span class="generic_icons post_moderation_deny"></span></th>';
884
+		}
848 885
 
849 886
 		echo '
850 887
 									</tr>
@@ -857,9 +894,10 @@  discard block
 block discarded – undo
857 894
 									<tr class="windowbg">
858 895
 										<td class="half_table">
859 896
 											<span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>';
860
-				if (!empty($group['children']))
861
-					echo '
897
+				if (!empty($group['children'])) {
898
+									echo '
862 899
 											<br><span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
900
+				}
863 901
 
864 902
 				echo '
865 903
 										</td>
@@ -872,8 +910,7 @@  discard block
 block discarded – undo
872 910
 				{
873 911
 				echo '
874 912
 										<td colspan="3"></td>';
875
-				}
876
-				else
913
+				} else
877 914
 				{
878 915
 					echo '
879 916
 										<td class="centercol"><input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', '></td>
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 1 patch
Braces   +173 added lines, -125 removed lines patch added patch discarded remove patch
@@ -64,9 +64,10 @@  discard block
 block discarded – undo
64 64
 										<strong>', $txt['administrators'], ':</strong>
65 65
 										', implode(', ', $context['administrators']);
66 66
 	// If we have lots of admins... don't show them all.
67
-	if (!empty($context['more_admins_link']))
68
-		echo '
67
+	if (!empty($context['more_admins_link'])) {
68
+			echo '
69 69
 							(', $context['more_admins_link'], ')';
70
+	}
70 71
 
71 72
 	echo '
72 73
 									</div>
@@ -83,16 +84,18 @@  discard block
 block discarded – undo
83 84
 		foreach ($area['areas'] as $item_id => $item)
84 85
 		{
85 86
 			// No point showing the 'home' page here, we're already on it!
86
-			if ($area_id == 'forum' && $item_id == 'index')
87
-				continue;
87
+			if ($area_id == 'forum' && $item_id == 'index') {
88
+							continue;
89
+			}
88 90
 
89 91
 			$url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : '');
90
-			if (!empty($item['icon_file']))
91
-				echo '
92
+			if (!empty($item['icon_file'])) {
93
+							echo '
92 94
 							<a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>';
93
-			else
94
-				echo '
95
+			} else {
96
+							echo '
95 97
 							<a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>';
98
+			}
96 99
 		}
97 100
 
98 101
 		echo '
@@ -103,10 +106,11 @@  discard block
 block discarded – undo
103 106
 					</div>';
104 107
 
105 108
 	// The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization.
106
-	if (empty($modSettings['disable_smf_js']))
107
-		echo '
109
+	if (empty($modSettings['disable_smf_js'])) {
110
+			echo '
108 111
 					<script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
109 112
 					<script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
113
+	}
110 114
 
111 115
 	// This sets the announcements and current versions themselves ;).
112 116
 	echo '
@@ -185,9 +189,10 @@  discard block
 block discarded – undo
185 189
 								<em>', $version['version'], '</em>';
186 190
 
187 191
 		// more details for this item, show them a link
188
-		if ($context['can_admin'] && isset($version['more']))
189
-			echo
192
+		if ($context['can_admin'] && isset($version['more'])) {
193
+					echo
190 194
 								' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>';
195
+		}
191 196
 		echo '
192 197
 								<br>';
193 198
 	}
@@ -218,20 +223,22 @@  discard block
 block discarded – undo
218 223
 
219 224
 	foreach ($context['credits'] as $section)
220 225
 	{
221
-		if (isset($section['pretext']))
222
-			echo '
226
+		if (isset($section['pretext'])) {
227
+					echo '
223 228
 								<p>', $section['pretext'], '</p><hr>';
229
+		}
224 230
 
225 231
 		echo '
226 232
 								<dl>';
227 233
 
228 234
 		foreach ($section['groups'] as $group)
229 235
 		{
230
-			if (isset($group['title']))
231
-				echo '
236
+			if (isset($group['title'])) {
237
+							echo '
232 238
 									<dt>
233 239
 										<strong>', $group['title'], ':</strong>
234 240
 									</dt>';
241
+			}
235 242
 
236 243
 			echo '
237 244
 									<dd>', implode(', ', $group['members']), '</dd>';
@@ -240,10 +247,11 @@  discard block
 block discarded – undo
240 247
 		echo '
241 248
 								</dl>';
242 249
 
243
-		if (isset($section['posttext']))
244
-			echo '
250
+		if (isset($section['posttext'])) {
251
+					echo '
245 252
 								<hr>
246 253
 								<p>', $section['posttext'], '</p>';
254
+		}
247 255
 	}
248 256
 
249 257
 	echo '
@@ -259,9 +267,10 @@  discard block
 block discarded – undo
259 267
 							smfSupportVersions.forum = "', $context['forum_version'], '";';
260 268
 
261 269
 	// Don't worry, none of this is logged, it's just used to give information that might be of use.
262
-	foreach ($context['current_versions'] as $variable => $version)
263
-		echo '
270
+	foreach ($context['current_versions'] as $variable => $version) {
271
+			echo '
264 272
 							smfSupportVersions.', $variable, ' = "', $version['version'], '";';
273
+	}
265 274
 
266 275
 	// Now we just have to include the script and wait ;).
267 276
 	echo '
@@ -358,8 +367,8 @@  discard block
 block discarded – undo
358 367
 							<tbody>';
359 368
 
360 369
 	// Loop through every source file displaying its version - using javascript.
361
-	foreach ($context['file_versions'] as $filename => $version)
362
-		echo '
370
+	foreach ($context['file_versions'] as $filename => $version) {
371
+			echo '
363 372
 								<tr class="windowbg">
364 373
 									<td class="half_table">
365 374
 										', $filename, '
@@ -371,6 +380,7 @@  discard block
 block discarded – undo
371 380
 										<em id="currentSources', $filename, '">??</em>
372 381
 									</td>
373 382
 								</tr>';
383
+	}
374 384
 
375 385
 	// Default template files.
376 386
 	echo '
@@ -396,8 +406,8 @@  discard block
 block discarded – undo
396 406
 							<table id="Default" class="table_grid">
397 407
 								<tbody>';
398 408
 
399
-	foreach ($context['default_template_versions'] as $filename => $version)
400
-		echo '
409
+	foreach ($context['default_template_versions'] as $filename => $version) {
410
+			echo '
401 411
 									<tr class="windowbg">
402 412
 										<td class="half_table">
403 413
 											', $filename, '
@@ -409,6 +419,7 @@  discard block
 block discarded – undo
409 419
 											<em id="currentDefault', $filename, '">??</em>
410 420
 										</td>
411 421
 									</tr>';
422
+	}
412 423
 
413 424
 	// Now the language files...
414 425
 	echo '
@@ -436,8 +447,8 @@  discard block
 block discarded – undo
436 447
 
437 448
 	foreach ($context['default_language_versions'] as $language => $files)
438 449
 	{
439
-		foreach ($files as $filename => $version)
440
-			echo '
450
+		foreach ($files as $filename => $version) {
451
+					echo '
441 452
 									<tr class="windowbg">
442 453
 										<td class="half_table">
443 454
 											', $filename, '.<em>', $language, '</em>.php
@@ -449,6 +460,7 @@  discard block
 block discarded – undo
449 460
 											<em id="current', $filename, '.', $language, '">??</em>
450 461
 										</td>
451 462
 									</tr>';
463
+		}
452 464
 	}
453 465
 
454 466
 	echo '
@@ -478,8 +490,8 @@  discard block
 block discarded – undo
478 490
 							<table id="Templates" class="table_grid">
479 491
 								<tbody>';
480 492
 
481
-		foreach ($context['template_versions'] as $filename => $version)
482
-			echo '
493
+		foreach ($context['template_versions'] as $filename => $version) {
494
+					echo '
483 495
 									<tr class="windowbg">
484 496
 										<td class="half_table">
485 497
 											', $filename, '
@@ -491,6 +503,7 @@  discard block
 block discarded – undo
491 503
 											<em id="currentTemplates', $filename, '">??</em>
492 504
 										</td>
493 505
 									</tr>';
506
+		}
494 507
 
495 508
 		echo '
496 509
 								</tbody>
@@ -520,8 +533,8 @@  discard block
 block discarded – undo
520 533
 							<table id="Tasks" class="table_grid">
521 534
 								<tbody>';
522 535
 
523
-		foreach ($context['tasks_versions'] as $filename => $version)
524
-			echo '
536
+		foreach ($context['tasks_versions'] as $filename => $version) {
537
+					echo '
525 538
 									<tr class="windowbg">
526 539
 										<td class="half_table">
527 540
 											', $filename, '
@@ -533,6 +546,7 @@  discard block
 block discarded – undo
533 546
 											<em id="currentTasks', $filename, '">??</em>
534 547
 										</td>
535 548
 									</tr>';
549
+		}
536 550
 
537 551
 		echo '
538 552
 								</tbody>
@@ -574,9 +588,10 @@  discard block
 block discarded – undo
574 588
 {
575 589
 	global $context, $scripturl, $txt, $modSettings;
576 590
 
577
-	if (!empty($context['saved_successful']))
578
-		echo '
591
+	if (!empty($context['saved_successful'])) {
592
+			echo '
579 593
 					<div class="infobox">', $txt['settings_saved'], '</div>';
594
+	}
580 595
 
581 596
 	// First section is for adding/removing words from the censored list.
582 597
 	echo '
@@ -591,11 +606,12 @@  discard block
 block discarded – undo
591 606
 								<p>', $txt['admin_censored_where'], '</p>';
592 607
 
593 608
 	// Show text boxes for censoring [bad   ] => [good  ].
594
-	foreach ($context['censored_words'] as $vulgar => $proper)
595
-		echo '
609
+	foreach ($context['censored_words'] as $vulgar => $proper) {
610
+			echo '
596 611
 								<div class="block">
597 612
 									<input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> =&gt; <input type="text" name="censor_proper[]" value="', $proper, '" size="30">
598 613
 								</div>';
614
+	}
599 615
 
600 616
 	// Now provide a way to censor more words.
601 617
 	echo '
@@ -669,19 +685,21 @@  discard block
 block discarded – undo
669 685
 						<div class="windowbg2 noup">
670 686
 							', $txt['not_done_reason'];
671 687
 
672
-	if (!empty($context['continue_percent']))
673
-		echo '
688
+	if (!empty($context['continue_percent'])) {
689
+			echo '
674 690
 							<div class="progress_bar">
675 691
 								<div class="full_bar">', $context['continue_percent'], '%</div>
676 692
 								<div class="green_percent" style="width: ', $context['continue_percent'], '%;">&nbsp;</div>
677 693
 							</div>';
694
+	}
678 695
 
679
-	if (!empty($context['substep_enabled']))
680
-		echo '
696
+	if (!empty($context['substep_enabled'])) {
697
+			echo '
681 698
 							<div class="progress_bar">
682 699
 								<div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div>
683 700
 								<div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;">&nbsp;</div>
684 701
 							</div>';
702
+	}
685 703
 
686 704
 	echo '
687 705
 							<form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
@@ -716,35 +734,40 @@  discard block
 block discarded – undo
716 734
 {
717 735
 	global $context, $txt, $scripturl;
718 736
 
719
-	if (!empty($context['saved_successful']))
720
-		echo '
737
+	if (!empty($context['saved_successful'])) {
738
+			echo '
721 739
 					<div class="infobox">', $txt['settings_saved'], '</div>';
722
-	elseif (!empty($context['saved_failed']))
723
-		echo '
740
+	} elseif (!empty($context['saved_failed'])) {
741
+			echo '
724 742
 					<div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>';
743
+	}
725 744
 
726
-	if (!empty($context['settings_pre_javascript']))
727
-		echo '
745
+	if (!empty($context['settings_pre_javascript'])) {
746
+			echo '
728 747
 					<script>', $context['settings_pre_javascript'], '</script>';
748
+	}
729 749
 
730
-	if (!empty($context['settings_insert_above']))
731
-		echo $context['settings_insert_above'];
750
+	if (!empty($context['settings_insert_above'])) {
751
+			echo $context['settings_insert_above'];
752
+	}
732 753
 
733 754
 	echo '
734 755
 					<div id="admincenter">
735 756
 						<form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
736 757
 
737 758
 	// Is there a custom title?
738
-	if (isset($context['settings_title']))
739
-		echo '
759
+	if (isset($context['settings_title'])) {
760
+			echo '
740 761
 							<div class="cat_bar">
741 762
 								<h3 class="catbg">', $context['settings_title'], '</h3>
742 763
 							</div>';
764
+	}
743 765
 
744 766
 	// Have we got a message to display?
745
-	if (!empty($context['settings_message']))
746
-		echo '
767
+	if (!empty($context['settings_message'])) {
768
+			echo '
747 769
 							<div class="information">', $context['settings_message'], '</div>';
770
+	}
748 771
 
749 772
 	// Now actually loop through all the variables.
750 773
 	$is_open = false;
@@ -797,8 +820,9 @@  discard block
 block discarded – undo
797 820
 		// Hang about? Are you pulling my leg - a callback?!
798 821
 		if (is_array($config_var) && $config_var['type'] == 'callback')
799 822
 		{
800
-			if (function_exists('template_callback_' . $config_var['name']))
801
-				call_user_func('template_callback_' . $config_var['name']);
823
+			if (function_exists('template_callback_' . $config_var['name'])) {
824
+							call_user_func('template_callback_' . $config_var['name']);
825
+			}
802 826
 
803 827
 			continue;
804 828
 		}
@@ -828,9 +852,10 @@  discard block
 block discarded – undo
828 852
 				$text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time');
829 853
 
830 854
 				// Show the [?] button.
831
-				if ($config_var['help'])
832
-					echo '
855
+				if ($config_var['help']) {
856
+									echo '
833 857
 							<a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ';
858
+				}
834 859
 
835 860
 				echo '
836 861
 										<a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
@@ -839,22 +864,25 @@  discard block
 block discarded – undo
839 864
 										$config_var['preinput'];
840 865
 
841 866
 				// Show a check box.
842
-				if ($config_var['type'] == 'check')
843
-					echo '
867
+				if ($config_var['type'] == 'check') {
868
+									echo '
844 869
 										<input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">';
870
+				}
845 871
 				// Escape (via htmlspecialchars.) the text box.
846
-				elseif ($config_var['type'] == 'password')
847
-					echo '
872
+				elseif ($config_var['type'] == 'password') {
873
+									echo '
848 874
 										<input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br>
849 875
 										<input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>';
876
+				}
850 877
 				// Show a selection box.
851 878
 				elseif ($config_var['type'] == 'select')
852 879
 				{
853 880
 					echo '
854 881
 										<select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>';
855
-					foreach ($config_var['data'] as $option)
856
-						echo '
882
+					foreach ($config_var['data'] as $option) {
883
+											echo '
857 884
 											<option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>';
885
+					}
858 886
 					echo '
859 887
 										</select>';
860 888
 				}
@@ -868,15 +896,17 @@  discard block
 block discarded – undo
868 896
 												<legend class="board_selector"><a href="#">', $txt['select_boards_from_list'], '</a></legend>';
869 897
 					foreach ($context['board_list'] as $id_cat => $cat)
870 898
 					{
871
-						if (!$first)
872
-							echo '
899
+						if (!$first) {
900
+													echo '
873 901
 											<hr>';
902
+						}
874 903
 						echo '
875 904
 											<strong>', $cat['name'], '</strong>
876 905
 											<ul>';
877
-						foreach ($cat['boards'] as $id_board => $brd)
878
-							echo '
906
+						foreach ($cat['boards'] as $id_board => $brd) {
907
+													echo '
879 908
 												<li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat('&nbsp; &nbsp;', $brd['child_level']) : '', $brd['name'], '</label></li>';
909
+						}
880 910
 
881 911
 						echo '
882 912
 											</ul>';
@@ -886,12 +916,14 @@  discard block
 block discarded – undo
886 916
 											</fieldset>';
887 917
 				}
888 918
 				// Text area?
889
-				elseif ($config_var['type'] == 'large_text')
890
-					echo '
919
+				elseif ($config_var['type'] == 'large_text') {
920
+									echo '
891 921
 											<textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>';
922
+				}
892 923
 				// Permission group?
893
-				elseif ($config_var['type'] == 'permissions')
894
-					theme_inline_permissions($config_var['name']);
924
+				elseif ($config_var['type'] == 'permissions') {
925
+									theme_inline_permissions($config_var['name']);
926
+				}
895 927
 				// BBC selection?
896 928
 				elseif ($config_var['type'] == 'bbc')
897 929
 				{
@@ -902,20 +934,22 @@  discard block
 block discarded – undo
902 934
 
903 935
 					foreach ($context['bbc_columns'] as $bbcColumn)
904 936
 					{
905
-						foreach ($bbcColumn as $bbcTag)
906
-							echo '
937
+						foreach ($bbcColumn as $bbcTag) {
938
+													echo '
907 939
 														<li class="list_bbc floatleft">
908 940
 															<input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', '
909 941
 														</li>';
942
+						}
910 943
 					}
911 944
 					echo '							</ul>
912 945
 												<input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label>
913 946
 											</fieldset>';
914 947
 				}
915 948
 				// A simple message?
916
-				elseif ($config_var['type'] == 'var_message')
917
-					echo '
949
+				elseif ($config_var['type'] == 'var_message') {
950
+									echo '
918 951
 											<div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>';
952
+				}
919 953
 				// Assume it must be a text box
920 954
 				else
921 955
 				{
@@ -940,63 +974,70 @@  discard block
 block discarded – undo
940 974
 											' . $config_var['postinput'] : '',
941 975
 										'</dd>';
942 976
 			}
943
-		}
944
-
945
-		else
977
+		} else
946 978
 		{
947 979
 			// Just show a separator.
948
-			if ($config_var == '')
949
-				echo '
980
+			if ($config_var == '') {
981
+							echo '
950 982
 								</dl>
951 983
 								<hr>
952 984
 								<dl class="settings">';
953
-			else
954
-				echo '
985
+			} else {
986
+							echo '
955 987
 									<dd>
956 988
 										<strong>' . $config_var . '</strong>
957 989
 									</dd>';
990
+			}
958 991
 		}
959 992
 	}
960 993
 
961
-	if ($is_open)
962
-		echo '
994
+	if ($is_open) {
995
+			echo '
963 996
 								</dl>';
997
+	}
964 998
 
965
-	if (empty($context['settings_save_dont_show']))
966
-		echo '
999
+	if (empty($context['settings_save_dont_show'])) {
1000
+			echo '
967 1001
 								<input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button_submit">';
1002
+	}
968 1003
 
969
-	if ($is_open)
970
-		echo '
1004
+	if ($is_open) {
1005
+			echo '
971 1006
 							</div>';
1007
+	}
972 1008
 
973 1009
 
974 1010
 	// At least one token has to be used!
975
-	if (isset($context['admin-ssc_token']))
976
-		echo '
1011
+	if (isset($context['admin-ssc_token'])) {
1012
+			echo '
977 1013
 							<input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">';
1014
+	}
978 1015
 
979
-	if (isset($context['admin-dbsc_token']))
980
-		echo '
1016
+	if (isset($context['admin-dbsc_token'])) {
1017
+			echo '
981 1018
 							<input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">';
1019
+	}
982 1020
 
983
-	if (isset($context['admin-mp_token']))
984
-		echo '
1021
+	if (isset($context['admin-mp_token'])) {
1022
+			echo '
985 1023
 							<input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">';
1024
+	}
986 1025
 
987 1026
 	echo '
988 1027
 							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
989 1028
 						</form>
990 1029
 					</div>';
991 1030
 
992
-	if (!empty($context['settings_post_javascript']))
993
-		echo '
1031
+	if (!empty($context['settings_post_javascript'])) {
1032
+			echo '
994 1033
 					<script>
995 1034
 					', $context['settings_post_javascript'], '
996 1035
 					</script>';
1036
+	}
997 1037
 
998
-	if (!empty($context['settings_insert_below']))
999
-		echo $context['settings_insert_below'];
1038
+	if (!empty($context['settings_insert_below'])) {
1039
+			echo $context['settings_insert_below'];
1040
+	}
1000 1041
 
1001 1042
 	// We may have added a board listing. If we did, we need to make it work.
1002 1043
 	addInlineJavascript('
@@ -1019,9 +1060,10 @@  discard block
 block discarded – undo
1019 1060
 {
1020 1061
 	global $context, $txt;
1021 1062
 
1022
-	if (!empty($context['saved_successful']))
1023
-		echo '
1063
+	if (!empty($context['saved_successful'])) {
1064
+			echo '
1024 1065
 					<div class="infobox">', $txt['settings_saved'], '</div>';
1066
+	}
1025 1067
 
1026 1068
 	// Standard fields.
1027 1069
 	template_show_list('standard_profile_fields');
@@ -1053,11 +1095,12 @@  discard block
 block discarded – undo
1053 1095
 	if (isset($_GET['msg']))
1054 1096
 	{
1055 1097
 		loadLanguage('Errors');
1056
-		if (isset($txt['custom_option_' . $_GET['msg']]))
1057
-			echo '
1098
+		if (isset($txt['custom_option_' . $_GET['msg']])) {
1099
+					echo '
1058 1100
 					<div class="errorbox">',
1059 1101
 						$txt['custom_option_' . $_GET['msg']], '
1060 1102
 					</div>';
1103
+		}
1061 1104
 	}
1062 1105
 
1063 1106
 	echo '
@@ -1123,9 +1166,10 @@  discard block
 block discarded – undo
1123 1166
 										<dd>
1124 1167
 											<select name="placement" id="placement">';
1125 1168
 
1126
-	foreach ($context['cust_profile_fields_placement'] as $order => $name)
1127
-		echo '
1169
+	foreach ($context['cust_profile_fields_placement'] as $order => $name) {
1170
+			echo '
1128 1171
 												<option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>';
1172
+	}
1129 1173
 
1130 1174
 	echo '
1131 1175
 											</select>
@@ -1148,9 +1192,10 @@  discard block
 block discarded – undo
1148 1192
 										</dt>
1149 1193
 										<dd>
1150 1194
 											<select name="field_type" id="field_type" onchange="updateInputBoxes();">';
1151
-	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type)
1152
-		echo '
1195
+	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) {
1196
+			echo '
1153 1197
 												<option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>';
1198
+	}
1154 1199
 
1155 1200
 	echo '
1156 1201
 											</select>
@@ -1251,9 +1296,10 @@  discard block
 block discarded – undo
1251 1296
 								</fieldset>
1252 1297
 									<input type="submit" name="save" value="', $txt['save'], '" class="button_submit">';
1253 1298
 
1254
-	if ($context['fid'])
1255
-		echo '
1299
+	if ($context['fid']) {
1300
+			echo '
1256 1301
 									<input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button_submit you_sure">';
1302
+	}
1257 1303
 
1258 1304
 	echo '
1259 1305
 							</div>
@@ -1296,8 +1342,7 @@  discard block
 block discarded – undo
1296 1342
 	{
1297 1343
 		echo '
1298 1344
 						<p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>';
1299
-	}
1300
-	else
1345
+	} else
1301 1346
 	{
1302 1347
 		echo '
1303 1348
 						<ol class="search_results">';
@@ -1323,9 +1368,10 @@  discard block
 block discarded – undo
1323 1368
 							<li>
1324 1369
 								<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']';
1325 1370
 
1326
-				if ($result['help'])
1327
-					echo '
1371
+				if ($result['help']) {
1372
+									echo '
1328 1373
 								<p class="double_height">', $result['help'], '</p>';
1374
+				}
1329 1375
 
1330 1376
 				echo '
1331 1377
 							</li>';
@@ -1365,18 +1411,20 @@  discard block
 block discarded – undo
1365 1411
 									<strong>', $txt['setup_verification_answer'], '</strong>
1366 1412
 								</dd>';
1367 1413
 
1368
-		if (!empty($context['qa_by_lang'][$lang_id]))
1369
-			foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1414
+		if (!empty($context['qa_by_lang'][$lang_id])) {
1415
+					foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1370 1416
 			{
1371 1417
 				$question = $context['question_answers'][$q_id];
1418
+		}
1372 1419
 				echo '
1373 1420
 								<dt>
1374 1421
 									<input type="text" name="question[', $lang_id, '][', $q_id, ']" value="', $question['question'], '" size="50" class="verification_question">
1375 1422
 								</dt>
1376 1423
 								<dd>';
1377
-				foreach ($question['answers'] as $answer)
1378
-					echo '
1424
+				foreach ($question['answers'] as $answer) {
1425
+									echo '
1379 1426
 									<input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">';
1427
+				}
1380 1428
 
1381 1429
 				echo '
1382 1430
 									<div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div>
@@ -1415,11 +1463,12 @@  discard block
 block discarded – undo
1415 1463
 							', $txt['errors_found'], ':
1416 1464
 							<ul>';
1417 1465
 
1418
-			foreach ($context['repair_errors'] as $error)
1419
-				echo '
1466
+			foreach ($context['repair_errors'] as $error) {
1467
+							echo '
1420 1468
 								<li>
1421 1469
 									', $error, '
1422 1470
 								</li>';
1471
+			}
1423 1472
 
1424 1473
 			echo '
1425 1474
 							</ul>
@@ -1429,16 +1478,15 @@  discard block
 block discarded – undo
1429 1478
 							<p class="padding">
1430 1479
 								<strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong>
1431 1480
 							</p>';
1432
-		}
1433
-		else
1434
-			echo '
1481
+		} else {
1482
+					echo '
1435 1483
 							<p>', $txt['maintain_no_errors'], '</p>
1436 1484
 							<p class="padding">
1437 1485
 								<a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
1438 1486
 							</p>';
1487
+		}
1439 1488
 
1440
-	}
1441
-	else
1489
+	} else
1442 1490
 	{
1443 1491
 		if (!empty($context['redirect_to_recount']))
1444 1492
 		{
@@ -1450,8 +1498,7 @@  discard block
 block discarded – undo
1450 1498
 								<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1451 1499
 								<input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '">
1452 1500
 							</form>';
1453
-		}
1454
-		else
1501
+		} else
1455 1502
 		{
1456 1503
 			echo '
1457 1504
 							<p>', $txt['errors_fixed'], '</p>
@@ -1603,8 +1650,8 @@  discard block
 block discarded – undo
1603 1650
 function template_admin_quick_search()
1604 1651
 {
1605 1652
 	global $context, $txt;
1606
-	if ($context['user']['is_admin'])
1607
-		echo '
1653
+	if ($context['user']['is_admin']) {
1654
+			echo '
1608 1655
 								<span class="floatright admin_search">
1609 1656
 									<span class="generic_icons filter centericon"></span>
1610 1657
 									<input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';">
@@ -1615,6 +1662,7 @@  discard block
 block discarded – undo
1615 1662
 									</select>
1616 1663
 									<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit">
1617 1664
 								</span>';
1618
-}
1665
+	}
1666
+	}
1619 1667
 
1620 1668
 ?>
1621 1669
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/ManageMembers.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 				</thead>
149 149
 				<tbody>';
150 150
 
151
-			foreach ($context['membergroups'] as $membergroup)
152
-				echo '
151
+			foreach ($context['membergroups'] as $membergroup) {
152
+							echo '
153 153
 					<tr class="windowbg">
154 154
 						<td>', $membergroup['name'], '</td>
155 155
 						<td class="centercol">
@@ -159,6 +159,7 @@  discard block
 block discarded – undo
159 159
 							', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked>' : '', '
160 160
 						</td>
161 161
 					</tr>';
162
+			}
162 163
 
163 164
 			echo '
164 165
 					<tr class="windowbg">
@@ -185,8 +186,8 @@  discard block
 block discarded – undo
185 186
 				</thead>
186 187
 				<tbody>';
187 188
 
188
-			foreach ($context['postgroups'] as $postgroup)
189
-				echo '
189
+			foreach ($context['postgroups'] as $postgroup) {
190
+							echo '
190 191
 					<tr class="windowbg">
191 192
 						<td>
192 193
 							', $postgroup['name'], '
@@ -195,6 +196,7 @@  discard block
 block discarded – undo
195 196
 							<input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked>
196 197
 						</td>
197 198
 					</tr>';
199
+			}
198 200
 
199 201
 			echo '
200 202
 					<tr class="windowbg">
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_submit">';
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/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_submit"></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_submit"></p>
Please login to merge, or discard this patch.
Themes/default/ReportedContent.template.php 1 patch
Braces   +51 added lines, -34 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
54 54
 
55 55
 		// Prepare the comments...
56 56
 		$comments = array();
57
-		foreach ($report['comments'] as $comment)
58
-			$comments[$comment['member']['id']] = $comment['member']['link'];
57
+		foreach ($report['comments'] as $comment) {
58
+					$comments[$comment['member']['id']] = $comment['member']['link'];
59
+		}
59 60
 
60 61
 		echo '
61 62
 				', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
@@ -69,18 +70,21 @@  discard block
 block discarded – undo
69 70
 				<li><a href="', $scripturl, '?action=moderate;area=reportedposts;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
70 71
 
71 72
 		// Delete message button.
72
-		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])))
73
-			echo '
73
+		if (!$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards']))) {
74
+					echo '
74 75
 				<li><a href="', $scripturl, '?action=deletemsg;topic=', $report['topic']['id'], '.0;msg=', $report['topic']['id_msg'], ';modcenter;', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['mc_reportedp_delete_confirm'], '" class="you_sure">', $delete_button, '</a></li>';
76
+		}
75 77
 
76 78
 		// Ban this user button.
77
-		if (!$report['closed'] && !empty($context['report_manage_bans']))
78
-			echo '
79
+		if (!$report['closed'] && !empty($context['report_manage_bans'])) {
80
+					echo '
79 81
 				<li><a href="', $scripturl, '?action=admin;area=ban;sa=add', (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']), ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
82
+		}
80 83
 
81
-		if (!$context['view_closed'])
82
-			echo '
84
+		if (!$context['view_closed']) {
85
+					echo '
83 86
 				<li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>';
87
+		}
84 88
 
85 89
 			echo '
86 90
 				</ul>
@@ -88,11 +92,12 @@  discard block
 block discarded – undo
88 92
 	}
89 93
 
90 94
 	// Were none found?
91
-	if (empty($context['reports']))
92
-		echo '
95
+	if (empty($context['reports'])) {
96
+			echo '
93 97
 		<div class="windowbg2">
94 98
 			<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
95 99
 		</div>';
100
+	}
96 101
 
97 102
 	echo '
98 103
 		<div class="pagesection">
@@ -125,18 +130,20 @@  discard block
 block discarded – undo
125 130
 			<div class="modbox">
126 131
 				<ul>';
127 132
 
128
-		foreach ($context['reported_posts'] as $report)
129
-			echo '
133
+		foreach ($context['reported_posts'] as $report) {
134
+					echo '
130 135
 					<li class="smalltext">
131 136
 						<a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
132 137
 					</li>';
138
+		}
133 139
 
134 140
 		// Don't have any watched users right now?
135
-		if (empty($context['reported_posts']))
136
-			echo '
141
+		if (empty($context['reported_posts'])) {
142
+					echo '
137 143
 					<li>
138 144
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
139 145
 					</li>';
146
+		}
140 147
 
141 148
 		echo '
142 149
 				</ul>
@@ -226,12 +233,13 @@  discard block
 block discarded – undo
226 233
 				<h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3>
227 234
 			</div>';
228 235
 
229
-	foreach ($context['report']['comments'] as $comment)
230
-		echo '
236
+	foreach ($context['report']['comments'] as $comment) {
237
+			echo '
231 238
 			<div class="windowbg">
232 239
 				<p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
233 240
 				<p>', $comment['message'], '</p>
234 241
 			</div>';
242
+	}
235 243
 
236 244
 	echo '
237 245
 			<br>
@@ -240,11 +248,12 @@  discard block
 block discarded – undo
240 248
 			</div>
241 249
 				<div>';
242 250
 
243
-	if (empty($context['report']['mod_comments']))
244
-		echo '
251
+	if (empty($context['report']['mod_comments'])) {
252
+			echo '
245 253
 				<div class="information">
246 254
 					<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
247 255
 				</div>';
256
+	}
248 257
 
249 258
 	foreach ($context['report']['mod_comments'] as $comment)
250 259
 	{
@@ -334,18 +343,20 @@  discard block
 block discarded – undo
334 343
 			<div class="modbox">
335 344
 				<ul>';
336 345
 
337
-		foreach ($context['reported_members'] as $report)
338
-			echo '
346
+		foreach ($context['reported_members'] as $report) {
347
+					echo '
339 348
 					<li class="smalltext">
340 349
 						<a href="', $report['report_href'], '">', $report['user_name'], '</a>
341 350
 					</li>';
351
+		}
342 352
 
343 353
 		// Don't have any reported members right now?
344
-		if (empty($context['reported_members']))
345
-			echo '
354
+		if (empty($context['reported_members'])) {
355
+					echo '
346 356
 					<li>
347 357
 						<strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
348 358
 					</li>';
359
+		}
349 360
 
350 361
 		echo '
351 362
 				</ul>
@@ -431,8 +442,9 @@  discard block
 block discarded – undo
431 442
 
432 443
 		// Prepare the comments...
433 444
 		$comments = array();
434
-		foreach ($report['comments'] as $comment)
435
-			$comments[$comment['member']['id']] = $comment['member']['link'];
445
+		foreach ($report['comments'] as $comment) {
446
+					$comments[$comment['member']['id']] = $comment['member']['link'];
447
+		}
436 448
 
437 449
 		echo '
438 450
 				', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), '
@@ -444,13 +456,15 @@  discard block
 block discarded – undo
444 456
 				<li><a href="', $scripturl, '?action=moderate;area=reportedmembers;sa=handle;closed=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';', $context['mod-report-closed_token_var'], '=', $context['mod-report-closed_token'], '">', $close_button, '</a></li>';
445 457
 
446 458
 		// Ban this user button.
447
-		if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id']))
448
-			echo '
459
+		if (!$report['closed'] && !empty($context['report_manage_bans']) && !empty($report['user']['id'])) {
460
+					echo '
449 461
 				<li><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $report['user']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $ban_button, '</a></li>';
462
+		}
450 463
 
451
-		if (!$context['view_closed'])
452
-			echo '
464
+		if (!$context['view_closed']) {
465
+					echo '
453 466
 				<li><input type="checkbox" name="close[]" value="' . $report['id'] . '"></li>';
467
+		}
454 468
 
455 469
 			echo '
456 470
 				</ul>
@@ -458,11 +472,12 @@  discard block
 block discarded – undo
458 472
 	}
459 473
 
460 474
 	// Were none found?
461
-	if (empty($context['reports']))
462
-		echo '
475
+	if (empty($context['reports'])) {
476
+			echo '
463 477
 		<div class="windowbg2">
464 478
 			<p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
465 479
 		</div>';
480
+	}
466 481
 
467 482
 	echo '
468 483
 		<div class="pagesection">
@@ -522,12 +537,13 @@  discard block
 block discarded – undo
522 537
 				<h3 class="catbg">', $txt['mc_memberreport_whoreported_title'], '</h3>
523 538
 			</div>';
524 539
 
525
-	foreach ($context['report']['comments'] as $comment)
526
-		echo '
540
+	foreach ($context['report']['comments'] as $comment) {
541
+			echo '
527 542
 			<div class="windowbg">
528 543
 				<p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
529 544
 				<p>', $comment['message'], '</p>
530 545
 			</div>';
546
+	}
531 547
 
532 548
 	echo '
533 549
 			<br>
@@ -536,11 +552,12 @@  discard block
 block discarded – undo
536 552
 			</div>
537 553
 				<div>';
538 554
 
539
-	if (empty($context['report']['mod_comments']))
540
-		echo '
555
+	if (empty($context['report']['mod_comments'])) {
556
+			echo '
541 557
 				<div class="information">
542 558
 					<p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>
543 559
 				</div>';
560
+	}
544 561
 
545 562
 	foreach ($context['report']['mod_comments'] as $comment)
546 563
 	{
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_submit">
Please login to merge, or discard this patch.