Completed
Push — release-2.1 ( 506664...8b5e1a )
by Colin
23:54 queued 15:34
created
Themes/default/ManageSmileys.template.php 1 patch
Braces   +58 added lines, -44 removed lines patch added patch discarded remove patch
@@ -41,11 +41,12 @@  discard block
 block discarded – undo
41 41
 			</div>';
42 42
 
43 43
 	// If this is an existing set, and there are still un-added smileys - offer an import opportunity.
44
-	if (!empty($context['current_set']['can_import']))
45
-		echo '
44
+	if (!empty($context['current_set']['can_import'])) {
45
+			echo '
46 46
 			<div class="information">
47 47
 				', $context['current_set']['can_import'] == 1 ? sprintf($txt['smiley_set_import_single'], $context['current_set']['import_url']) : sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import'], $context['current_set']['import_url']), '
48 48
 			</div>';
49
+	}
49 50
 
50 51
 	echo '
51 52
 			<div class="windowbg noup">
@@ -62,20 +63,20 @@  discard block
 block discarded – undo
62 63
 					<dd>
63 64
 						', $modSettings['smileys_url'], '/';
64 65
 
65
-	if ($context['current_set']['id'] == 'default')
66
-		echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
67
-
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 75
 
76
-		foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
77
-			echo '
76
+		foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
77
+					echo '
78 78
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
79
+		}
79 80
 		echo '
80 81
 						</select> ';
81 82
 	}
@@ -90,14 +91,15 @@  discard block
 block discarded – undo
90 91
 					</dd>';
91 92
 
92 93
 	// If this is a new smiley set they have the option to import smileys already in the directory.
93
-	if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
94
-		echo '
94
+	if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
95
+			echo '
95 96
 					<dt>
96 97
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
97 98
 					</dt>
98 99
 					<dd>
99 100
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1">
100 101
 					</dd>';
102
+	}
101 103
 
102 104
 	echo '
103 105
 				</dl>
@@ -131,9 +133,10 @@  discard block
 block discarded – undo
131 133
 					<dd>
132 134
 						<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();">';
133 135
 
134
-	foreach ($context['smiley_sets'] as $smiley_set)
135
-		echo '
136
+	foreach ($context['smiley_sets'] as $smiley_set) {
137
+			echo '
136 138
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
139
+	}
137 140
 
138 141
 	echo '
139 142
 						</select>)
@@ -149,17 +152,18 @@  discard block
 block discarded – undo
149 152
 					</dt>
150 153
 					<dd>';
151 154
 
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'], '">';
155
-	else
158
+	} else
156 159
 	{
157 160
 		echo '
158 161
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
159 162
 
160
-		foreach ($context['filenames'] as $filename)
161
-			echo '
163
+		foreach ($context['filenames'] as $filename) {
164
+					echo '
162 165
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
166
+		}
163 167
 		echo '
164 168
 						</select>';
165 169
 	}
@@ -228,9 +232,10 @@  discard block
 block discarded – undo
228 232
 						<dd>
229 233
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
230 234
 
231
-	foreach ($context['smiley_sets'] as $smiley_set)
232
-		echo '
235
+	foreach ($context['smiley_sets'] as $smiley_set) {
236
+			echo '
233 237
 								<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
238
+	}
234 239
 
235 240
 	echo '
236 241
 							</select>
@@ -240,17 +245,18 @@  discard block
 block discarded – undo
240 245
 						</dt>
241 246
 						<dd>';
242 247
 
243
-	if (empty($context['filenames']))
244
-		echo '
248
+	if (empty($context['filenames'])) {
249
+			echo '
245 250
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">';
246
-	else
251
+	} else
247 252
 	{
248 253
 		echo '
249 254
 							<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
250 255
 
251
-		foreach ($context['filenames'] as $filename)
252
-			echo '
256
+		foreach ($context['filenames'] as $filename) {
257
+					echo '
253 258
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
259
+		}
254 260
 		echo '
255 261
 							</select>';
256 262
 	}
@@ -279,14 +285,15 @@  discard block
 block discarded – undo
279 285
 
280 286
 				<dl id="uploadMore" style="display: none;" class="settings">';
281 287
 
282
-	foreach ($context['smiley_sets'] as $smiley_set)
283
-		echo '
288
+	foreach ($context['smiley_sets'] as $smiley_set) {
289
+			echo '
284 290
 					<dt>
285 291
 						', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ':
286 292
 					</dt>
287 293
 					<dd>
288 294
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');">
289 295
 					</dd>';
296
+	}
290 297
 
291 298
 	echo '
292 299
 				</dl>
@@ -357,27 +364,30 @@  discard block
 block discarded – undo
357 364
 
358 365
 		foreach ($location['rows'] as $row)
359 366
 		{
360
-			if (!empty($context['move_smiley']))
361
-				echo '
367
+			if (!empty($context['move_smiley'])) {
368
+							echo '
362 369
 				<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>';
370
+			}
363 371
 
364 372
 			foreach ($row as $smiley)
365 373
 			{
366
-				if (empty($context['move_smiley']))
367
-					echo '
374
+				if (empty($context['move_smiley'])) {
375
+									echo '
368 376
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>';
369
-				else
370
-					echo '
377
+				} else {
378
+									echo '
371 379
 				<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '>
372 380
 				<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>';
381
+				}
373 382
 			}
374 383
 
375 384
 			echo '
376 385
 				<br>';
377 386
 		}
378
-		if (!empty($context['move_smiley']))
379
-			echo '
387
+		if (!empty($context['move_smiley'])) {
388
+					echo '
380 389
 				<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>';
390
+		}
381 391
 		echo '
382 392
 			</div><!-- .windowbg -->
383 393
 			<input type="hidden" name="reorder" value="1">
