Completed
Pull Request — release-2.1 (#4095)
by Rick
14:01 queued 05:55
created
Themes/default/ManageSmileys.template.php 1 patch
Braces   +55 added lines, -41 removed lines patch added patch discarded remove patch
@@ -65,18 +65,19 @@  discard block
 block discarded – undo
65 65
 					</dt>
66 66
 					<dd>
67 67
 						', $modSettings['smileys_url'], '/';
68
-		if ($context['current_set']['id'] == 'default')
69
-			echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
70
-		elseif (empty($context['smiley_set_dirs']))
71
-			echo '
68
+		if ($context['current_set']['id'] == 'default') {
69
+					echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
70
+		} elseif (empty($context['smiley_set_dirs'])) {
71
+					echo '
72 72
 						<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '" class="input_text"> ';
73
-		else
73
+		} else
74 74
 		{
75 75
 			echo '
76 76
 						<select name="smiley_sets_path" id="smiley_sets_path">';
77
-			foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
78
-				echo '
77
+			foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
78
+							echo '
79 79
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
80
+			}
80 81
 			echo '
81 82
 						</select> ';
82 83
 		}
@@ -91,14 +92,15 @@  discard block
 block discarded – undo
91 92
 					</dd>';
92 93
 
93 94
 		// If this is a new smiley set they have the option to import smileys already in the directory.
94
-		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
95
-			echo '
95
+		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
96
+					echo '
96 97
 					<dt>
97 98
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
98 99
 					</dt>
99 100
 					<dd>
100 101
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1" class="input_check">
101 102
 					</dd>';
103
+		}
102 104
 
103 105
 		echo '
104 106
 				</dl>
@@ -132,9 +134,10 @@  discard block
 block discarded – undo
132 134
 					<dd>
133 135
 						<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();">';
134 136
 
135
-		foreach ($context['smiley_sets'] as $smiley_set)
136
-			echo '
137
+		foreach ($context['smiley_sets'] as $smiley_set) {
138
+					echo '
137 139
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
140
+		}
138 141
 
139 142
 		echo '
140 143
 						</select>)
@@ -149,16 +152,17 @@  discard block
 block discarded – undo
149 152
 						<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
150 153
 					</dt>
151 154
 					<dd>';
152
-			if (empty($context['filenames']))
153
-				echo '
155
+			if (empty($context['filenames'])) {
156
+							echo '
154 157
 						<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" class="input_text">';
155
-			else
158
+			} else
156 159
 			{
157 160
 				echo '
158 161
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
159
-				foreach ($context['filenames'] as $filename)
160
-					echo '
162
+				foreach ($context['filenames'] as $filename) {
163
+									echo '
161 164
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
165
+				}
162 166
 				echo '
163 167
 						</select>';
164 168
 			}
@@ -227,9 +231,10 @@  discard block
 block discarded – undo
227 231
 						<dd>
228 232
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
229 233
 
230
-		foreach ($context['smiley_sets'] as $smiley_set)
231
-			echo '
234
+		foreach ($context['smiley_sets'] as $smiley_set) {
235
+					echo '
232 236
 							<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
237
+		}
233 238
 
234 239
 		echo '
235 240
 							</select>
@@ -238,16 +243,17 @@  discard block
 block discarded – undo
238 243
 							<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
239 244
 						</dt>
240 245
 						<dd>';
241
-	if (empty($context['filenames']))
242
-		echo '
246
+	if (empty($context['filenames'])) {
247
+			echo '
243 248
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');" class="input_text">';
244
-	else
249
+	} else
245 250
 	{
246 251
 		echo '
247 252
 								<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
248
-		foreach ($context['filenames'] as $filename)
249
-			echo '
253
+		foreach ($context['filenames'] as $filename) {
254
+					echo '
250 255
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
256
+		}
251 257
 		echo '
252 258
 							</select>';
253 259
 	}
@@ -275,14 +281,15 @@  discard block
 block discarded – undo
275 281
 				</fieldset>
276 282
 
277 283
 				<dl id="uploadMore" style="display: none;" class="settings">';
278
-	foreach ($context['smiley_sets'] as $smiley_set)
279
-		echo '
284
+	foreach ($context['smiley_sets'] as $smiley_set) {
285
+			echo '
280 286
 					<dt>
281 287
 						', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ':
282 288
 					</dt>
283 289
 					<dd>
284 290
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');" class="input_file">
285 291
 					</dd>';
292
+	}
286 293
 	echo '
287 294
 				</dl>
288 295
 			</div>
@@ -351,24 +358,27 @@  discard block
 block discarded – undo
351 358
 				<strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>';
352 359
 		foreach ($location['rows'] as $row)
353 360
 		{
354
-			if (!empty($context['move_smiley']))
355
-				echo '
361
+			if (!empty($context['move_smiley'])) {
362
+							echo '
356 363
 					<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>';
364
+			}
357 365
 
358 366
 			foreach ($row as $smiley)
359 367
 			{
360
-				if (empty($context['move_smiley']))
361
-					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>';
362
-				else
363
-					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>';
368
+				if (empty($context['move_smiley'])) {
369
+									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>';
370
+				} else {
371
+									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>';
372
+				}
364 373
 			}
365 374
 
366 375
 			echo '
367 376
 				<br>';
368 377
 		}
369
-		if (!empty($context['move_smiley']))
370
-			echo '
378
+		if (!empty($context['move_smiley'])) {
379
+					echo '
371 380
 				<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>';
381
+		}
372 382
 		echo '
373 383
 			</div>
374 384
 		<input type="hidden" name="reorder" value="1">
@@ -404,14 +414,15 @@  discard block
 block discarded – undo
404 414
 			</div>
405 415
 			<div class="windowbg2">
406 416
 				<dl class="settings">';
407
-	if (!$context['new_icon'])
408
-		echo '
417
+	if (!$context['new_icon']) {
418
+			echo '
409 419
 					<dt>
410 420
 						<strong>', $txt['smiley_preview'], ': </strong>
411 421
 					</dt>
412 422
 					<dd>
413 423
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
414 424
 					</dd>';
425
+	}
415 426
 	echo '
416 427
 					<dt>
417 428
 						<strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', $txt['icons_filename_all_png'], '</span>
@@ -436,9 +447,10 @@  discard block
 block discarded – undo
436 447
 	{
437 448
 		echo '
438 449
 							<optgroup label="', $category['name'], '">';
439
-		foreach ($category['boards'] as $board)
440
-			echo '
450
+		foreach ($category['boards'] as $board) {
451
+					echo '
441 452
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
453
+		}
442 454
 		echo '
443 455
 							</optgroup>';
444 456
 	}
@@ -453,19 +465,21 @@  discard block
 block discarded – undo
453 465
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
454 466
 
455 467
 	// Print the list of all the icons it can be put after...
456
-	foreach ($context['icons'] as $id => $data)
457
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
468
+	foreach ($context['icons'] as $id => $data) {
469
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
458 470
 			echo '
459 471
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
472
+	}
460 473
 
461 474
 	echo '
462 475
 						</select>
463 476
 					</dd>
464 477
 				</dl>';
465 478
 
466
-	if (!$context['new_icon'])
467
-		echo '
479
+	if (!$context['new_icon']) {
480
+			echo '
468 481
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
482
+	}
469 483
 
470 484
 	echo '
471 485
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button_submit">
Please login to merge, or discard this patch.
Themes/default/Memberlist.template.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['members_list'], '</span>';
29
-		if (!isset($context['old_search']))
30
-				echo '
29
+		if (!isset($context['old_search'])) {
30
+						echo '
31 31
 				<span class="floatright">', $context['letter_links'], '</span>';
32
+		}
32 33
 		echo '
33 34
 			</h3>
34 35
 		</div>';
@@ -43,19 +44,22 @@  discard block
 block discarded – undo
43 44
 	foreach ($context['columns'] as $key => $column)
44 45
 	{
45 46
 		// @TODO maybe find something nicer?
46
-		if ($key == 'email_address' && !$context['can_send_email'])
47
-			continue;
47
+		if ($key == 'email_address' && !$context['can_send_email']) {
48
+					continue;
49
+		}
48 50
 
49 51
 		// This is a selected column, so underline it or some such.
50
-		if ($column['selected'])
51
-			echo '
52
+		if ($column['selected']) {
53
+					echo '
52 54
 					<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '>
53 55
 						<a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>';
56
+		}
54 57
 		// This is just some column... show the link and be done with it.
55
-		else
56
-			echo '
58
+		else {
59
+					echo '
57 60
 					<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
58 61
 						', $column['link'], '</th>';
62
+		}
59 63
 	}