@@ -414,14 +424,15 @@  discard block
 block discarded – undo
414 424
 			<div class="windowbg">
415 425
 				<dl class="settings">';
416 426
 
417
-	if (!$context['new_icon'])
418
-		echo '
427
+	if (!$context['new_icon']) {
428
+			echo '
419 429
 					<dt>
420 430
 						<strong>', $txt['smiley_preview'], ': </strong>
421 431
 					</dt>
422 432
 					<dd>
423 433
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
424 434
 					</dd>';
435
+	}
425 436
 
426 437
 	echo '
427 438
 					<dt>
@@ -448,9 +459,10 @@  discard block
 block discarded – undo
448 459
 		echo '
449 460
 							<optgroup label="', $category['name'], '">';
450 461
 
451
-		foreach ($category['boards'] as $board)
452
-			echo '
462
+		foreach ($category['boards'] as $board) {
463
+					echo '
453 464
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
465
+		}
454 466
 
455 467
 		echo '
456 468
 							</optgroup>';
@@ -467,19 +479,21 @@  discard block
 block discarded – undo
467 479
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
468 480
 
469 481
 	// Print the list of all the icons it can be put after...
470
-	foreach ($context['icons'] as $id => $data)
471
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
482
+	foreach ($context['icons'] as $id => $data) {
483
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
472 484
 			echo '
473 485
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
486
+	}
474 487
 
475 488
 	echo '
476 489
 						</select>
477 490
 					</dd>
478 491
 				</dl>';
479 492
 
480
-	if (!$context['new_icon'])
481
-		echo '
493
+	if (!$context['new_icon']) {
494
+			echo '
482 495
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
496
+	}
483 497
 
484 498
 	echo '
485 499
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/ManageMembergroups.template.php 1 patch
Braces   +104 added lines, -74 removed lines patch added patch discarded remove patch
@@ -55,9 +55,10 @@  discard block
 block discarded – undo
55 55
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
56 56
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
57 57
 
58
-		if ($context['allow_protected'])
59
-			echo '
58
+		if ($context['allow_protected']) {
59
+					echo '
60 60
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
61
+		}
61 62
 
62 63
 		echo '
63 64
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -67,14 +68,15 @@  discard block
 block discarded – undo
67 68
 					</dd>';
68 69
 	}
69 70
 
70
-	if ($context['post_group'] || $context['undefined_group'])
71
-		echo '
71
+	if ($context['post_group'] || $context['undefined_group']) {
72
+			echo '
72 73
 					<dt id="min_posts_text">
73 74
 						<strong>', $txt['membergroups_min_posts'], ':</strong>
74 75
 					</dt>
75 76
 					<dd>
76 77
 						<input type="number" name="min_posts" id="min_posts_input" size="5">
77 78
 					</dd>';
79
+	}
78 80
 
79 81
 	if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups']))
80 82
 	{
@@ -92,9 +94,10 @@  discard block
 block discarded – undo
92 94
 								<option value="-1">', $txt['membergroups_guests'], '</option>
93 95
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
94 96
 
95
-		foreach ($context['groups'] as $group)
96
-			echo '
97
+		foreach ($context['groups'] as $group) {
98
+					echo '
97 99
 								<option value="', $group['id'], '">', $group['name'], '</option>';
100
+		}
98 101
 
99 102
 		echo '
100 103
 							</select>
@@ -105,9 +108,10 @@  discard block
 block discarded – undo
105 108
 								<option value="-1">', $txt['membergroups_guests'], '</option>
106 109
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
107 110
 
108
-		foreach ($context['groups'] as $group)
109
-			echo '
111
+		foreach ($context['groups'] as $group) {
112
+					echo '
110 113
 								<option value="', $group['id'], '">', $group['name'], '</option>';
114
+		}
111 115
 
112 116
 		echo '
113 117
 							</select>
@@ -139,8 +143,8 @@  discard block
 block discarded – undo
139 143
 				<input type="submit" value="', $txt['membergroups_add_group'], '" class="button">
140 144
 			</div><!-- .windowbg -->';
141 145
 
142
-	if ($context['undefined_group'])
143
-		echo '
146
+	if ($context['undefined_group']) {
147
+			echo '
144 148
 			<script>
145 149
 				function swapPostGroup(isChecked)
146 150
 				{
@@ -150,6 +154,7 @@  discard block
 block discarded – undo
150 154
 				}
151 155
 				swapPostGroup(', $context['post_group'] ? 'true' : 'false', ');
152 156
 			</script>';
157
+	}
153 158
 
154 159
 	echo '
155 160
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -181,14 +186,15 @@  discard block
 block discarded – undo
181 186
 						<input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30">
182 187
 					</dd>';
183 188
 
184
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
185
-		echo '
189
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
190
+			echo '
186 191
 					<dt id="group_desc_text">
187 192
 						<label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label>
188 193
 					</dt>
189 194
 					<dd>
190 195
 						<textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea>
191 196
 					</dd>';
197
+	}
192 198
 
193 199
 	// Group type...
194 200
 	if ($context['group']['allow_post_group'])
@@ -202,9 +208,10 @@  discard block
 block discarded – undo
202 208
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
203 209
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
204 210
 
205
-		if ($context['group']['allow_protected'])
206
-			echo '
211
+		if ($context['group']['allow_protected']) {
212
+					echo '
207 213
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
214
+		}
208 215
 
209 216
 		echo '
210 217
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -214,8 +221,8 @@  discard block
 block discarded – undo
214 221
 					</dd>';
215 222
 	}
216 223
 
217
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
218
-		echo '
224
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
225
+			echo '
219 226
 					<dt id="group_moderators_text">
220 227
 						<label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label>
221 228
 					</dt>
@@ -233,6 +240,7 @@  discard block
 block discarded – undo