60 64
 	echo '
61 65
 				</tr>
@@ -74,9 +78,10 @@  discard block
 block discarded – undo
74 78
 					</td>
75 79
 					<td class="lefttext">', $member['link'], '</td>';
76 80
 
77
-		if (!isset($context['disabled_fields']['website']))
78
-			echo '
81
+		if (!isset($context['disabled_fields']['website'])) {
82
+					echo '
79 83
 					<td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank" class="new_win"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>';
84
+		}
80 85
 
81 86
 		// Group and date.
82 87
 		echo '
@@ -89,11 +94,12 @@  discard block
 block discarded – undo
89 94
 					<td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td>
90 95
 					<td class="centertext statsbar" style="width: 120px">';
91 96
 
92
-			if (!empty($member['post_percent']))
93
-				echo '
97
+			if (!empty($member['post_percent'])) {
98
+							echo '
94 99
 						<div class="bar" style="width: ', $member['post_percent'] + 4, 'px;">
95 100
 							<div style="width: ', $member['post_percent'], 'px;"></div>
96 101
 						</div>';
102
+			}
97 103
 
98 104
 			echo '
99 105
 					</td>';
@@ -102,9 +108,10 @@  discard block
 block discarded – undo
102 108
 		// Show custom fields marked to be shown here
103 109
 		if (!empty($context['custom_profile_fields']['columns']))
104 110
 		{
105
-			foreach ($context['custom_profile_fields']['columns'] as $key => $column)
106
-				echo '
111
+			foreach ($context['custom_profile_fields']['columns'] as $key => $column) {
112
+							echo '
107 113
 					<td class="righttext">', $member['options'][$key], '</td>';
114
+			}
108 115
 		}
109 116
 
110 117
 		echo '
@@ -112,11 +119,12 @@  discard block
 block discarded – undo
112 119
 		}
113 120
 	}
114 121
 	// No members?
115
-	else
116
-		echo '
122
+	else {
123
+			echo '
117 124
 				<tr>
118 125
 					<td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td>
119 126
 				</tr>';
127
+	}
120 128
 
121 129
 				echo '
122 130
 			</tbody>
@@ -129,9 +137,10 @@  discard block
 block discarded – undo
129 137
 			<div class="pagelinks floatleft">', $context['page_index'], '</div>';
130 138
 
131 139
 	// If it is displaying the result of a search show a "search again" link to edit their criteria.
132
-	if (isset($context['old_search']))
133
-		echo '
140
+	if (isset($context['old_search'])) {
141
+			echo '
134 142
 			<a class="button_link" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>';
143
+	}
135 144
 	echo '
136 145
 		</div>
137 146
 	</div>';
Please login to merge, or discard this patch.
Themes/default/ReportToMod.template.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,16 +62,17 @@
 block discarded – undo
62 62
 					<div id="error_box" class="errorbox">
63 63
 						<ul id="error_list">';
64 64
 
65
-		foreach ($context['post_errors'] as $key => $error)
66
-			echo '
65
+		foreach ($context['post_errors'] as $key => $error) {
66
+					echo '
67 67
 							<li id="error_', $key, '" class="error">', $error, '</li>';
68
+		}
68 69
 
69 70
 		echo '
70 71
 						</ul>';
71
-	}
72
-	else
73
-		echo '
72
+	} else {
73
+			echo '
74 74
 						<div style="display:none" id="error_box" class="errorbox">';
75
+	}
75 76
 
76 77
 	echo '
77 78
 					</div>';
Please login to merge, or discard this patch.
Themes/default/Help.template.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 		<meta charset="', $context['character_set'], '">
25 25
 		<meta name="robots" content="noindex">
26 26
 		<title>', $context['page_title'], '</title>
27
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
28
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
27
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
28
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
29 29
 	</head>
30 30
 	<body id="help_popup">
31 31
 		<div class="windowbg description">
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 		<title>', $txt['find_members'], '</title>
51 51
 		<meta charset="', $context['character_set'], '">
52 52
 		<meta name="robots" content="noindex">
53
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
54
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
53
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
54
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
55 55
 		<script>
56 56
 			var membersAdded = [];
57 57
 			function addMember(name)
Please login to merge, or discard this patch.
Braces   +15 added lines, -12 removed lines patch added patch discarded remove patch
@@ -86,9 +86,10 @@  discard block
 block discarded – undo
86 86
 					<span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br>';
87 87
 
88 88
 	// Only offer to search for buddies if we have some!
89
-	if (!empty($context['show_buddies']))
90
-		echo '
89
+	if (!empty($context['show_buddies'])) {
90
+			echo '
91 91
 					<span class="smalltext"><label for="buddies"><input type="checkbox" class="input_check" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked' : '', '> ', $txt['find_buddies'], '</label></span><br>';
92
+	}
92 93
 
93 94
 	echo '
94 95
 					<div class="padding righttext">
@@ -103,10 +104,10 @@  discard block
 block discarded – undo
103 104
 					<h3 class="catbg">', $txt['find_results'], '</h3>
104 105
 				</div>';
105 106
 
106
-	if (empty($context['results']))
107
-		echo '
107
+	if (empty($context['results'])) {
108
+			echo '
108 109
 				<p class="error">', $txt['find_no_results'], '</p>';
109
-	else
110
+	} else
110 111
 	{
111 112
 		echo '
112 113
 				<ul class="padding">';
@@ -135,11 +136,12 @@  discard block
 block discarded – undo
135 136
 			<input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '">
136 137
 		</form>';
137 138
 
138
-	if (empty($context['results']))
139
-		echo '
139
+	if (empty($context['results'])) {
140
+			echo '
140 141
 		<script>
141 142
 			document.getElementById("search").focus();
142 143
 		</script>';
144
+	}
143 145
 
144 146
 	echo '
145 147
 	</body>
@@ -183,8 +185,8 @@  discard block
 block discarded – undo
183 185
 {
184 186
 	global $txt, $context, $modSettings;
185 187
 
186
-	if (!empty($modSettings['requireAgreement']))
187
-		echo '
188
+	if (!empty($modSettings['requireAgreement'])) {
189
+			echo '
188 190
 			<div class="cat_bar">
189 191
 				<h3 class="catbg">
190 192
 					', $txt['terms_and_rules'], ' - ', $context['forum_name_html_safe'], '
@@ -193,11 +195,12 @@  discard block
 block discarded – undo
193 195
 			<div class="roundframe">
194 196
 				', $context['agreement'], '
195 197
 			</div>';
196
-	else
197
-		echo '
198
+	} else {
199
+			echo '
198 200
 			<div class="noticebox">
199 201
 				', $txt['agreement_disabled'], '
200 202
 			</div>';
201
-}
203
+	}
204
+	}
202 205
 
203 206
 ?>
204 207
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/ManageMaintenance.template.php 1 patch
Braces   +36 added lines, -25 removed lines patch added patch discarded remove patch
@@ -18,11 +18,12 @@  discard block
 block discarded – undo
18 18
 	global $context, $txt, $scripturl, $modSettings;
19 19
 
20 20
 	// If maintenance has finished tell the user.
21
-	if (!empty($context['maintenance_finished']))
22
-		echo '
21
+	if (!empty($context['maintenance_finished'])) {
22
+			echo '
23 23
 			<div class="infobox">
24 24
 				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
25 25
 			</div>';
26
+	}
26 27
 
27 28
 	echo '
28 29
 	<div id="manage_maintenance">
@@ -107,11 +108,12 @@  discard block
 block discarded – undo
107 108
 	<div id="manage_maintenance">';
108 109
 
109 110
 	// If maintenance has finished tell the user.
110
-	if (!empty($context['maintenance_finished']))
111
-		echo '
111
+	if (!empty($context['maintenance_finished'])) {
112
+			echo '
112 113
 			<div class="infobox">
113 114
 				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
114 115
 			</div>';
116
+	}
115 117
 