233 240
 							<option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option>
234 241
 						</select>
235 242
 					</dd>';
243
+	}
236 244
 
237 245
 	// Can they inherit permissions?
238 246
 	if ($context['group']['id'] > 1 && $context['group']['id'] != 3)
@@ -249,9 +257,10 @@  discard block
 block discarded – undo
249 257
 							<option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>';
250 258
 
251 259
 		// For all the inheritable groups show an option.
252
-		foreach ($context['inheritable_groups'] as $id => $group)
253
-			echo '
260
+		foreach ($context['inheritable_groups'] as $id => $group) {
261
+					echo '
254 262
 							<option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>';
263
+		}
255 264
 
256 265
 		echo '
257 266
 						</select>
@@ -259,8 +268,8 @@  discard block
 block discarded – undo
259 268
 					</dd>';
260 269
 	}
261 270
 
262
-	if ($context['group']['allow_post_group'])
263
-		echo '
271
+	if ($context['group']['allow_post_group']) {
272
+			echo '
264 273
 
265 274
 					<dt id="min_posts_text">
266 275
 						<label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label>
@@ -268,6 +277,7 @@  discard block
 block discarded – undo
268 277
 					<dd>
269 278
 						<input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6">
270 279
 					</dd>';
280
+	}
271 281
 
272 282
 	echo '
273 283
 					<dt>
@@ -297,9 +307,10 @@  discard block
 block discarded – undo
297 307
 						<select name="icon_image" id="icon_image_input">';
298 308
 
299 309
 		// For every possible icon, create an option.
300
-		foreach ($context['possible_icons'] as $icon)
301
-			echo '
310
+		foreach ($context['possible_icons'] as $icon) {
311
+					echo '
302 312
 							<option value="', $icon, '"', $context['group']['icon_image'] == $icon ? ' selected' : '', '>', $icon, '</option>';
313
+		}
303 314
 
304 315
 		echo '
305 316
 						</select>
@@ -308,9 +319,10 @@  discard block
 block discarded – undo
308 319
 	}
309 320
 
310 321
 	// No? Hide the entire control.
311
-	else
312
-		echo '
322
+	else {
323
+			echo '
313 324
 					<input type="hidden" name="icon_image" value="">';
325
+	}
314 326
 
315 327
 	echo '
316 328
 					<dt>
@@ -322,8 +334,8 @@  discard block
 block discarded – undo
322 334
 					</dd>';
323 335
 
324 336
 	// Force 2FA for this membergroup?
325
-	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2)
326
-		echo '
337
+	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) {
338
+			echo '
327 339
 					<dt>
328 340
 						<label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br>
329 341
 						<span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span>
@@ -331,6 +343,7 @@  discard block
 block discarded – undo
331 343
 					<dd>
332 344
 						<input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '>
333 345
 					</dd>';
346
+	}
334 347
 
335 348
 	if (!empty($context['categories']))
336 349
 	{
@@ -341,11 +354,11 @@  discard block
 block discarded – undo
341 354
 					</dt>
342 355
 					<dd>';
343 356
 
344
-		if (!empty($context['can_manage_boards']))
345
-			echo $txt['membergroups_can_manage_access'];
346
-
347
-		else
348
-			template_add_edit_group_boards_list();
357
+		if (!empty($context['can_manage_boards'])) {
358
+					echo $txt['membergroups_can_manage_access'];
359
+		} else {
360
+					template_add_edit_group_boards_list();
361
+		}
349 362
 
350 363
 		echo '
351 364
 					</dd>';
@@ -375,20 +388,21 @@  discard block
 block discarded – undo
375 388
 			sItemListContainerId: \'moderator_container\',
376 389
 			aListItems: [';
377 390
 
378
-	foreach ($context['group']['moderators'] as $id_member => $member_name)
379
-		echo '
391
+	foreach ($context['group']['moderators'] as $id_member => $member_name) {
392
+			echo '
380 393
 				{
381 394
 					sItemId: ', JavaScriptEscape($id_member), ',
382 395
 					sItemName: ', JavaScriptEscape($member_name), '
383 396
 				}', $id_member == $context['group']['last_moderator_id'] ? '' : ',';
397
+	}
384 398
 
385 399
 	echo '
386 400
 			]
387 401
 		});
388 402
 	</script>';
389 403
 
390
-	if ($context['group']['allow_post_group'])
391
-		echo '
404
+	if ($context['group']['allow_post_group']) {
405
+			echo '
392 406
 	<script>
393 407
 		function swapPostGroup(isChecked)
394 408
 		{
@@ -436,7 +450,8 @@  discard block
 block discarded – undo
436 450
 
437 451
 		swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', ');
438 452
 	</script>';
439
-}
453
+	}
454
+	}
440 455
 
441 456
 /**
442 457
  * The template for determining which boards a group has access to.
@@ -454,13 +469,13 @@  discard block
 block discarded – undo
454 469
 
455 470
 	foreach ($context['categories'] as $category)
456 471
 	{
457
-		if (empty($modSettings['deny_boards_access']))
458
-			echo '
472
+		if (empty($modSettings['deny_boards_access'])) {
473
+					echo '
459 474
 									<li class="category">
460 475
 										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a>
461 476
 										<ul>';
462
-		else
463
-			echo '
477
+		} else {
478
+					echo '
464 479
 									<li class="category">
465 480
 										<strong>', $category['name'], '</strong>
466 481
 										<span class="select_all_box">
@@ -473,16 +488,17 @@  discard block
 block discarded – undo
473 488
 											</select>
474 489
 										</span>
475 490
 										<ul id="boards_list_', $category['id'], '">';
491
+		}
476 492
 
477 493
 		foreach ($category['boards'] as $board)
478 494
 		{
479
-			if (empty($modSettings['deny_boards_access']))
480
-				echo '
495
+			if (empty($modSettings['deny_boards_access'])) {
496
+							echo '
481 497
 											<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
482 498
 												<input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label>
483 499
 											</li>';
484
-			else
485
-				echo '
500
+			} else {
501
+							echo '
486 502
 											<li class="board" style="width:100%">
487 503
 												<span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span>
488 504
 												<span style="width:50%;float:right">
@@ -491,6 +507,7 @@  discard block
 block discarded – undo
491 507
 													<input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label>
492 508
 												</span>
493 509
 											</li>';
510
+			}
494 511
 		}
495 512
 
496 513
 		echo '
@@ -501,14 +518,14 @@  discard block
 block discarded – undo
501 518
 	echo '
502 519
 								</ul>';
503 520
 
504
-	if (empty($modSettings['deny_boards_access']))
505
-		echo '
521
+	if (empty($modSettings['deny_boards_access'])) {
522
+			echo '
506 523
 								<br class="clear"><br>
507 524
 								<input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');">
508 525
 								<label for="checkall_check"><em>', $txt['check_all'], '</em></label>
509 526
 							</fieldset>';
510
-	else
511
-		echo '
527
+	} else {
528
+			echo '
512 529
 								<br class="clear">
513 530
 								<span class="select_all_box">
514 531
 									<em>', $txt['all'], ': </em>
@@ -524,15 +541,17 @@  discard block
 block discarded – undo
524 541
 									});
525 542
 								});
526 543
 							</script>';
544
+	}
527 545
 
528
-	if ($collapse)
529
-		echo '
546
+	if ($collapse) {
547
+			echo '
530 548
 							<a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a>
531 549
 							<script>
532 550
 								document.getElementById("visible_boards_link").style.display = "";
533 551
 								document.getElementById("visible_boards").style.display = "none";
534 552
 							</script>';
535
-}
553
+	}
554
+	}
536 555
 
537 556
 /**
538 557
  * Templatine for viewing the members of a group.
@@ -557,14 +576,15 @@  discard block
 block discarded – undo
557 576
 					</dd>';
558 577
 
559 578
 	// Any description to show?
560
-	if (!empty($context['group']['description']))
561
-		echo '
579
+	if (!empty($context['group']['description'])) {
580
+			echo '
562 581
 					<dt>
563 582
 						<strong>' . $txt['membergroups_members_description'] . ':</strong>
564 583
 					</dt>
565 584
 					<dd>
566 585
 						', $context['group']['description'], '
567 586
 					</dd>';
587
+	}
568 588
 
569 589
 	echo '
570 590
 					<dt>
@@ -578,8 +598,9 @@  discard block
 block discarded – undo
578 598
 	if (!empty($context['group']['moderators']))
579 599
 	{
580 600
 		$moderators = array();
581
-		foreach ($context['group']['moderators'] as $moderator)
582
-			$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
601
+		foreach ($context['group']['moderators'] as $moderator) {
602
+					$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
603
+		}
583 604
 
584 605
 		echo '
585 606
 					<dt>
@@ -604,9 +625,10 @@  discard block
 block discarded – undo
604 625
 					<tr class="title_bar">
605 626
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
606 627
 
607
-	if ($context['can_send_email'])
608
-		echo '
628
+	if ($context['can_send_email']) {
629
+			echo '
609 630
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
631
+	}
610 632
 
611 633
 	echo '
612 634
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
@@ -615,20 +637,22 @@  discard block
 block discarded – undo
615 637
 							<a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
616 638
 						</th>';
617 639
 
618
-	if (!empty($context['group']['assignable']))
619
-		echo '
640
+	if (!empty($context['group']['assignable'])) {
641
+			echo '
620 642
 						<th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>';
643
+	}
621 644
 
622 645
 	echo '
623 646
 					</tr>
624 647
 				</thead>
625 648
 				<tbody>';
626 649
 
627
-	if (empty($context['members']))
628
-		echo '
650
+	if (empty($context['members'])) {
651
+			echo '
629 652
 					<tr class="windowbg">
630 653
 						<td colspan="6">', $txt['membergroups_members_no_members'], '</td>
631 654
 					</tr>';
655
+	}
632 656
 
633 657
 	foreach ($context['members'] as $member)
634 658
 	{
@@ -636,20 +660,22 @@  discard block
 block discarded – undo
636 660
 					<tr class="windowbg">
637 661
 						<td>', $member['name'], '</td>';
638 662
 
639
-		if ($context['can_send_email'])
640
-			echo '
663
+		if ($context['can_send_email']) {
664
+					echo '
641 665
 						<td>
642 666
 								<a href="mailto:', $member['email'], '">', $member['email'], '</a>
643 667
 						</td>';
668
+		}
644 669
 
645 670
 		echo '
646 671
 						<td>', $member['last_online'], '</td>
647 672
 						<td>', $member['registered'], '</td>
648 673
 						<td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';
649 674
 
650
-		if (!empty($context['group']['assignable']))
651
-			echo '
675
+		if (!empty($context['group']['assignable'])) {
676
+					echo '
652 677
 						<td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>';
678
+		}
653 679
 
654 680
 		echo '
655 681
 					</tr>';
@@ -659,11 +685,12 @@  discard block
 block discarded – undo
659 685
 				</tbody>
660 686
 			</table>';
661 687
 
662
-	if (!empty($context['group']['assignable']))
663
-		echo '
688
+	if (!empty($context['group']['assignable'])) {
689
+			echo '
664 690
 			<div class="floatright">
665 691
 				<input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button ">
666 692
 			</div>';
693
+	}
667 694
 
668 695
 	echo '
669 696
 			<div class="pagesection flow_hidden">
@@ -671,8 +698,8 @@  discard block
 block discarded – undo
671 698
 			</div>
672 699
 			<br>';
673 700
 
674
-	if (!empty($context['group']['assignable']))
675
-		echo '
701
+	if (!empty($context['group']['assignable'])) {
702
+			echo '
676 703
 			<div class="cat_bar">
677 704
 				<h3 class="catbg">', $txt['membergroups_members_add_title'], '</h3>
678 705
 			</div>
@@ -688,6 +715,7 @@  discard block
 block discarded – undo
688 715
 				</dl>
689 716
 				<input type="submit" name="add" value="', $txt['membergroups_members_add'], '" class="button">
690 717
 			</div>';
718
+	}
691 719
 
692 720
 	echo '
693 721
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -695,8 +723,8 @@  discard block
 block discarded – undo
695 723
 		</form>
696 724
 	</div><!-- #admincenter -->';
697 725
 
698
-	if (!empty($context['group']['assignable']))
699
-		echo '
726
+	if (!empty($context['group']['assignable'])) {
727
+			echo '
700 728
 	<script>
701 729
 		var oAddMemberSuggest = new smc_AutoSuggest({
702 730
 			sSelf: \'oAddMemberSuggest\',
@@ -712,7 +740,8 @@  discard block
 block discarded – undo
712 740
 			sItemListContainerId: \'toAddItemContainer\'
713 741
 		});
714 742
 	</script>';
715
-}
743
+	}
744
+	}
716 745
 
717 746
 /**
718 747
  * Allow the moderator to enter a reason to each user being rejected.
@@ -732,8 +761,8 @@  discard block
 block discarded – undo
732 761
 				<dl class="settings">';
733 762
 
734 763
 	// Loop through and print out a reason box for each...
735
-	foreach ($context['group_requests'] as $request)
736
-		echo '
764
+	foreach ($context['group_requests'] as $request) {
765
+			echo '
737 766
 					<dt>
738 767
 						<strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong>
739 768
 					</dt>
@@ -741,6 +770,7 @@  discard block
 block discarded – undo
741 770
 						<input type="hidden" name="groupr[]" value="', $request['id'], '">
742 771
 						<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40"></textarea>
743 772
 					</dd>';
773
+	}
744 774
 
745 775
 	echo '
746 776
 				</dl>
Please login to merge, or discard this patch.
Themes/default/ManageSearch.template.php 1 patch
Braces   +23 added lines, -20 removed lines patch added patch discarded remove patch
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 			<div class="windowbg noup">
128 128
 				<dl class="settings">';
129 129
 
130
-	if (!empty($context['table_info']))
131
-		echo '
130
+	if (!empty($context['table_info'])) {
131
+			echo '
132 132
 					<dt>
133 133
 						<strong>', $txt['search_method_messages_table_space'], ':</strong>
134 134
 					</dt>
@@ -141,6 +141,7 @@  discard block
 block discarded – undo
141 141
 					<dd>
142 142
 						', $context['table_info']['index_length'], '
143 143
 					</dd>';
144
+	}
144 145
 	echo '
145 146
 				</dl>
146 147
 				', $context['double_index'] ? '<div class="noticebox">
@@ -163,17 +164,17 @@  discard block
 block discarded – undo
163 164
 						<dd>
164 165
 							<span class="smalltext">';
165 166
 
166
-		if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext']))
167
-			echo '
167
+		if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) {
168
+					echo '
168 169
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]';
169
-
170
-		elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext']))
171
-			echo '
170
+		} elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) {
171
+					echo '
172 172
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create'];
173
-		else
174
-			echo '
173
+		} else {
174
+					echo '
175 175
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br>
176 176
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length'];
177
+		}
177 178
 		echo '
178 179
 							</span>
179 180
 						</dd>';
@@ -187,26 +188,27 @@  discard block
 block discarded – undo
187 188
 						<dd>
188 189
 							<span class="smalltext">';
189 190
 
190
-	if ($context['custom_index'])
191
-		echo '
191
+	if ($context['custom_index']) {
192
+			echo '
192 193
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br>
193 194
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
194
-
195
-	elseif ($context['partial_custom_index'])
196
-		echo '
195
+	} elseif ($context['partial_custom_index']) {
196
+			echo '
197 197
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br>
198 198
 								<strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length'];
199
-	else
200
-		echo '
199
+	} else {
200
+			echo '
201 201
 								<strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]';
202
+	}
202 203
 	echo '
203 204
 							</span>
204 205
 						</dd>';
205 206
 
206 207
 	foreach ($context['search_apis'] as $api)
207 208
 	{
208
-		if (empty($api['label']) || $api['has_template'])
209
-			continue;
209
+		if (empty($api['label']) || $api['has_template']) {
210
+					continue;
211
+		}
210 212
 
211 213
 		echo '
212 214
 						<dt>
@@ -214,11 +216,12 @@  discard block
 block discarded – undo
214 216
 							', $api['label'], '
215 217
 						</dt>';
216 218
 
217
-		if ($api['desc'])
218
-			echo '
219
+		if ($api['desc']) {
220
+					echo '
219 221
 						<dd>
220 222
 							<span class="smalltext">', $api['desc'], '</span>
221 223
 						</dd>';
224
+		}
222 225
 	}
223 226
 
224 227
 	echo '
Please login to merge, or discard this patch.
Themes/default/ManagePaid.template.php 1 patch
Braces   +63 added lines, -45 removed lines patch added patch discarded remove patch
@@ -24,11 +24,12 @@  discard block
 block discarded – undo
24 24
 				<h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3>
25 25
 			</div>';
26 26
 
27
-	if (!empty($context['disable_groups']))
28
-		echo '
27
+	if (!empty($context['disable_groups'])) {
28
+			echo '
29 29
 			<div class="information noup">
30 30
 				<span class="alert">', $txt['paid_mod_edit_note'], '</span>
31 31
 			</div>';
32
+	}
32 33
 
33 34
 	echo '
34 35
 			<div class="windowbg">
@@ -69,9 +70,10 @@  discard block
 block discarded – undo
69 70
 							<option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>';
70 71
 
71 72
 	// Put each group into the box.
72
-	foreach ($context['groups'] as $id => $name)
73
-		echo '
73
+	foreach ($context['groups'] as $id => $name) {
74
+			echo '
74 75
 							<option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>';
76
+	}
75 77
 
76 78
 	echo '
77 79
 						</select>
@@ -83,12 +85,13 @@  discard block
 block discarded – undo
83 85
 					<dd>';
84 86
 
85 87
 	// Put a checkbox in for each group
86
-	foreach ($context['groups'] as $id => $name)
87
-		echo '
88
+	foreach ($context['groups'] as $id => $name) {
89
+			echo '
88 90
 						<label for="addgroup_', $id, '">
89 91
 							<input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '>
90 92
 							<span class="smalltext">', $name, '</span>
91 93
 						</label><br>';
94
+	}
92 95
 
93 96
 	echo '
94 97
 					</dd>
@@ -238,8 +241,8 @@  discard block
 block discarded – undo
238 241
 				<dl class="settings">';
239 242
 
240 243
 	// Do we need a username?
241
-	if ($context['action_type'] == 'add')
242
-		echo '
244
+	if ($context['action_type'] == 'add') {
245
+			echo '
243 246
 					<dt>
244 247
 						<strong>', $txt['paid_username'], ':</strong><br>
245 248
 						<span class="smalltext">', $txt['one_username'], '</span>
@@ -247,6 +250,7 @@  discard block
 block discarded – undo
247 250
 					<dd>
248 251
 						<input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30">
249 252
 					</dd>';
253
+	}
250 254
 
251 255
 	echo '
252 256
 					<dt>
@@ -264,9 +268,10 @@  discard block
 block discarded – undo
264 268
 					<select name="year" id="year" onchange="generateDays();">';
265 269
 
266 270
 	// Show a list of all the years we allow...
267
-	for ($year = 2005; $year <= 2030; $year++)
268
-		echo '
271
+	for ($year = 2005; $year <= 2030; $year++) {
272
+			echo '
269 273
 						<option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>';
274
+	}
270 275
 
271 276
 	echo '
272 277
 					</select>&nbsp;
@@ -274,9 +279,10 @@  discard block
 block discarded – undo
274 279
 					<select name="month" id="month" onchange="generateDays();">';
275 280
 
276 281
 	// There are 12 months per year - ensure that they all get listed.
277
-	for ($month = 1; $month <= 12; $month++)
278
-		echo '
282
+	for ($month = 1; $month <= 12; $month++) {
283
+			echo '
279 284
 						<option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
285
+	}
280 286
 
281 287
 	echo '
282 288
 					</select>&nbsp;
@@ -284,9 +290,10 @@  discard block
 block discarded – undo
284 290
 					<select name="day" id="day">';
285 291
 
286 292
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
287
-	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
288
-		echo '
293
+	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) {
294
+			echo '
289 295
 						<option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>';
296
+	}
290 297
 
291 298
 	echo '
292 299
 					</select>
@@ -298,9 +305,10 @@  discard block
 block discarded – undo
298 305
 					<select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
299 306
 
300 307
 	// Show a list of all the years we allow...
301
-	for ($year = 2005; $year <= 2030; $year++)
302
-		echo '
308
+	for ($year = 2005; $year <= 2030; $year++) {
309
+			echo '
303 310
 						<option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>';
311
+	}
304 312
 
305 313
 	echo '
306 314
 					</select>&nbsp;
@@ -308,9 +316,10 @@  discard block
 block discarded – undo
308 316
 					<select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
309 317
 
310 318
 	// There are 12 months per year - ensure that they all get listed.
311
-	for ($month = 1; $month <= 12; $month++)
312
-		echo '
319
+	for ($month = 1; $month <= 12; $month++) {
320
+			echo '
313 321
 						<option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
322
+	}
314 323
 
315 324
 	echo '
316 325
 					</select>&nbsp;
@@ -318,9 +327,10 @@  discard block
 block discarded – undo
318 327
 					<select name="dayend" id="dayend">';
319 328
 
320 329
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
321
-	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
322
-		echo '
330
+	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) {
331
+			echo '
323 332
 						<option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>';
333
+	}
324 334
 
325 335
 	echo '
326 336
 					</select>
@@ -359,8 +369,8 @@  discard block
 block discarded – undo
359 369
 		<div class="windowbg">
360 370
 			<ul>';
361 371
 
362
-		foreach ($context['pending_payments'] as $id => $payment)
363
-			echo '
372
+		foreach ($context['pending_payments'] as $id => $payment) {
373
+					echo '
364 374
 				<li>
365 375
 					', $payment['desc'], '
366 376
 					<span class="floatleft">
@@ -370,6 +380,7 @@  discard block
 block discarded – undo
370 380
 						<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a>
371 381
 					</span>
372 382
 				</li>';
383
+		}
373 384
 
374 385
 		echo '
375 386
 			</ul>
@@ -394,12 +405,12 @@  discard block
 block discarded – undo
394 405
 				<h3 class="catbg">', $txt['subscriptions'], '</h3>
395 406
 			</div>';
396 407
 
397
-	if (empty($context['subscriptions']))
398
-		echo '
408
+	if (empty($context['subscriptions'])) {
409
+			echo '
399 410
 			<div class="information">
400 411
 				', $txt['paid_subs_none'], '
401 412
 			</div>';
402
-	else
413
+	} else
403 414
 	{
404 415
 		echo '
405 416
 			<div class="information">
@@ -410,8 +421,9 @@  discard block
 block discarded – undo
410 421
 		foreach ($context['subscriptions'] as $id => $subscription)
411 422
 		{
412 423
 			// Ignore the inactive ones...
413
-			if (empty($subscription['active']))
414
-				continue;
424
+			if (empty($subscription['active'])) {
425
+							continue;
426
+			}
415 427
 
416 428
 			echo '
417 429
 			<div class="cat_bar">
@@ -421,9 +433,10 @@  discard block
 block discarded – undo
421 433
 				<p><strong>', $subscription['name'], '</strong></p>
422 434
 				<p class="smalltext">', $subscription['desc'], '</p>';
423 435
 
424
-			if (!$subscription['flexible'])
425
-				echo '
436
+			if (!$subscription['flexible']) {
437
+							echo '
426 438
 				<div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>';
439
+			}
427 440
 
428 441
 			if ($context['user']['is_owner'])
429 442
 			{
@@ -436,24 +449,25 @@  discard block
 block discarded – undo
436 449
 				<select name="cur[', $subscription['id'], ']">';
437 450
 
438 451
 					// Print out the costs for this one.
439
-					foreach ($subscription['costs'] as $duration => $value)
440
-						echo '
452
+					foreach ($subscription['costs'] as $duration => $value) {
453
+											echo '
441 454
 					<option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>';
455
+					}
442 456
 
443 457
 					echo '
444 458
 				</select>';
445
-				}
446
-				else
447
-					echo '
459
+				} else {
460
+									echo '
448 461
 				', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']);
462
+				}
449 463
 
450 464
 				echo '
451 465
 				<hr>
452 466
 				<input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">';
453
-			}
454
-			else
455
-				echo '
467
+			} else {
468
+							echo '
456 469
 				<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>';
470
+			}
457 471
 
458 472
 			echo '
459 473
 			</div><!-- .windowbg -->';
@@ -480,18 +494,19 @@  discard block
 block discarded – undo
480 494
 			</thead>
481 495
 			<tbody>';
482 496
 
483
-	if (empty($context['current']))
484
-		echo '
497
+	if (empty($context['current'])) {
498
+			echo '
485 499
 				<tr class="windowbg">
486 500
 					<td colspan="4">
487 501
 						', $txt['paid_none_yet'], '
488 502
 					</td>
489 503
 				</tr>';
504
+	}
490 505
 
491 506
 	foreach ($context['current'] as $sub)
492 507
 	{
493
-		if (!$sub['hide'])
494
-			echo '
508
+		if (!$sub['hide']) {
509
+					echo '
495 510
 				<tr class="windowbg">
496 511
 					<td>
497 512
 						', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
@@ -502,6 +517,7 @@  discard block
 block discarded – undo
502 517
 					<td>', $sub['start'], '</td>
503 518
 					<td>', $sub['end'], '</td>
504 519
 				</tr>';
520
+		}
505 521
 	}
506 522
 
507 523
 	echo '
@@ -553,15 +569,17 @@  discard block
 block discarded – undo
553 569
 			', $gateway['desc'], '<br>
554 570
 			<form action="', $gateway['form'], '" method="post">';
555 571
 
556
-		if (!empty($gateway['javascript']))
557
-			echo '
572
+		if (!empty($gateway['javascript'])) {
573
+					echo '
558 574
 				<script>
559 575
 					', $gateway['javascript'], '
560 576
 				</script>';
577
+		}
561 578
 
562
-		foreach ($gateway['hidden'] as $name => $value)
563
-			echo '
579
+		foreach ($gateway['hidden'] as $name => $value) {
580
+					echo '
564 581
 				<input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">';
582
+		}
565 583
 
566 584
 		echo '
567 585
 				<br>
Please login to merge, or discard this patch.
Themes/default/Errors.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -328,7 +328,7 @@
 block discarded – undo
328 328
 		foreach ($context['error_info']['backtrace'] as $key => $value)
329 329
 		{
330 330
 			//Check for existing
331
-			if (property_exists($value,'file') || empty($value->file))
331
+			if (property_exists($value, 'file') || empty($value->file))
332 332
 				$value->file = $txt['unknown'];
333 333
 			if (property_exists($value, 'line') || empty($value->line))
334 334
 				$value->line = -1;
Please login to merge, or discard this patch.
Braces   +48 added lines, -33 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@  discard block
 block discarded – undo
23 23
 {
24 24
 	global $context, $txt;
25 25
 
26
-	if (!empty($context['simple_action']))
27
-		echo '
26
+	if (!empty($context['simple_action'])) {
27
+			echo '
28 28
 	<strong>
29 29
 		', $context['error_title'], '
30 30
 	</strong><br>
31 31
 	<div ', $context['error_code'], 'class="padding">
32 32
 		', $context['error_message'], '
33 33
 	</div>';
34
-	else
34
+	} else
35 35
 	{
36 36
 		echo '
37 37
 	<div id="fatal_error">
@@ -85,21 +85,23 @@  discard block
 block discarded – undo
85 85
 
86 86
 	$error_types = array();
87 87
 
88
-	foreach ($context['error_types'] as $type => $details)
89
-		$error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>';
88
+	foreach ($context['error_types'] as $type => $details) {
89
+			$error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt=""> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>';
90
+	}
90 91
 
91 92
 	echo '
92 93
 						', implode(' | ', $error_types), '
93 94
 					</td>
94 95
 				</tr>';
95 96
 
96
-	if ($context['has_filter'])
97
-		echo '
97
+	if ($context['has_filter']) {
98
+			echo '
98 99
 				<tr>
99 100
 					<td colspan="3" class="windowbg">
100 101
 						<strong>', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], ' [<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', '">', $txt['clear_filter'], '</a>]
101 102
 					</td>
102 103
 				</tr>';
104
+	}
103 105
 
104 106
 	echo '
105 107
 				<tr>
@@ -110,11 +112,12 @@  discard block
 block discarded – undo
110 112
 				</tr>';
111 113
 
112 114
 	// No errors, then show a message
113
-	if (count($context['errors']) == 0)
114
-		echo '
115
+	if (count($context['errors']) == 0) {
116
+			echo '
115 117
 				<tr class="windowbg">
116 118
 					<td class="centertext" colspan="2">', $txt['errlog_no_entries'], '</td>
117 119
 				</tr>';
120
+	}
118 121
 
119 122
 	// We have some errors, must be some mods installed :P
120 123
 	foreach ($context['errors'] as $error)
@@ -128,16 +131,18 @@  discard block
 block discarded – undo
128 131
 							<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></a>
129 132
 							', $error['time'], '<br>';
130 133
 
131
-		if (!empty($error['member']['ip']))
132
-			echo '
134
+		if (!empty($error['member']['ip'])) {
135
+					echo '
133 136
 							<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><span class="generic_icons filter centericon"></span></a>
134 137
 							<strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong>';
138
+		}
135 139
 
136
-		if ($error['member']['session'] != '')
137
-			echo '
140
+		if ($error['member']['session'] != '') {
141
+					echo '
138 142
 							<br>
139 143
 							<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><span class="generic_icons filter centericon"></span></a>
140 144
 							', $error['member']['session'], '<br>';
145
+		}
141 146
 
142 147
 		echo '
143 148
 						</div>
@@ -152,12 +157,13 @@  discard block
 block discarded – undo
152 157
 							<a href="', $error['url']['html'], '">', $error['url']['html'], '</a>
153 158
 ';
154 159
 
155
-		if (!empty($error['file']))
156
-			echo '
160
+		if (!empty($error['file'])) {
161
+					echo '
157 162
 							<div>
158 163
 								<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '">'
159 164
 				. '					<span class="generic_icons filter"></span></a> ', $error['file']['link'], ' (', $txt['line'], ' ', $error['file']['line'], ')
160 165
 							</div>';
166
+		}
161 167
 
162 168
 		echo '
163 169
 						</div>
@@ -186,9 +192,10 @@  discard block
 block discarded – undo
186 192
 				</div>
187 193
 			</div>';
188 194
 
189
-	if ($context['sort_direction'] == 'down')
190
-		echo '
195
+	if ($context['sort_direction'] == 'down') {
196
+			echo '
191 197
 			<input type="hidden" name="desc" value="1">';
198
+	}
192 199
 
193 200
 	echo '
194 201
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -249,9 +256,10 @@  discard block
 block discarded – undo
249 256
 					$context['error_message'], '
250 257
 				</div>';
251 258
 	
252
-	if (!empty($context['back_link'])) 
253
-		echo '
259
+	if (!empty($context['back_link'])) {
260
+			echo '
254 261
 				<a class="button" href="', $scripturl, $context['back_link'], '">', $txt['back'], '</a>';
262
+	}
255 263
 
256 264
 	echo '
257 265
 				<span style="float: right; margin:.5em;"></span>
@@ -288,25 +296,30 @@  discard block
 block discarded – undo
288 296
 			<div class="windowbg noup">
289 297
 				<ul class="padding">';
290 298
 
291
-		if (!empty($context['error_info']['error_type']))
292
-			echo '
299
+		if (!empty($context['error_info']['error_type'])) {
300
+					echo '
293 301
 					<li>', $txt['error_type'], ': ', ucfirst($context['error_info']['error_type']), '</li>';
302
+		}
294 303
 
295
-		if (!empty($context['error_info']['message']))
296
-			echo '
304
+		if (!empty($context['error_info']['message'])) {
305
+					echo '
297 306
 					<li>', $txt['error_message'], ': ', $context['error_info']['message'], '</li>';
307
+		}
298 308
 
299
-		if (!empty($context['error_info']['file']))
300
-			echo '
309
+		if (!empty($context['error_info']['file'])) {
310
+					echo '
301 311
 					<li>', $txt['error_file'], ': ', $context['error_info']['file'], '</li>';
312
+		}
302 313
 
303
-		if (!empty($context['error_info']['line']))
304
-			echo '
314
+		if (!empty($context['error_info']['line'])) {
315
+					echo '
305 316
 					<li>', $txt['error_line'], ': ', $context['error_info']['line'], '</li>';
317
+		}
306 318
 
307
-		if (!empty($context['error_info']['url']))
308
-			echo '
319
+		if (!empty($context['error_info']['url'])) {
320
+					echo '
309 321
 					<li>', $txt['error_url'], ': ', $context['error_info']['url'], '</li>';
322
+		}
310 323
 
311 324
 
312 325
 		echo '
@@ -328,10 +341,12 @@  discard block
 block discarded – undo
328 341
 		foreach ($context['error_info']['backtrace'] as $key => $value)
329 342
 		{
330 343
 			//Check for existing
331
-			if (property_exists($value,'file') || empty($value->file))
332
-				$value->file = $txt['unknown'];
333
-			if (property_exists($value, 'line') || empty($value->line))
334
-				$value->line = -1;
344
+			if (property_exists($value,'file') || empty($value->file)) {
345
+							$value->file = $txt['unknown'];
346
+			}
347
+			if (property_exists($value, 'line') || empty($value->line)) {
348
+							$value->line = -1;
349
+			}
335 350
 
336 351
 				echo '
337 352
 					<li class="backtrace">', sprintf($txt['backtrace_info'], $key, $value->function, $value->file, $value->line, base64_encode($value->file)), '</li>';
Please login to merge, or discard this patch.