116 118
 	echo '
117 119
 		<div class="cat_bar">
@@ -238,11 +240,12 @@  discard block
 block discarded – undo
238 240
 	<div id="manage_maintenance">';
239 241
 
240 242
 	// If maintenance has finished tell the user.
241
-	if (!empty($context['maintenance_finished']))
242
-	echo '
243
+	if (!empty($context['maintenance_finished'])) {
244
+		echo '
243 245
 		<div class="infobox">
244 246
 			', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
245 247
 		</div>';
248
+	}
246 249
 
247 250
 	echo '
248 251
 		<div class="cat_bar">
@@ -300,9 +303,10 @@  discard block
 block discarded – undo
300 303
 				<p><a href="#membersLink" onclick="swapMembers();"><img src="', $settings['images_url'], '/selected.png" alt="+" id="membersIcon"></a> <a href="#membersLink" onclick="swapMembers();" id="membersText" style="font-weight: bold;">', $txt['maintain_members_all'], '</a></p>
301 304
 				<div style="display: none; padding: 3px" id="membersPanel">';
302 305
 
303
-	foreach ($context['membergroups'] as $group)
304
-		echo '
306
+	foreach ($context['membergroups'] as $group) {
307
+			echo '
305 308
 					<label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked class="input_check"> ', $group['name'], '</label><br>';
309
+	}
306 310
 
307 311
 	echo '
308 312
 				</div>
@@ -346,11 +350,12 @@  discard block
 block discarded – undo
346 350
 	global $scripturl, $txt, $context, $settings, $modSettings;
347 351
 
348 352
 	// If maintenance has finished tell the user.
349
-	if (!empty($context['maintenance_finished']))
350
-		echo '
353
+	if (!empty($context['maintenance_finished'])) {
354
+			echo '
351 355
 			<div class="infobox">
352 356
 				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
353 357
 			</div>';
358
+	}
354 359
 
355 360
 	// Bit of javascript for showing which boards to prune in an otherwise hidden list.
356 361
 	echo '
@@ -418,19 +423,21 @@  discard block
 block discarded – undo
418 423
 								<ul>';
419 424
 
420 425
 		// Display a checkbox with every board.
421
-		foreach ($category['boards'] as $board)
422
-			echo '
426
+		foreach ($category['boards'] as $board) {
427
+					echo '
423 428
 									<li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"><label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked class="input_check">', $board['name'], '</label></li>';
429
+		}
424 430
 
425 431
 		echo '
426 432
 								</ul>
427 433
 							</fieldset>';
428 434
 
429 435
 		// Increase $i, and check if we're at the middle yet.
430
-		if (++$i == $middle)
431
-			echo '
436
+		if (++$i == $middle) {
437
+					echo '
432 438
 						</div>
433 439
 						<div class="floatright" style="width: 49%;">';
440
+		}
434 441
 	}
435 442
 
436 443
 	echo '
@@ -469,9 +476,10 @@  discard block
 block discarded – undo
469 476
 		echo '
470 477
 					<optgroup label="', $category['name'], '">';
471 478
 
472
-		foreach ($category['boards'] as $board)
473
-			echo '
479
+		foreach ($category['boards'] as $board) {
480
+					echo '
474 481
 						<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
482
+		}
475 483
 
476 484
 		echo '
477 485
 					</optgroup>';
@@ -489,9 +497,10 @@  discard block
 block discarded – undo
489 497
 		echo '
490 498
 					<optgroup label="', $category['name'], '">';
491 499
 
492
-		foreach ($category['boards'] as $board)
493
-			echo '
500
+		foreach ($category['boards'] as $board) {
501
+					echo '
494 502
 						<option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=&gt;&nbsp;', $board['name'], '</option>';
503
+		}
495 504
 
496 505
 		echo '
497 506
 					</optgroup>';
@@ -531,9 +540,10 @@  discard block
 block discarded – undo
531 540
 				', $txt['database_optimize_attempt'], '<br>';
532 541
 
533 542
 	// List each table being optimized...
534
-	foreach ($context['optimized_tables'] as $table)
535
-		echo '
543
+	foreach ($context['optimized_tables'] as $table) {
544
+			echo '
536 545
 				', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>';
546
+	}
537 547
 
538 548
 	// How did we go?
539 549
 	echo '
@@ -590,13 +600,14 @@  discard block
 block discarded – undo
590 600
 				', implode('</li><li>', $context['exceeding_messages']), '
591 601
 				</li>
592 602
 			</ul>';
593
-		if (!empty($context['exceeding_messages_morethan']))
594
-			echo '
603
+		if (!empty($context['exceeding_messages_morethan'])) {
604
+					echo '
595 605
 			<p>', $context['exceeding_messages_morethan'], '</p>';
596
-	}
597
-	else
598
-		echo '
606
+		}
607
+	} else {
608
+			echo '
599 609
 			<p class="infobox">', $txt['convert_to_text'], '</p>';
610
+	}
600 611
 
601 612
 	echo '
602 613
 			<form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '">
Please login to merge, or discard this patch.
Themes/default/SplitTopics.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 				</div>
102 102
 				<ul id="messages_not_selected" class="split_messages smalltext">';
103 103
 
104
-	foreach ($context['not_selected']['messages'] as $message)
105
-		echo '
104
+	foreach ($context['not_selected']['messages'] as $message) {
105
+			echo '
106 106
 					<li class="windowbg" id="not_selected_', $message['id'], '">
107 107
 						<div class="message_header">
108 108
 							<a class="split_icon floatright" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=down;msg=', $message['id'], '" onclick="return select(\'down\', ', $message['id'], ');"><span class="generic_icons split_sel" title="-&gt;"></span></a>
@@ -111,6 +111,7 @@  discard block
 block discarded – undo
111 111
 						</div>
112 112
 						<div class="post">', $message['body'], '</div>
113 113
 					</li>';
114
+	}
114 115
 
115 116
 	echo '
116 117
 					<li class="dummy">
@@ -130,8 +131,8 @@  discard block
 block discarded – undo
130 131
 				</div>
131 132
 				<ul id="messages_selected" class="split_messages smalltext">';
132 133
 
133
-	if (!empty($context['selected']['messages']))
134
-		foreach ($context['selected']['messages'] as $message)
134
+	if (!empty($context['selected']['messages'])) {
135
+			foreach ($context['selected']['messages'] as $message)
135 136
 			echo '
136 137
 					<li class="windowbg" id="selected_', $message['id'], '">
137 138
 						<div class="message_header">
@@ -141,6 +142,7 @@  discard block
 block discarded – undo
141 142
 						</div>
142 143
 						<div class="post">', $message['body'], '</div>
143 144
 					</li>';
145
+	}
144 146
 
145 147
 	echo '
146 148
 					<li class="dummy">
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' : '', ' class="input_check" 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" class="input_check"></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" class="input_text"></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" class="input_password"></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" class="input_text"></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/ManageScheduledTasks.template.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
 	// We completed some tasks?
21 21
 	if (!empty($context['tasks_were_run']))
22 22
 	{
23
-		if (empty($context['scheduled_errors']))
24
-			echo '
23
+		if (empty($context['scheduled_errors'])) {
24
+					echo '
25 25
 	<div class="infobox">
26 26
 		', $txt['scheduled_tasks_were_run'], '
27 27
 	</div>';
28
-		else
28
+		} else
29 29
 		{
30 30
 			echo '
31 31
 	<div class="errorbox" id="errors">
Please login to merge, or discard this patch.
Themes/default/Xml.template.php 1 patch
Braces   +50 added lines, -37 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 		<subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
75 75
 		<body><![CDATA[', $context['message']['body'], ']]></body>
76 76
 		<success><![CDATA[', $txt['quick_modify_message'], ']]></success>';
77
-	}
78
-	else
79
-		echo '
77
+	} else {
78
+			echo '
80 79
 		<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '" in_body="', cleanXml($context['message']['error_in_body']) ? '1' : '0', '"><![CDATA[', implode('<br />', $context['message']['errors']), ']]></error>';
80
+	}
81 81
 	echo '
82 82
 	</message>
83 83
 </smf>';
@@ -101,13 +101,14 @@  discard block
 block discarded – undo
101 101
 
102 102
 		echo '
103 103
 		<modified><![CDATA[', empty($modified) ? '' : cleanXml('&#171; <em>' . $modified . '</em>&#187;'), ']]></modified>';
104
-		if (!empty($context['message']['subject']))
105
-			echo '
104
+		if (!empty($context['message']['subject'])) {
105
+					echo '
106 106
 		<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>';
107
-	}
108
-	else
109
-		echo '
107
+		}
108
+	} else {
109
+			echo '
110 110
 		<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '"><![CDATA[', cleanXml(implode('<br />', $context['message']['errors'])), ']]></error>';
111
+	}
111 112
 	echo '
112 113
 	</message>
113 114
 </smf>';
@@ -127,10 +128,11 @@  discard block
 block discarded – undo
127 128
 		<body><![CDATA[', $context['preview_message'], ']]></body>
128 129
 	</preview>
129 130
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '" topic_locked="', $context['locked'] ? '1' : '0', '">';
130
-	if (!empty($context['post_error']))
131
-		foreach ($context['post_error'] as $message)
131
+	if (!empty($context['post_error'])) {
132
+			foreach ($context['post_error'] as $message)
132 133
 			echo '
133 134
 		<error><![CDATA[', cleanXml($message), ']]></error>';
135
+	}
134 136
 	echo '
135 137
 		<caption name="guestname" class="', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? 'error' : '', '" />
136 138
 		<caption name="email" class="', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? 'error' : '', '" />
@@ -145,14 +147,15 @@  discard block
 block discarded – undo
145 147
 	{
146 148
 		echo '
147 149
 	<new_posts>';
148
-		foreach ($context['previous_posts'] as $post)
149
-			echo '
150
+		foreach ($context['previous_posts'] as $post) {
151
+					echo '
150 152
 		<post id="', $post['id'], '">
151 153
 			<time><![CDATA[', $post['time'], ']]></time>
152 154
 			<poster><![CDATA[', cleanXml($post['poster']), ']]></poster>
153 155
 			<message><![CDATA[', cleanXml($post['message']), ']]></message>
154 156
 			<is_ignored>', $post['is_ignored'] ? '1' : '0', '</is_ignored>
155 157
 		</post>';
158
+		}
156 159
 		echo '
157 160
 	</new_posts>';
158 161
 	}
@@ -176,10 +179,11 @@  discard block
 block discarded – undo
176 179
 		<body><![CDATA[', $context['preview_message'], ']]></body>
177 180
 	</preview>
178 181
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
179
-	if (!empty($context['post_error']['messages']))
180
-		foreach ($context['post_error']['messages'] as $message)
182
+	if (!empty($context['post_error']['messages'])) {
183
+			foreach ($context['post_error']['messages'] as $message)
181 184
 			echo '
182 185
 		<error><![CDATA[', cleanXml($message), ']]></error>';
186
+	}
183 187
 
184 188
 	echo '
185 189
 		<caption name="to" class="', isset($context['post_error']['no_to']) ? 'error' : '', '" />
@@ -208,10 +212,11 @@  discard block
 block discarded – undo
208 212
 		<body><![CDATA[', $context['preview_message'], ']]></body>
209 213
 	</preview>
210 214
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
211
-	if (!empty($context['post_error']['messages']))
212
-		foreach ($context['post_error']['messages'] as $message)
215
+	if (!empty($context['post_error']['messages'])) {
216
+			foreach ($context['post_error']['messages'] as $message)
213 217
 			echo '
214 218
 		<error><![CDATA[', cleanXml($message), ']]></error>';
219
+	}
215 220
 
216 221
 	echo '
217 222
 	</errors>';
@@ -227,19 +232,22 @@  discard block
 block discarded – undo
227 232
 {
228 233
 	global $context, $modSettings;
229 234
 
230
-	if (empty($context['yearly']))
231
-		return;
235
+	if (empty($context['yearly'])) {
236
+			return;
237
+	}
232 238
 
233 239
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
234 240
 <smf>';
235
-	foreach ($context['yearly'] as $year)
236
-		foreach ($year['months'] as $month)
241
+	foreach ($context['yearly'] as $year) {
242
+			foreach ($year['months'] as $month)
237 243
 		{
238 244
 			echo '
239 245
 	<month id="', $month['date']['year'], $month['date']['month'], '">';
240
-			foreach ($month['days'] as $day)
241
-				echo '
246
+	}
247
+			foreach ($month['days'] as $day) {
248
+							echo '
242 249
 		<day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />';
250
+			}
243 251
 			echo '
244 252
 	</month>';
245 253
 		}
@@ -260,17 +268,18 @@  discard block
 block discarded – undo
260 268
 	<pageIndex section="selected" startFrom="', $context['selected']['start'], '"><![CDATA[', $context['selected']['page_index'], ']]></pageIndex>';
261 269
 	foreach ($context['changes'] as $change)
262 270
 	{
263
-		if ($change['type'] == 'remove')
264
-			echo '
271
+		if ($change['type'] == 'remove') {
272
+					echo '
265 273
 	<change id="', $change['id'], '" curAction="remove" section="', $change['section'], '" />';
266
-		else
267
-			echo '
274
+		} else {
275
+					echo '
268 276
 	<change id="', $change['id'], '" curAction="insert" section="', $change['section'], '">
269 277
 		<subject><![CDATA[', cleanXml($change['insert_value']['subject']), ']]></subject>
270 278
 		<time><![CDATA[', cleanXml($change['insert_value']['time']), ']]></time>
271 279
 		<body><![CDATA[', cleanXml($change['insert_value']['body']), ']]></body>
272 280
 		<poster><![CDATA[', cleanXml($change['insert_value']['poster']), ']]></poster>
273 281
 	</change>';
282
+		}
274 283
 	}
275 284
 	echo '
276 285
 </smf>';
@@ -301,10 +310,10 @@  discard block
 block discarded – undo
301 310
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
302 311
 <smf>';
303 312
 
304
-	if (empty($context['topics']))
305
-		echo '
313
+	if (empty($context['topics'])) {
314
+			echo '
306 315
 		<noresults>', $txt['search_no_results'], '</noresults>';
307
-	else
316
+	} else
308 317
 	{
309 318
 		echo '
310 319
 		<results>';
@@ -370,9 +379,10 @@  discard block
 block discarded – undo
370 379
 	{
371 380
 		echo '
372 381
 	<item type="category" id="', $category['id'], '"><![CDATA[', cleanXml($category['name']), ']]></item>';
373
-		foreach ($category['boards'] as $board)
374
-			echo '
382
+		foreach ($category['boards'] as $board) {
383
+					echo '
375 384
 	<item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '"><![CDATA[', cleanXml($board['name']), ']]></item>';
385
+		}
376 386
 	}
377 387
 	echo '
378 388
 </smf>';
@@ -387,9 +397,10 @@  discard block
 block discarded – undo
387 397
 
388 398
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
389 399
 <smf>';
390
-	foreach ($context['icons'] as $icon)
391
-		echo '
400
+	foreach ($context['icons'] as $icon) {
401
+			echo '
392 402
 	<icon value="', $icon['value'], '" url="', $icon['url'], '"><![CDATA[', cleanXml($icon['name']), ']]></icon>';
403
+	}
393 404
 	echo '
394 405
 </smf>';
395 406
 }
@@ -438,16 +449,18 @@  discard block
 block discarded – undo
438 449
 	foreach ($xml_data as $key => $data)
439 450
 	{
440 451
 		// A group?
441
-		if (is_array($data) && isset($data['identifier']))
442
-			template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
452
+		if (is_array($data) && isset($data['identifier'])) {
453
+					template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
454
+		}
443 455
 		// An item...
444 456
 		elseif (is_array($data) && isset($data['value']))
445 457
 		{
446 458
 			echo "\n", str_repeat("\t", $level), '<', $child_ident;
447 459
 
448
-			if (!empty($data['attributes']))
449
-				foreach ($data['attributes'] as $k => $v)
460
+			if (!empty($data['attributes'])) {
461
+							foreach ($data['attributes'] as $k => $v)
450 462
 					echo ' ' . $k . '="' . $v . '"';
463
+			}
451 464
 			echo '><![CDATA[', cleanXml($data['value']), ']]></', $child_ident, '>';
452 465
 		}
453 466
 
Please login to merge, or discard this patch.