Completed
Pull Request — release-2.1 (#4375)
by Colin
08:21
created
Themes/default/ManageCalendar.template.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,9 +40,10 @@  discard block
 block discarded – undo
40 40
 							<option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>';
41 41
 
42 42
 	// Show a list of all the years we allow...
43
-	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
44
-		echo '
43
+	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
44
+			echo '
45 45
 							<option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>';
46
+	}
46 47
 
47 48
 	echo '
48 49
 						</select>
@@ -50,9 +51,10 @@  discard block
 block discarded – undo
50 51
 						<select name="month" id="month" onchange="generateDays();">';
51 52
 
52 53
 	// There are 12 months per year - ensure that they all get listed.
53
-	for ($month = 1; $month <= 12; $month++)
54
-		echo '
54
+	for ($month = 1; $month <= 12; $month++) {
55
+			echo '
55 56
 							<option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
57
+	}
56 58
 
57 59
 	echo '
58 60
 						</select>
@@ -60,23 +62,25 @@  discard block
 block discarded – undo
60 62
 						<select name="day" id="day" onchange="generateDays();">';
61 63
 
62 64
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
63
-	for ($day = 1; $day <= $context['holiday']['last_day']; $day++)
64
-		echo '
65
+	for ($day = 1; $day <= $context['holiday']['last_day']; $day++) {
66
+			echo '
65 67
 							<option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>';
68
+	}
66 69
 
67 70
 	echo '
68 71
 						</select>
69 72
 					</dd>
70 73
 				</dl>';
71 74
 
72
-	if ($context['is_new'])
73
-		echo '
75
+	if ($context['is_new']) {
76
+			echo '
74 77
 				<input type="submit" value="', $txt['holidays_button_add'], '" class="button">';
75
-	else
76
-		echo '
78
+	} else {
79
+			echo '
77 80
 				<input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button">
78 81
 				<input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button">
79 82
 				<input type="hidden" name="holiday" value="', $context['holiday']['id'], '">';
83
+	}
80 84
 	echo '
81 85
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
82 86
 			</div><!-- .windowbg2 -->
Please login to merge, or discard this patch.
Themes/default/Register.template.php 1 patch
Braces   +90 added lines, -65 removed lines patch added patch discarded remove patch
@@ -28,14 +28,15 @@  discard block
 block discarded – undo
28 28
 			<div id="confirm_buttons">';
29 29
 
30 30
 	// Age restriction in effect?
31
-	if ($context['show_coppa'])
32
-		echo '
31
+	if ($context['show_coppa']) {
32
+			echo '
33 33
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br>
34 34
 				<br>
35 35
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
36
-	else
37
-		echo '
36
+	} else {
37
+			echo '
38 38
 				<input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button">';
39
+	}
39 40
 
40 41
 	echo '
41 42
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -78,9 +79,10 @@  discard block
 block discarded – undo
78 79
 			<ul>';
79 80
 
80 81
 		// Cycle through each error and display an error message.
81
-		foreach ($context['registration_errors'] as $error)
82
-			echo '
82
+		foreach ($context['registration_errors'] as $error) {
83
+					echo '
83 84
 				<li>', $error, '</li>';
85
+		}
84 86
 
85 87
 		echo '
86 88
 			</ul>
@@ -149,14 +151,15 @@  discard block
 block discarded – undo
149 151
 		echo '
150 152
 					<dl class="register_form">';
151 153
 
152
-		foreach ($context['custom_fields'] as $field)
153
-			if ($field['show_reg'] > 1)
154
+		foreach ($context['custom_fields'] as $field) {
155
+					if ($field['show_reg'] > 1)
154 156
 				echo '
155 157
 						<dt>
156 158
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
157 159
 							<span class="smalltext">', $field['desc'], '</span>
158 160
 						</dt>
159 161
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
162
+		}
160 163
 
161 164
 		echo '
162 165
 					</dl>';
@@ -167,14 +170,15 @@  discard block
 block discarded – undo
167 170
 			</div><!-- .roundframe -->';
168 171
 
169 172
 	// If we have either of these, show the extra group.
170
-	if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
171
-		echo '
173
+	if (!empty($context['profile_fields']) || !empty($context['custom_fields'])) {
174
+			echo '
172 175
 			<div class="title_bar title_top">
173 176
 				<h3 class="titlebg">', $txt['additional_information'], '</h3>
174 177
 			</div>
175 178
 			<div class="roundframe noup">
176 179
 				<fieldset>
177 180
 					<dl class="register_form" id="custom_group">';
181
+	}
178 182
 
179 183
 	if (!empty($context['profile_fields']))
180 184
 	{
@@ -188,41 +192,45 @@  discard block
 block discarded – undo
188 192
 					$callback_func = 'template_profile_' . $field['callback_func'];
189 193
 					$callback_func();
190 194
 				}
191
-			}
192
-			else
195
+			} else
193 196
 			{
194 197
 				echo '
195 198
 						<dt>
196 199
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>';
197 200
 
198 201
 				// Does it have any subtext to show?
199
-				if (!empty($field['subtext']))
200
-					echo '
202
+				if (!empty($field['subtext'])) {
203
+									echo '
201 204
 							<span class="smalltext">', $field['subtext'], '</span>';
205
+				}
202 206
 
203 207
 				echo '
204 208
 						</dt>
205 209
 						<dd>';
206 210
 
207 211
 				// Want to put something infront of the box?
208
-				if (!empty($field['preinput']))
209
-					echo '
212
+				if (!empty($field['preinput'])) {
213
+									echo '
210 214
 							', $field['preinput'];
215
+				}
211 216
 
212 217
 				// What type of data are we showing?
213
-				if ($field['type'] == 'label')
214
-					echo '
218
+				if ($field['type'] == 'label') {
219
+									echo '
215 220
 							', $field['value'];
221
+				}
216 222
 
217 223
 				// Maybe it's a text box - very likely!
218
-				elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
219
-					echo '
224
+				elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) {
225
+									echo '
220 226
 							<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
227
+				}
221 228
 
222 229
 				// You "checking" me out? ;)
223
-				elseif ($field['type'] == 'check')
224
-					echo '
230
+				elseif ($field['type'] == 'check') {
231
+									echo '
225 232
 							<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
233
+				}
226 234
 
227 235
 				// Always fun - select boxes!
228 236
 				elseif ($field['type'] == 'select')
@@ -233,14 +241,16 @@  discard block
 block discarded – undo
233 241
 					if (isset($field['options']))
234 242
 					{
235 243
 						// Is this some code to generate the options?
236
-						if (!is_array($field['options']))
237
-							$field['options'] = eval($field['options']);
244
+						if (!is_array($field['options'])) {
245
+													$field['options'] = eval($field['options']);
246
+						}
238 247
 
239 248
 						// Assuming we now have some!
240
-						if (is_array($field['options']))
241
-							foreach ($field['options'] as $value => $name)
249
+						if (is_array($field['options'])) {
250
+													foreach ($field['options'] as $value => $name)
242 251
 								echo '
243 252
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
253
+						}
244 254
 					}
245 255
 
246 256
 					echo '
@@ -248,9 +258,10 @@  discard block
 block discarded – undo
248 258
 				}
249 259
 
250 260
 				// Something to end with?
251
-				if (!empty($field['postinput']))
252
-					echo '
261
+				if (!empty($field['postinput'])) {
262
+									echo '
253 263
 							', $field['postinput'];
264
+				}
254 265
 
255 266
 				echo '
256 267
 						</dd>';
@@ -261,25 +272,27 @@  discard block
 block discarded – undo
261 272
 	// Are there any custom fields?
262 273
 	if (!empty($context['custom_fields']))
263 274
 	{
264
-		foreach ($context['custom_fields'] as $field)
265
-			if ($field['show_reg'] < 2)
275
+		foreach ($context['custom_fields'] as $field) {
276
+					if ($field['show_reg'] < 2)
266 277
 				echo '
267 278
 						<dt>
268 279
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
269 280
 							<span class="smalltext">', $field['desc'], '</span>
270 281
 						</dt>
271 282
 						<dd>', $field['input_html'], '</dd>';
283
+		}
272 284
 	}
273 285
 
274 286
 	// If we have either of these, close the list like a proper gent.
275
-	if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
276
-		echo '
287
+	if (!empty($context['profile_fields']) || !empty($context['custom_fields'])) {
288
+			echo '
277 289
 					</dl>
278 290
 				</fieldset>
279 291
 			</div><!-- .roundframe -->';
292
+	}
280 293
 
281
-	if ($context['visual_verification'])
282
-		echo '
294
+	if ($context['visual_verification']) {
295
+			echo '
283 296
 			<div class="title_bar title_top">
284 297
 				<h3 class="titlebg">', $txt['verification'], '</h3>
285 298
 			</div>
@@ -288,19 +301,21 @@  discard block
 block discarded – undo
288 301
 					', template_control_verification($context['visual_verification_id'], 'all'), '
289 302
 				</fieldset>
290 303
 			</div>';
304
+	}
291 305
 
292 306
 	echo '
293 307
 			<div id="confirm_buttons" class="flow_auto">';
294 308
 
295 309
 	// Age restriction in effect?
296
-	if (!$context['require_agreement'] && $context['show_coppa'])
297
-		echo '
310
+	if (!$context['require_agreement'] && $context['show_coppa']) {
311
+			echo '
298 312
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br>
299 313
 				<br>
300 314
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
301
-	else
302
-		echo '
315
+	} else {
316
+			echo '
303 317
 				<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">';
318
+	}
304 319
 
305 320
 	echo '
306 321
 			</div>
@@ -362,25 +377,28 @@  discard block
 block discarded – undo
362 377
 				<p>', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</p>';
363 378
 
364 379
 	// Can they send by post?
365
-	if (!empty($context['coppa']['post']))
366
-		echo '
380
+	if (!empty($context['coppa']['post'])) {
381
+			echo '
367 382
 				<h4>1) ', $txt['coppa_send_by_post'], '</h4>
368 383
 				<div class="coppa_contact">
369 384
 					', $context['coppa']['post'], '
370 385
 				</div>';
386
+	}
371 387
 
372 388
 	// Can they send by fax??
373
-	if (!empty($context['coppa']['fax']))
374
-		echo '
389
+	if (!empty($context['coppa']['fax'])) {
390
+			echo '
375 391
 				<h4>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</h4>
376 392
 				<div class="coppa_contact">
377 393
 					', $context['coppa']['fax'], '
378 394
 				</div>';
395
+	}
379 396
 
380 397
 	// Offer an alternative Phone Number?
381
-	if ($context['coppa']['phone'])
382
-		echo '
398
+	if ($context['coppa']['phone']) {
399
+			echo '
383 400
 				<p>', $context['coppa']['phone'], '</p>';
401
+	}
384 402
 
385 403
 	echo '
386 404
 			</div><!-- #coppa -->';
@@ -445,19 +463,20 @@  discard block
 block discarded – undo
445 463
 	<body style="margin: 1ex;">
446 464
 		<div class="windowbg description" style="text-align: center;">';
447 465
 
448
-	if (isBrowser('is_ie') || isBrowser('is_ie11'))
449
-		echo '
466
+	if (isBrowser('is_ie') || isBrowser('is_ie11')) {
467
+			echo '
450 468
 			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
451 469
 				<param name="AutoStart" value="1">
452 470
 				<param name="FileName" value="', $context['verification_sound_href'], '">
453 471
 			</object>';
454
-	else
455
-		echo '
472
+	} else {
473
+			echo '
456 474
 			<audio src="', $context['verification_sound_href'], '" controls>
457 475
 				<object type="audio/x-wav" data="', $context['verification_sound_href'], '">
458 476
 					<a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
459 477
 				</object>
460 478
 			</audio>';
479
+	}
461 480
 
462 481
 	echo '
463 482
 			<br>
@@ -485,11 +504,12 @@  discard block
 block discarded – undo
485 504
 				</div>
486 505
 				<div id="register_screen" class="windowbg2 noup">';
487 506
 
488
-	if (!empty($context['registration_done']))
489
-		echo '
507
+	if (!empty($context['registration_done'])) {
508
+			echo '
490 509
 					<div class="infobox">
491 510
 						', $context['registration_done'], '
492 511
 					</div>';
512
+	}
493 513
 
494 514
 	echo '
495 515
 					<dl class="register_form" id="admin_register_form">
@@ -525,9 +545,10 @@  discard block
 block discarded – undo
525 545
 						<dd>
526 546
 							<select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
527 547
 
528
-		foreach ($context['member_groups'] as $id => $name)
529
-			echo '
548
+		foreach ($context['member_groups'] as $id => $name) {
549
+					echo '
530 550
 								<option value="', $id, '">', $name, '</option>';
551
+		}
531 552
 
532 553
 		echo '
533 554
 							</select>
@@ -535,8 +556,8 @@  discard block
 block discarded – undo
535 556
 	}
536 557
 
537 558
 	// If there is any field marked as required, show it here!
538
-	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
539
-		foreach ($context['custom_fields'] as $field)
559
+	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) {
560
+			foreach ($context['custom_fields'] as $field)
540 561
 			if ($field['show_reg'] > 1)
541 562
 				echo '
542 563
 						<dt>
@@ -546,6 +567,7 @@  discard block
 block discarded – undo
546 567
 						<dd>
547 568
 							', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '
548 569
 						</dd>';
570
+	}
549 571
 
550 572
 	echo '
551 573
 						<dt>
@@ -582,13 +604,13 @@  discard block
 block discarded – undo
582 604
 {
583 605
 	global $context, $scripturl, $txt;
584 606
 
585
-	if (!empty($context['saved_successful']))
586
-		echo '
607
+	if (!empty($context['saved_successful'])) {
608
+			echo '
587 609
 		<div class="infobox">', $txt['settings_saved'], '</div>';
588
-
589
-	elseif (!empty($context['could_not_save']))
590
-		echo '
610
+	} elseif (!empty($context['could_not_save'])) {
611
+			echo '
591 612
 		<div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
613
+	}
592 614
 
593 615
 	// Just a big box to edit the text file ;)
594 616
 	echo '
@@ -598,9 +620,10 @@  discard block
 block discarded – undo
598 620
 			</div>';
599 621
 
600 622
 	// Warning for if the file isn't writable.
601
-	if (!empty($context['warning']))
602
-		echo '
623
+	if (!empty($context['warning'])) {
624
+			echo '
603 625
 			<p class="error">', $context['warning'], '</p>';
626
+	}
604 627
 
605 628
 	echo '
606 629
 			<div class="windowbg2 noup" id="registration_agreement">';
@@ -617,9 +640,10 @@  discard block
 block discarded – undo
617 640
 						<strong>', $txt['admin_agreement_select_language'], ':</strong>
618 641
 						<select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
619 642
 
620
-		foreach ($context['editable_agreements'] as $file => $name)
621
-			echo '
643
+		foreach ($context['editable_agreements'] as $file => $name) {
644
+					echo '
622 645
 							<option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
646
+		}
623 647
 
624 648
 		echo '
625 649
 						</select>
@@ -659,9 +683,10 @@  discard block
 block discarded – undo
659 683
 {
660 684
 	global $context, $scripturl, $txt;
661 685
 
662
-	if (!empty($context['saved_successful']))
663
-		echo '
686
+	if (!empty($context['saved_successful'])) {
687
+			echo '
664 688
 	<div class="infobox">', $txt['settings_saved'], '</div>';
689
+	}
665 690
 
666 691
 	echo '
667 692
 	<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
Please login to merge, or discard this patch.
Themes/default/MoveTopic.template.php 1 patch
Braces   +32 added lines, -23 removed lines patch added patch discarded remove patch
@@ -37,9 +37,10 @@  discard block
 block discarded – undo
37 37
 		echo '
38 38
 								<optgroup label="', $category['name'], '">';
39 39
 
40
-		foreach ($category['boards'] as $board)
41
-			echo '
40
+		foreach ($category['boards'] as $board) {
41
+					echo '
42 42
 									<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=&gt; ' : '', $board['name'], '</option>';
43
+		}
43 44
 		echo '
44 45
 								</optgroup>';
45 46
 	}
@@ -70,9 +71,10 @@  discard block
 block discarded – undo
70 71
 				</div><!-- .move_topic -->
71 72
 			</div><!-- .windowbg -->';
72 73
 
73
-	if ($context['back_to_topic'])
74
-		echo '
74
+	if ($context['back_to_topic']) {
75
+			echo '
75 76
 			<input type="hidden" name="goback" value="1">';
77
+	}
76 78
 
77 79
 	echo '
78 80
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -125,10 +127,10 @@  discard block
 block discarded – undo
125 127
 									<option value="86400">', $txt['two_months'], '</option>
126 128
 								</select>
127 129
 							</dd>';
128
-	}
129
-	else
130
-		echo '
130
+	} else {
131
+			echo '
131 132
 							<input type="hidden" name="redirect_expires" value="0">';
133
+	}
132 134
 
133 135
 	echo '
134 136
 						</dl>
@@ -207,9 +209,10 @@  discard block
 block discarded – undo
207 209
 			echo '
208 210
 							<optgroup label="', $cat['name'], '">';
209 211
 
210
-			foreach ($cat['boards'] as $board)
211
-				echo '
212
+			foreach ($cat['boards'] as $board) {
213
+							echo '
212 214
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
215
+			}
213 216
 
214 217
 			echo '
215 218
 							</optgroup>';
@@ -220,9 +223,9 @@  discard block
 block discarded – undo
220 223
 						<input type="submit" value="', $txt['go'], '" class="button">
221 224
 					</form>';
222 225
 
226
+	} else {
227
+			echo $txt['target_below'];
223 228
 	}
224
-	else
225
-		echo $txt['target_below'];
226 229
 
227 230
 	echo '		</h4>
228 231
 			</div><!-- .title_bar -->';
@@ -240,12 +243,13 @@  discard block
 block discarded – undo
240 243
 
241 244
 		$merge_button = create_button('merge', 'merge', '');
242 245
 
243
-		foreach ($context['topics'] as $topic)
244
-			echo '
246
+		foreach ($context['topics'] as $topic) {
247
+					echo '
245 248
 						<li>
246 249
 							<a href="', $scripturl, '?action=mergetopics;sa=options;board=', $context['current_board'], '.0;from=', $context['origin_topic'], ';to=', $topic['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $merge_button, '</a>
247 250
 							<a href="', $scripturl, '?topic=', $topic['id'], '.0" target="_blank">', $topic['subject'], '</a> ', $txt['started_by'], ' ', $topic['poster']['link'], '
248 251
 						</li>';
252
+		}
249 253
 
250 254
 		echo '
251 255
 					</ul>
@@ -256,9 +260,10 @@  discard block
 block discarded – undo
256 260
 				</div>';
257 261
 	}
258 262
 	// Just a nice "There aren't any topics" message
259
-	else
260
-		echo '
263
+	else {
264
+			echo '
261 265
 				<div class="windowbg2">', $txt['topic_alert_none'], '</div>';
266
+	}
262 267
 
263 268
 	echo '
264 269
 				<br>
@@ -308,8 +313,8 @@  discard block
 block discarded – undo
308 313
 				</thead>
309 314
 				<tbody>';
310 315
 
311
-	foreach ($context['topics'] as $topic)
312
-		echo '
316
+	foreach ($context['topics'] as $topic) {
317
+			echo '
313 318
 					<tr class="windowbg">
314 319
 						<td>
315 320
 							<input type="checkbox" name="topics[]" value="' . $topic['id'] . '" checked>
@@ -329,6 +334,7 @@  discard block
 block discarded – undo
329 334
 							<input type="checkbox" name="notifications[]" value="' . $topic['id'] . '" checked>
330 335
 						</td>
331 336
 					</tr>';
337
+	}
332 338
 	echo '
333 339
 				</tbody>
334 340
 			</table>
@@ -338,9 +344,10 @@  discard block
 block discarded – undo
338 344
 					<legend>', $txt['merge_select_subject'], '</legend>
339 345
 					<select name="subject" onchange="this.form.custom_subject.style.display = (this.options[this.selectedIndex].value != 0) ? \'none\': \'\' ;">';
340 346
 
341
-	foreach ($context['topics'] as $topic)
342
-		echo '
347
+	foreach ($context['topics'] as $topic) {
348
+			echo '
343 349
 						<option value="', $topic['id'], '"' . ($topic['selected'] ? ' selected' : '') . '>', $topic['subject'], '</option>';
350
+	}
344 351
 	echo '
345 352
 						<option value="0">', $txt['merge_custom_subject'], ':</option>
346 353
 					</select>
@@ -359,11 +366,12 @@  discard block
 block discarded – undo
359 366
 					<legend>', $txt['merge_select_target_board'], '</legend>
360 367
 					<ul>';
361 368
 
362
-		foreach ($context['boards'] as $board)
363
-			echo '
369
+		foreach ($context['boards'] as $board) {
370
+					echo '
364 371
 						<li>
365 372
 							<input type="radio" name="board" value="' . $board['id'] . '"' . ($board['selected'] ? ' checked' : '') . '> ' . $board['name'] . '
366 373
 						</li>';
374
+		}
367 375
 		echo '
368 376
 					</ul>
369 377
 				</fieldset>';
@@ -375,11 +383,12 @@  discard block
 block discarded – undo
375 383
 					<legend>' . $txt['merge_select_poll'] . '</legend>
376 384
 					<ul>';
377 385
 
378
-		foreach ($context['polls'] as $poll)
379
-			echo '
386
+		foreach ($context['polls'] as $poll) {
387
+					echo '
380 388
 						<li>
381 389
 							<input type="radio" name="poll" value="' . $poll['id'] . '"' . ($poll['selected'] ? ' checked' : '') . '> ' . $poll['question'] . ' (' . $txt['topic'] . ': <a href="' . $scripturl . '?topic=' . $poll['topic']['id'] . '.0" target="_blank">' . $poll['topic']['subject'] . '</a>)
382 390
 						</li>';
391
+		}
383 392
 		echo '
384 393
 						<li>
385 394
 							<input type="radio" name="poll" value="-1"> (' . $txt['merge_no_poll'] . ')
Please login to merge, or discard this patch.
Themes/default/Search.template.php 1 patch
Braces   +90 added lines, -65 removed lines patch added patch discarded remove patch
@@ -25,15 +25,17 @@  discard block
 block discarded – undo
25 25
 			</h3>
26 26
 		</div>';
27 27
 
28
-	if (!empty($context['search_errors']))
29
-		echo '
28
+	if (!empty($context['search_errors'])) {
29
+			echo '
30 30
 		<div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>';
31
+	}
31 32
 
32
-	if (!empty($context['search_ignored']))
33
-		echo '
33
+	if (!empty($context['search_ignored'])) {
34
+			echo '
34 35
 		<p class="noticebox">
35 36
 			', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '
36 37
 		</p>';
38
+	}
37 39
 
38 40
 	echo '
39 41
 		<div id="advanced_search" class="roundframe">
@@ -44,9 +46,10 @@  discard block
 block discarded – undo
44 46
 				<dd>
45 47
 					<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">';
46 48
 
47
-	if (empty($modSettings['search_simple_fulltext']))
48
-		echo '
49
+	if (empty($modSettings['search_simple_fulltext'])) {
50
+			echo '
49 51
 					<br><em class="smalltext">', $txt['search_example'], '</em>';
52
+	}
50 53
 
51 54
 	echo '
52 55
 				</dd>
@@ -110,21 +113,23 @@  discard block
 block discarded – undo
110 113
 			<input type="hidden" name="advanced" value="1">';
111 114
 
112 115
 	// Require an image to be typed to save spamming?
113
-	if ($context['require_verification'])
114
-		echo '
116
+	if ($context['require_verification']) {
117
+			echo '
115 118
 			<p>
116 119
 				<strong>', $txt['verification'], ':</strong>
117 120
 				', template_control_verification($context['visual_verification_id'], 'all'), '
118 121
 			</p>';
122
+	}
119 123
 
120 124
 	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
121
-	if (!empty($context['search_params']['topic']))
122
-		echo '
125
+	if (!empty($context['search_params']['topic'])) {
126
+			echo '
123 127
 			<p>
124 128
 				', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.
125 129
 			</p>
126 130
 			<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
127 131
 			<input type="submit" name="b_search" value="', $txt['search'], '" class="button">';
132
+	}
128 133
 
129 134
 	echo '
130 135
 		</div>';
@@ -154,14 +159,15 @@  discard block
 block discarded – undo
154 159
 
155 160
 			foreach ($category['boards'] as $board)
156 161
 			{
157
-				if ($i == $limit)
158
-					echo '
162
+				if ($i == $limit) {
163
+									echo '
159 164
 							</ul>
160 165
 						</li>
161 166
 					</ul>
162 167
 					<ul class="ignoreboards floatright">
163 168
 						<li class="category">
164 169
 							<ul>';
170
+				}
165 171
 
166 172
 				echo '
167 173
 								<li class="board">
@@ -249,17 +255,19 @@  discard block
 block discarded – undo
249 255
 		<div class="roundframe">';
250 256
 
251 257
 		// Did they make any typos or mistakes, perhaps?
252
-		if (isset($context['did_you_mean']))
253
-			echo '
258
+		if (isset($context['did_you_mean'])) {
259
+					echo '
254 260
 			<p>
255 261
 				', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.
256 262
 			</p>';
263
+		}
257 264
 
258
-		if (!empty($context['search_ignored']))
259
-			echo '
265
+		if (!empty($context['search_ignored'])) {
266
+					echo '
260 267
 			<p>
261 268
 				', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '
262 269
 			</p>';
270
+		}
263 271
 
264 272
 		echo '
265 273
 			<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
@@ -282,10 +290,11 @@  discard block
 block discarded – undo
282 290
 					<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">
283 291
 				</div>';
284 292
 
285
-		if (!empty($context['search_params']['brd']))
286
-			foreach ($context['search_params']['brd'] as $board_id)
293
+		if (!empty($context['search_params']['brd'])) {
294
+					foreach ($context['search_params']['brd'] as $board_id)
287 295
 				echo '
288 296
 				<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
297
+		}
289 298
 
290 299
 		echo '
291 300
 			</form>
@@ -297,18 +306,20 @@  discard block
 block discarded – undo
297 306
 	if ($context['compact'])
298 307
 	{
299 308
 		// Quick moderation set to checkboxes? Oh, how fun :/
300
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
301
-			echo '
309
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
310
+					echo '
302 311
 	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
312
+		}
303 313
 
304 314
 		echo '
305 315
 		<div class="cat_bar">
306 316
 			<h3 class="catbg">
307 317
 				<span class="floatright">';
308 318
 
309
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
310
-			echo '
319
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
320
+					echo '
311 321
 					<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">';
322
+		}
312 323
 		echo '
313 324
 				</span>
314 325
 				<span class="generic_icons filter"></span> ', $txt['mlist_search_results'], ': ', $context['search_params']['search'], '
@@ -316,15 +327,15 @@  discard block
 block discarded – undo
316 327
 		</div>';
317 328
 
318 329
 		// Was anything even found?
319
-		if (!empty($context['topics']))
320
-			echo '
330
+		if (!empty($context['topics'])) {
331
+					echo '
321 332
 		<div class="pagesection">
322 333
 			<span>', $context['page_index'], '</span>
323 334
 		</div>';
324
-
325
-		else
326
-			echo '
335
+		} else {
336
+					echo '
327 337
 		<div class="roundframe">', $txt['find_no_results'], '</div>';
338
+		}
328 339
 
329 340
 		// While we have results to show ...
330 341
 		while ($topic = $context['get_topics']())
@@ -347,41 +358,46 @@  discard block
 block discarded – undo
347 358
 					echo '
348 359
 				<div class="floatright">';
349 360
 
350
-					if ($options['display_quick_mod'] == 1)
351
-						echo '
361
+					if ($options['display_quick_mod'] == 1) {
362
+											echo '
352 363
 					<input type="checkbox" name="topics[]" value="', $topic['id'], '">';
353
-
354
-					else
364
+					} else
355 365
 					{
356
-						if ($topic['quick_mod']['remove'])
357
-							echo '
366
+						if ($topic['quick_mod']['remove']) {
367
+													echo '
358 368
 					<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
369
+						}
359 370
 
360
-						if ($topic['quick_mod']['lock'])
361
-							echo '
371
+						if ($topic['quick_mod']['lock']) {
372
+													echo '
362 373
 					<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
374
+						}
363 375
 
364
-						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
365
-							echo '
376
+						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
377
+													echo '
366 378
 					<br>';
379
+						}
367 380
 
368
-						if ($topic['quick_mod']['sticky'])
369
-							echo '
381
+						if ($topic['quick_mod']['sticky']) {
382
+													echo '
370 383
 					<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
384
+						}
371 385
 
372
-						if ($topic['quick_mod']['move'])
373
-							echo '
386
+						if ($topic['quick_mod']['move']) {
387
+													echo '
374 388
 					<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
389
+						}
375 390
 					}
376 391
 
377 392
 					echo '
378 393
 				</div><!-- .floatright -->';
379 394
 				}
380 395
 
381
-				if ($message['body_highlighted'] != '')
382
-					echo '
396
+				if ($message['body_highlighted'] != '') {
397
+									echo '
383 398
 				<br class="clear">
384 399
 				<div class="list_posts double_height">', $message['body_highlighted'], '</div>';
400
+				}
385 401
 			}
386 402
 
387 403
 			echo '
@@ -389,11 +405,12 @@  discard block
 block discarded – undo
389 405
 		</div><!-- $topic[css_class] -->';
390 406
 
391 407
 		}
392
-		if (!empty($context['topics']))
393
-			echo '
408
+		if (!empty($context['topics'])) {
409
+					echo '
394 410
 		<div class="pagesection">
395 411
 			<span>', $context['page_index'], '</span>
396 412
 		</div>';
413
+		}
397 414
 
398 415
 		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
399 416
 		{
@@ -402,17 +419,19 @@  discard block
 block discarded – undo
402 419
 			<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
403 420
 				<option value="">--------</option>';
404 421
 
405
-			foreach ($context['qmod_actions'] as $qmod_action)
406
-				if ($context['can_' . $qmod_action])
422
+			foreach ($context['qmod_actions'] as $qmod_action) {
423
+							if ($context['can_' . $qmod_action])
407 424
 					echo '
408 425
 				<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
426
+			}
409 427
 
410 428
 			echo '
411 429
 			</select>';
412 430
 
413
-			if ($context['can_move'])
414
-				echo '
431
+			if ($context['can_move']) {
432
+							echo '
415 433
 			<span id="quick_mod_jump_to"></span>';
434
+			}
416 435
 
417 436
 			echo '
418 437
 			<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '">
@@ -421,13 +440,13 @@  discard block
 block discarded – undo
421 440
 		}
422 441
 
423 442
 
424
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
425
-			echo '
443
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
444
+					echo '
426 445
 		<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
427 446
 	</form>';
447
+		}
428 448
 
429
-	}
430
-	else
449
+	} else
431 450
 	{
432 451
 		echo '
433 452
 	<div class="cat_bar">
@@ -439,9 +458,10 @@  discard block
 block discarded – undo
439 458
 		<span>', $context['page_index'], '</span>
440 459
 	</div>';
441 460
 
442
-		if (empty($context['topics']))
443
-			echo '
461
+		if (empty($context['topics'])) {
462
+					echo '
444 463
 	<div class="information">(', $txt['search_no_results'], ')</div>';
464
+		}
445 465
 
446 466
 		while ($topic = $context['get_topics']())
447 467
 		{
@@ -458,23 +478,27 @@  discard block
 block discarded – undo
458 478
 		</div>
459 479
 		<div class="list_posts">', $message['body_highlighted'], '</div>';
460 480
 
461
-			if ($topic['can_reply'])
462
-				echo '
481
+			if ($topic['can_reply']) {
482
+							echo '
463 483
 		<ul class="quickbuttons">';
484
+			}
464 485
 
465 486
 			// If they *can* reply?
466
-			if ($topic['can_reply'])
467
-				echo '
487
+			if ($topic['can_reply']) {
488
+							echo '
468 489
 			<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
490
+			}
469 491
 
470 492
 			// If they *can* quote?
471
-			if ($topic['can_quote'])
472
-				echo '
493
+			if ($topic['can_quote']) {
494
+							echo '
473 495
 			<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
496
+			}
474 497
 
475
-			if ($topic['can_reply'])
476
-				echo '
498
+			if ($topic['can_reply']) {
499
+							echo '
477 500
 		</ul>';
501
+			}
478 502
 			echo '
479 503
 		<br class="clear">
480 504
 	</div><!-- $topic[css_class] -->';
@@ -493,8 +517,8 @@  discard block
 block discarded – undo
493 517
 	<div class="smalltext righttext" id="search_jump_to"></div>
494 518
 	<script>';
495 519
 
496
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
497
-		echo '
520
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
521
+			echo '
498 522
 		if (typeof(window.XMLHttpRequest) != "undefined")
499 523
 			aJumpTo[aJumpTo.length] = new JumpTo({
500 524
 				sContainerId: "quick_mod_jump_to",
@@ -509,6 +533,7 @@  discard block
 block discarded – undo
509 533
 				bDisabled: true,
510 534
 				sCustomName: "move_to"
511 535
 			});';
536
+	}
512 537
 
513 538
 	echo '
514 539
 		if (typeof(window.XMLHttpRequest) != "undefined")
Please login to merge, or discard this patch.
Themes/default/Errors.template.php 1 patch
Braces   +24 added lines, -17 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,19 +131,21 @@  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 140
 		echo '
137 141
 						</div>
138 142
 						<div class="error_info">';
139 143
 
140
-		if ($error['member']['session'] != '')
141
-			echo '
144
+		if ($error['member']['session'] != '') {
145
+					echo '
142 146
 							<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>
143 147
 							', $error['member']['session'], '<br>';
148
+		}
144 149
 
145 150
 		echo '
146 151
 							<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=error_type;value=', $error['error_type']['type'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '"><span class="generic_icons filter centericon"></span></a>
@@ -154,8 +159,8 @@  discard block
 block discarded – undo
154 159
 							<a href="', $error['url']['html'], '">', $error['url']['html'], '</a>
155 160
 						</div>';
156 161
 
157
-		if (!empty($error['file']))
158
-			echo '
162
+		if (!empty($error['file'])) {
163
+					echo '
159 164
 						<div class="error_location">
160 165
 							<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'], '"><span class="generic_icons filter"></span></a>
161 166
 							<div>
@@ -163,6 +168,7 @@  discard block
 block discarded – undo
163 168
 								', $txt['line'], ': ', $error['file']['line'], '
164 169
 							</div>
165 170
 						</div>';
171
+		}
166 172
 
167 173
 		echo '
168 174
 					</td>
@@ -190,9 +196,10 @@  discard block
 block discarded – undo
190 196
 				</div>
191 197
 			</div>';
192 198
 
193
-	if ($context['sort_direction'] == 'down')
194
-		echo '
199
+	if ($context['sort_direction'] == 'down') {
200
+			echo '
195 201
 			<input type="hidden" name="desc" value="1">';
202
+	}
196 203
 
197 204
 	echo '
198 205
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
Please login to merge, or discard this patch.
Themes/default/ManagePaid.template.php 1 patch
Braces   +66 added lines, -47 removed lines patch added patch discarded remove patch
@@ -24,11 +24,12 @@  discard block
 block discarded – undo
24 24
 				<h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3>
25 25
 			</div>';
26 26
 
27
-	if (!empty($context['disable_groups']))
28
-		echo '
27
+	if (!empty($context['disable_groups'])) {
28
+			echo '
29 29
 			<div class="information">
30 30
 				<span class="alert">', $txt['paid_mod_edit_note'], '</span>
31 31
 			</div>';
32
+	}
32 33
 
33 34
 	echo '
34 35
 			<div class="windowbg2">
@@ -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>
@@ -142,8 +145,8 @@  discard block
 block discarded – undo
142 145
 					<fieldset>';
143 146
 
144 147
 	//!! Removed until implemented
145
-	if (!empty($sdflsdhglsdjgs))
146
-		echo '
148
+	if (!empty($sdflsdhglsdjgs)) {
149
+			echo '
147 150
 						<dl class="settings">
148 151
 							<dt>
149 152
 								<label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span>
@@ -152,6 +155,7 @@  discard block
 block discarded – undo
152 155
 								<input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', '>
153 156
 							</dd>
154 157
 						</dl>';
158
+	}
155 159
 
156 160
 	echo '
157 161
 						<div class="information">
@@ -250,8 +254,8 @@  discard block
 block discarded – undo
250 254
 				<dl class="settings">';
251 255
 
252 256
 	// Do we need a username?
253
-	if ($context['action_type'] == 'add')
254
-		echo '
257
+	if ($context['action_type'] == 'add') {
258
+			echo '
255 259
 					<dt>
256 260
 						<strong>', $txt['paid_username'], ':</strong><br>
257 261
 						<span class="smalltext">', $txt['one_username'], '</span>
@@ -259,6 +263,7 @@  discard block
 block discarded – undo
259 263
 					<dd>
260 264
 						<input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30">
261 265
 					</dd>';
266
+	}
262 267
 
263 268
 	echo '
264 269
 					<dt>
@@ -276,9 +281,10 @@  discard block
 block discarded – undo
276 281
 					<select name="year" id="year" onchange="generateDays();">';
277 282
 
278 283
 	// Show a list of all the years we allow...
279
-	for ($year = 2005; $year <= 2030; $year++)
280
-		echo '
284
+	for ($year = 2005; $year <= 2030; $year++) {
285
+			echo '
281 286
 						<option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>';
287
+	}
282 288
 
283 289
 	echo '
284 290
 					</select>&nbsp;
@@ -286,9 +292,10 @@  discard block
 block discarded – undo
286 292
 					<select name="month" id="month" onchange="generateDays();">';
287 293
 
288 294
 	// There are 12 months per year - ensure that they all get listed.
289
-	for ($month = 1; $month <= 12; $month++)
290
-		echo '
295
+	for ($month = 1; $month <= 12; $month++) {
296
+			echo '
291 297
 						<option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
298
+	}
292 299
 
293 300
 	echo '
294 301
 					</select>&nbsp;
@@ -296,9 +303,10 @@  discard block
 block discarded – undo
296 303
 					<select name="day" id="day">';
297 304
 
298 305
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
299
-	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
300
-		echo '
306
+	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) {
307
+			echo '
301 308
 						<option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>';
309
+	}
302 310
 
303 311
 	echo '
304 312
 					</select>
@@ -310,9 +318,10 @@  discard block
 block discarded – undo
310 318
 					<select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
311 319
 
312 320
 	// Show a list of all the years we allow...
313
-	for ($year = 2005; $year <= 2030; $year++)
314
-		echo '
321
+	for ($year = 2005; $year <= 2030; $year++) {
322
+			echo '
315 323
 						<option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>';
324
+	}
316 325
 
317 326
 	echo '
318 327
 					</select>&nbsp;
@@ -320,9 +329,10 @@  discard block
 block discarded – undo
320 329
 					<select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
321 330
 
322 331
 	// There are 12 months per year - ensure that they all get listed.
323
-	for ($month = 1; $month <= 12; $month++)
324
-		echo '
332
+	for ($month = 1; $month <= 12; $month++) {
333
+			echo '
325 334
 						<option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
335
+	}
326 336
 
327 337
 	echo '
328 338
 					</select>&nbsp;
@@ -330,9 +340,10 @@  discard block
 block discarded – undo
330 340
 					<select name="dayend" id="dayend">';
331 341
 
332 342
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
333
-	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
334
-		echo '
343
+	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) {
344
+			echo '
335 345
 						<option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>';
346
+	}
336 347
 
337 348
 	echo '
338 349
 					</select>
@@ -371,8 +382,8 @@  discard block
 block discarded – undo
371 382
 		<div class="windowbg">
372 383
 			<ul>';
373 384
 
374
-		foreach ($context['pending_payments'] as $id => $payment)
375
-			echo '
385
+		foreach ($context['pending_payments'] as $id => $payment) {
386
+					echo '
376 387
 				<li>
377 388
 					', $payment['desc'], '
378 389
 					<span class="floatleft">
@@ -382,6 +393,7 @@  discard block
 block discarded – undo
382 393
 						<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a>
383 394
 					</span>
384 395
 				</li>';
396
+		}
385 397
 
386 398
 		echo '
387 399
 			</ul>
@@ -406,12 +418,12 @@  discard block
 block discarded – undo
406 418
 				<h3 class="catbg">', $txt['subscriptions'], '</h3>
407 419
 			</div>';
408 420
 
409
-	if (empty($context['subscriptions']))
410
-		echo '
421
+	if (empty($context['subscriptions'])) {
422
+			echo '
411 423
 			<div class="information">
412 424
 				', $txt['paid_subs_none'], '
413 425
 			</div>';
414
-	else
426
+	} else
415 427
 	{
416 428
 		echo '
417 429
 			<div class="information">
@@ -423,8 +435,9 @@  discard block
 block discarded – undo
423 435
 		{
424 436
 
425 437
 			// Ignore the inactive ones...
426
-			if (empty($subscription['active']))
427
-				continue;
438
+			if (empty($subscription['active'])) {
439
+							continue;
440
+			}
428 441
 
429 442
 			echo '
430 443
 			<div class="cat_bar">
@@ -434,9 +447,10 @@  discard block
 block discarded – undo
434 447
 				<p><strong>', $subscription['name'], '</strong></p>
435 448
 				<p class="smalltext">', $subscription['desc'], '</p>';
436 449
 
437
-			if (!$subscription['flexible'])
438
-				echo '
450
+			if (!$subscription['flexible']) {
451
+							echo '
439 452
 				<div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>';
453
+			}
440 454
 
441 455
 			if ($context['user']['is_owner'])
442 456
 			{
@@ -449,24 +463,25 @@  discard block
 block discarded – undo
449 463
 				<select name="cur[', $subscription['id'], ']">';
450 464
 
451 465
 					// Print out the costs for this one.
452
-					foreach ($subscription['costs'] as $duration => $value)
453
-						echo '
466
+					foreach ($subscription['costs'] as $duration => $value) {
467
+											echo '
454 468
 					<option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>';
469
+					}
455 470
 
456 471
 					echo '
457 472
 				</select>';
458
-				}
459
-				else
460
-					echo '
473
+				} else {
474
+									echo '
461 475
 				', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']);
476
+				}
462 477
 
463 478
 				echo '
464 479
 				<hr>
465 480
 				<input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">';
466
-			}
467
-			else
468
-				echo '
481
+			} else {
482
+							echo '
469 483
 				<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>';
484
+			}
470 485
 
471 486
 			echo '
472 487
 			</div><!-- .windowbg -->';
@@ -493,19 +508,20 @@  discard block
 block discarded – undo
493 508
 			</thead>
494 509
 			<tbody>';
495 510
 
496
-	if (empty($context['current']))
497
-		echo '
511
+	if (empty($context['current'])) {
512
+			echo '
498 513
 				<tr class="windowbg">
499 514
 					<td colspan="4">
500 515
 						', $txt['paid_none_yet'], '
501 516
 					</td>
502 517
 				</tr>';
518
+	}
503 519
 
504 520
 	foreach ($context['current'] as $sub)
505 521
 	{
506 522
 
507
-		if (!$sub['hide'])
508
-			echo '
523
+		if (!$sub['hide']) {
524
+					echo '
509 525
 				<tr class="windowbg">
510 526
 					<td>
511 527
 						', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
@@ -516,6 +532,7 @@  discard block
 block discarded – undo
516 532
 					<td>', $sub['start'], '</td>
517 533
 					<td>', $sub['end'], '</td>
518 534
 				</tr>';
535
+		}
519 536
 	}
520 537
 
521 538
 	echo '
@@ -567,15 +584,17 @@  discard block
 block discarded – undo
567 584
 			', $gateway['desc'], '<br>
568 585
 			<form action="', $gateway['form'], '" method="post">';
569 586
 
570
-		if (!empty($gateway['javascript']))
571
-			echo '
587
+		if (!empty($gateway['javascript'])) {
588
+					echo '
572 589
 				<script>
573 590
 					', $gateway['javascript'], '
574 591
 				</script>';
592
+		}
575 593
 
576
-		foreach ($gateway['hidden'] as $name => $value)
577
-			echo '
594
+		foreach ($gateway['hidden'] as $name => $value) {
595
+					echo '
578 596
 				<input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">';
597
+		}
579 598
 
580 599
 		echo '
581 600
 				<br>
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 1 patch
Braces   +179 added lines, -128 removed lines patch added patch discarded remove patch
@@ -65,9 +65,10 @@  discard block
 block discarded – undo
65 65
 										', implode(', ', $context['administrators']);
66 66
 
67 67
 	// If we have lots of admins... don't show them all.
68
-	if (!empty($context['more_admins_link']))
69
-		echo '
68
+	if (!empty($context['more_admins_link'])) {
69
+			echo '
70 70
 										(', $context['more_admins_link'], ')';
71
+	}
71 72
 
72 73
 	echo '
73 74
 									</div><!-- #version_details -->
@@ -84,17 +85,19 @@  discard block
 block discarded – undo
84 85
 		foreach ($area['areas'] as $item_id => $item)
85 86
 		{
86 87
 			// No point showing the 'home' page here, we're already on it!
87
-			if ($area_id == 'forum' && $item_id == 'index')
88
-				continue;
88
+			if ($area_id == 'forum' && $item_id == 'index') {
89
+							continue;
90
+			}
89 91
 
90 92
 			$url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : '');
91 93
 
92
-			if (!empty($item['icon_file']))
93
-				echo '
94
+			if (!empty($item['icon_file'])) {
95
+							echo '
94 96
 							<a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>';
95
-			else
96
-				echo '
97
+			} else {
98
+							echo '
97 99
 							<a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>';
100
+			}
98 101
 		}
99 102
 
100 103
 		echo '
@@ -105,10 +108,11 @@  discard block
 block discarded – undo
105 108
 					</div><!-- #admincenter -->';
106 109
 
107 110
 	// The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization.
108
-	if (empty($modSettings['disable_smf_js']))
109
-		echo '
111
+	if (empty($modSettings['disable_smf_js'])) {
112
+			echo '
110 113
 					<script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
111 114
 					<script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
115
+	}
112 116
 
113 117
 	// This sets the announcements and current versions themselves ;).
114 118
 	echo '
@@ -187,9 +191,10 @@  discard block
 block discarded – undo
187 191
 								<em>', $version['version'], '</em>';
188 192
 
189 193
 		// more details for this item, show them a link
190
-		if ($context['can_admin'] && isset($version['more']))
191
-			echo
194
+		if ($context['can_admin'] && isset($version['more'])) {
195
+					echo
192 196
 								' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>';
197
+		}
193 198
 		echo '
194 199
 								<br>';
195 200
 	}
@@ -220,21 +225,23 @@  discard block
 block discarded – undo
220 225
 
221 226
 	foreach ($context['credits'] as $section)
222 227
 	{
223
-		if (isset($section['pretext']))
224
-			echo '
228
+		if (isset($section['pretext'])) {
229
+					echo '
225 230
 								<p>', $section['pretext'], '</p>
226 231
 								<hr>';
232
+		}
227 233
 
228 234
 		echo '
229 235
 								<dl>';
230 236
 
231 237
 		foreach ($section['groups'] as $group)
232 238
 		{
233
-			if (isset($group['title']))
234
-				echo '
239
+			if (isset($group['title'])) {
240
+							echo '
235 241
 									<dt>
236 242
 										<strong>', $group['title'], ':</strong>
237 243
 									</dt>';
244
+			}
238 245
 
239 246
 			echo '
240 247
 									<dd>', implode(', ', $group['members']), '</dd>';
@@ -243,10 +250,11 @@  discard block
 block discarded – undo
243 250
 		echo '
244 251
 								</dl>';
245 252
 
246
-		if (isset($section['posttext']))
247
-			echo '
253
+		if (isset($section['posttext'])) {
254
+					echo '
248 255
 								<hr>
249 256
 								<p>', $section['posttext'], '</p>';
257
+		}
250 258
 	}
251 259
 
252 260
 	echo '
@@ -262,9 +270,10 @@  discard block
 block discarded – undo
262 270
 						smfSupportVersions.forum = "', $context['forum_version'], '";';
263 271
 
264 272
 	// Don't worry, none of this is logged, it's just used to give information that might be of use.
265
-	foreach ($context['current_versions'] as $variable => $version)
266
-		echo '
273
+	foreach ($context['current_versions'] as $variable => $version) {
274
+			echo '
267 275
 						smfSupportVersions.', $variable, ' = "', $version['version'], '";';
276
+	}
268 277
 
269 278
 	// Now we just have to include the script and wait ;).
270 279
 	echo '
@@ -361,8 +370,8 @@  discard block
 block discarded – undo
361 370
 								<tbody>';
362 371
 
363 372
 	// Loop through every source file displaying its version - using javascript.
364
-	foreach ($context['file_versions'] as $filename => $version)
365
-		echo '
373
+	foreach ($context['file_versions'] as $filename => $version) {
374
+			echo '
366 375
 									<tr class="windowbg">
367 376
 										<td class="half_table">
368 377
 											', $filename, '
@@ -374,6 +383,7 @@  discard block
 block discarded – undo
374 383
 											<em id="currentSources', $filename, '">??</em>
375 384
 										</td>
376 385
 									</tr>';
386
+	}
377 387
 
378 388
 	// Default template files.
379 389
 	echo '
@@ -399,8 +409,8 @@  discard block
 block discarded – undo
399 409
 							<table id="Default" class="table_grid">
400 410
 								<tbody>';
401 411
 
402
-	foreach ($context['default_template_versions'] as $filename => $version)
403
-		echo '
412
+	foreach ($context['default_template_versions'] as $filename => $version) {
413
+			echo '
404 414
 									<tr class="windowbg">
405 415
 										<td class="half_table">
406 416
 											', $filename, '
@@ -412,6 +422,7 @@  discard block
 block discarded – undo
412 422
 											<em id="currentDefault', $filename, '">??</em>
413 423
 										</td>
414 424
 									</tr>';
425
+	}
415 426
 
416 427
 	// Now the language files...
417 428
 	echo '
@@ -439,8 +450,8 @@  discard block
 block discarded – undo
439 450
 
440 451
 	foreach ($context['default_language_versions'] as $language => $files)
441 452
 	{
442
-		foreach ($files as $filename => $version)
443
-			echo '
453
+		foreach ($files as $filename => $version) {
454
+					echo '
444 455
 									<tr class="windowbg">
445 456
 										<td class="half_table">
446 457
 											', $filename, '.<em>', $language, '</em>.php
@@ -452,6 +463,7 @@  discard block
 block discarded – undo
452 463
 											<em id="current', $filename, '.', $language, '">??</em>
453 464
 										</td>
454 465
 									</tr>';
466
+		}
455 467
 	}
456 468
 
457 469
 	echo '
@@ -481,8 +493,8 @@  discard block
 block discarded – undo
481 493
 							<table id="Templates" class="table_grid">
482 494
 								<tbody>';
483 495
 
484
-		foreach ($context['template_versions'] as $filename => $version)
485
-			echo '
496
+		foreach ($context['template_versions'] as $filename => $version) {
497
+					echo '
486 498
 									<tr class="windowbg">
487 499
 										<td class="half_table">
488 500
 											', $filename, '
@@ -494,6 +506,7 @@  discard block
 block discarded – undo
494 506
 											<em id="currentTemplates', $filename, '">??</em>
495 507
 										</td>
496 508
 									</tr>';
509
+		}
497 510
 
498 511
 		echo '
499 512
 								</tbody>
@@ -523,8 +536,8 @@  discard block
 block discarded – undo
523 536
 							<table id="Tasks" class="table_grid">
524 537
 								<tbody>';
525 538
 
526
-		foreach ($context['tasks_versions'] as $filename => $version)
527
-			echo '
539
+		foreach ($context['tasks_versions'] as $filename => $version) {
540
+					echo '
528 541
 									<tr class="windowbg">
529 542
 										<td class="half_table">
530 543
 											', $filename, '
@@ -536,6 +549,7 @@  discard block
 block discarded – undo
536 549
 											<em id="currentTasks', $filename, '">??</em>
537 550
 										</td>
538 551
 									</tr>';
552
+		}
539 553
 
540 554
 		echo '
541 555
 								</tbody>
@@ -577,9 +591,10 @@  discard block
 block discarded – undo
577 591
 {
578 592
 	global $context, $scripturl, $txt, $modSettings;
579 593
 
580
-	if (!empty($context['saved_successful']))
581
-		echo '
594
+	if (!empty($context['saved_successful'])) {
595
+			echo '
582 596
 					<div class="infobox">', $txt['settings_saved'], '</div>';
597
+	}
583 598
 
584 599
 	// First section is for adding/removing words from the censored list.
585 600
 	echo '
@@ -594,11 +609,12 @@  discard block
 block discarded – undo
594 609
 								<p>', $txt['admin_censored_where'], '</p>';
595 610
 
596 611
 	// Show text boxes for censoring [bad   ] => [good  ].
597
-	foreach ($context['censored_words'] as $vulgar => $proper)
598
-		echo '
612
+	foreach ($context['censored_words'] as $vulgar => $proper) {
613
+			echo '
599 614
 								<div class="block">
600 615
 									<input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> =&gt; <input type="text" name="censor_proper[]" value="', $proper, '" size="30">
601 616
 								</div>';
617
+	}
602 618
 
603 619
 	// Now provide a way to censor more words.
604 620
 	echo '
@@ -673,19 +689,21 @@  discard block
 block discarded – undo
673 689
 						<div class="windowbg2 noup">
674 690
 							', $txt['not_done_reason'];
675 691
 
676
-	if (!empty($context['continue_percent']))
677
-		echo '
692
+	if (!empty($context['continue_percent'])) {
693
+			echo '
678 694
 							<div class="progress_bar">
679 695
 								<div class="full_bar">', $context['continue_percent'], '%</div>
680 696
 								<div class="green_percent" style="width: ', $context['continue_percent'], '%;"></div>
681 697
 							</div>';
698
+	}
682 699
 
683
-	if (!empty($context['substep_enabled']))
684
-		echo '
700
+	if (!empty($context['substep_enabled'])) {
701
+			echo '
685 702
 							<div class="progress_bar">
686 703
 								<div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div>
687 704
 								<div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"></div>
688 705
 							</div>';
706
+	}
689 707
 
690 708
 	echo '
691 709
 							<form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
@@ -720,35 +738,40 @@  discard block
 block discarded – undo
720 738
 {
721 739
 	global $context, $txt, $scripturl;
722 740
 
723
-	if (!empty($context['saved_successful']))
724
-		echo '
741
+	if (!empty($context['saved_successful'])) {
742
+			echo '
725 743
 					<div class="infobox">', $txt['settings_saved'], '</div>';
726
-	elseif (!empty($context['saved_failed']))
727
-		echo '
744
+	} elseif (!empty($context['saved_failed'])) {
745
+			echo '
728 746
 					<div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>';
747
+	}
729 748
 
730
-	if (!empty($context['settings_pre_javascript']))
731
-		echo '
749
+	if (!empty($context['settings_pre_javascript'])) {
750
+			echo '
732 751
 					<script>', $context['settings_pre_javascript'], '</script>';
752
+	}
733 753
 
734
-	if (!empty($context['settings_insert_above']))
735
-		echo $context['settings_insert_above'];
754
+	if (!empty($context['settings_insert_above'])) {
755
+			echo $context['settings_insert_above'];
756
+	}
736 757
 
737 758
 	echo '
738 759
 					<div id="admincenter">
739 760
 						<form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
740 761
 
741 762
 	// Is there a custom title?
742
-	if (isset($context['settings_title']))
743
-		echo '
763
+	if (isset($context['settings_title'])) {
764
+			echo '
744 765
 							<div class="cat_bar">
745 766
 								<h3 class="catbg">', $context['settings_title'], '</h3>
746 767
 							</div>';
768
+	}
747 769
 
748 770
 	// Have we got a message to display?
749
-	if (!empty($context['settings_message']))
750
-		echo '
771
+	if (!empty($context['settings_message'])) {
772
+			echo '
751 773
 							<div class="information">', $context['settings_message'], '</div>';
774
+	}
752 775
 
753 776
 	// Now actually loop through all the variables.
754 777
 	$is_open = false;
@@ -801,8 +824,9 @@  discard block
 block discarded – undo
801 824
 		// Hang about? Are you pulling my leg - a callback?!
802 825
 		if (is_array($config_var) && $config_var['type'] == 'callback')
803 826
 		{
804
-			if (function_exists('template_callback_' . $config_var['name']))
805
-				call_user_func('template_callback_' . $config_var['name']);
827
+			if (function_exists('template_callback_' . $config_var['name'])) {
828
+							call_user_func('template_callback_' . $config_var['name']);
829
+			}
806 830
 
807 831
 			continue;
808 832
 		}
@@ -832,9 +856,10 @@  discard block
 block discarded – undo
832 856
 				$text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time');
833 857
 
834 858
 				// Show the [?] button.
835
-				if ($config_var['help'])
836
-					echo '
859
+				if ($config_var['help']) {
860
+									echo '
837 861
 										<a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ';
862
+				}
838 863
 
839 864
 				echo '
840 865
 										<a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
@@ -843,23 +868,26 @@  discard block
 block discarded – undo
843 868
 										$config_var['preinput'];
844 869
 
845 870
 				// Show a check box.
846
-				if ($config_var['type'] == 'check')
847
-					echo '
871
+				if ($config_var['type'] == 'check') {
872
+									echo '
848 873
 										<input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">';
874
+				}
849 875
 				// Escape (via htmlspecialchars.) the text box.
850
-				elseif ($config_var['type'] == 'password')
851
-					echo '
876
+				elseif ($config_var['type'] == 'password') {
877
+									echo '
852 878
 										<input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;"><br>
853 879
 										<input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>';
880
+				}
854 881
 				// Show a selection box.
855 882
 				elseif ($config_var['type'] == 'select')
856 883
 				{
857 884
 					echo '
858 885
 										<select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>';
859 886
 
860
-					foreach ($config_var['data'] as $option)
861
-						echo '
887
+					foreach ($config_var['data'] as $option) {
888
+											echo '
862 889
 											<option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>';
890
+					}
863 891
 					echo '
864 892
 										</select>';
865 893
 				}
@@ -876,16 +904,18 @@  discard block
 block discarded – undo
876 904
 
877 905
 					foreach ($context['board_list'] as $id_cat => $cat)
878 906
 					{
879
-						if (!$first)
880
-							echo '
907
+						if (!$first) {
908
+													echo '
881 909
 											<hr>';
910
+						}
882 911
 						echo '
883 912
 											<strong>', $cat['name'], '</strong>
884 913
 											<ul>';
885 914
 
886
-						foreach ($cat['boards'] as $id_board => $brd)
887
-							echo '
915
+						foreach ($cat['boards'] as $id_board => $brd) {
916
+													echo '
888 917
 												<li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat('&nbsp; &nbsp;', $brd['child_level']) : '', $brd['name'], '</label></li>';
918
+						}
889 919
 
890 920
 						echo '
891 921
 											</ul>';
@@ -895,12 +925,14 @@  discard block
 block discarded – undo
895 925
 										</fieldset>';
896 926
 				}
897 927
 				// Text area?
898
-				elseif ($config_var['type'] == 'large_text')
899
-					echo '
928
+				elseif ($config_var['type'] == 'large_text') {
929
+									echo '
900 930
 										<textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>';
931
+				}
901 932
 				// Permission group?
902
-				elseif ($config_var['type'] == 'permissions')
903
-					theme_inline_permissions($config_var['name']);
933
+				elseif ($config_var['type'] == 'permissions') {
934
+									theme_inline_permissions($config_var['name']);
935
+				}
904 936
 
905 937
 				// BBC selection?
906 938
 				elseif ($config_var['type'] == 'bbc')
@@ -912,22 +944,24 @@  discard block
 block discarded – undo
912 944
 
913 945
 					foreach ($context['bbc_columns'] as $bbcColumn)
914 946
 					{
915
-						foreach ($bbcColumn as $bbcTag)
916
-							echo '
947
+						foreach ($bbcColumn as $bbcTag) {
948
+													echo '
917 949
 												<li class="list_bbc floatleft">
918 950
 													<input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', '> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', '
919 951
 												</li>';
952
+						}
920 953
 					}
921 954
 					echo '					</ul>
922 955
 											<input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', '> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label>
923 956
 										</fieldset>';
924 957
 				}
925 958
 				// A simple message?
926
-				elseif ($config_var['type'] == 'var_message')
927
-					echo '
959
+				elseif ($config_var['type'] == 'var_message') {
960
+									echo '
928 961
 										<div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>
929 962
 											', $config_var['var_message'], '
930 963
 										</div>';
964
+				}
931 965
 				// Assume it must be a text box
932 966
 				else
933 967
 				{
@@ -952,62 +986,70 @@  discard block
 block discarded – undo
952 986
 											' . $config_var['postinput'] : '','
953 987
 									</dd>';
954 988
 			}
955
-		}
956
-		else
989
+		} else
957 990
 		{
958 991
 			// Just show a separator.
959
-			if ($config_var == '')
960
-				echo '
992
+			if ($config_var == '') {
993
+							echo '
961 994
 								</dl>
962 995
 								<hr>
963 996
 								<dl class="settings">';
964
-			else
965
-				echo '
997
+			} else {
998
+							echo '
966 999
 									<dd>
967 1000
 										<strong>' . $config_var . '</strong>
968 1001
 									</dd>';
1002
+			}
969 1003
 		}
970 1004
 	}
971 1005
 
972
-	if ($is_open)
973
-		echo '
1006
+	if ($is_open) {
1007
+			echo '
974 1008
 								</dl>';
1009
+	}
975 1010
 
976
-	if (empty($context['settings_save_dont_show']))
977
-		echo '
1011
+	if (empty($context['settings_save_dont_show'])) {
1012
+			echo '
978 1013
 								<input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">';
1014
+	}
979 1015
 
980
-	if ($is_open)
981
-		echo '
1016
+	if ($is_open) {
1017
+			echo '
982 1018
 							</div><!-- .windowbg2 -->';
1019
+	}
983 1020
 
984 1021
 
985 1022
 	// At least one token has to be used!
986
-	if (isset($context['admin-ssc_token']))
987
-		echo '
1023
+	if (isset($context['admin-ssc_token'])) {
1024
+			echo '
988 1025
 							<input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">';
1026
+	}
989 1027
 
990
-	if (isset($context['admin-dbsc_token']))
991
-		echo '
1028
+	if (isset($context['admin-dbsc_token'])) {
1029
+			echo '
992 1030
 							<input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">';
1031
+	}
993 1032
 
994
-	if (isset($context['admin-mp_token']))
995
-		echo '
1033
+	if (isset($context['admin-mp_token'])) {
1034
+			echo '
996 1035
 							<input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">';
1036
+	}
997 1037
 
998 1038
 	echo '
999 1039
 							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1000 1040
 						</form>
1001 1041
 					</div><!-- #admincenter -->';
1002 1042
 
1003
-	if (!empty($context['settings_post_javascript']))
1004
-		echo '
1043
+	if (!empty($context['settings_post_javascript'])) {
1044
+			echo '
1005 1045
 					<script>
1006 1046
 						', $context['settings_post_javascript'], '
1007 1047
 					</script>';
1048
+	}
1008 1049
 
1009
-	if (!empty($context['settings_insert_below']))
1010
-		echo $context['settings_insert_below'];
1050
+	if (!empty($context['settings_insert_below'])) {
1051
+			echo $context['settings_insert_below'];
1052
+	}
1011 1053
 
1012 1054
 	// We may have added a board listing. If we did, we need to make it work.
1013 1055
 	addInlineJavascript('
@@ -1030,9 +1072,10 @@  discard block
 block discarded – undo
1030 1072
 {
1031 1073
 	global $context, $txt;
1032 1074
 
1033
-	if (!empty($context['saved_successful']))
1034
-		echo '
1075
+	if (!empty($context['saved_successful'])) {
1076
+			echo '
1035 1077
 					<div class="infobox">', $txt['settings_saved'], '</div>';
1078
+	}
1036 1079
 
1037 1080
 	// Standard fields.
1038 1081
 	template_show_list('standard_profile_fields');
@@ -1066,11 +1109,12 @@  discard block
 block discarded – undo
1066 1109
 	{
1067 1110
 		loadLanguage('Errors');
1068 1111
 
1069
-		if (isset($txt['custom_option_' . $_GET['msg']]))
1070
-			echo '
1112
+		if (isset($txt['custom_option_' . $_GET['msg']])) {
1113
+					echo '
1071 1114
 					<div class="errorbox">',
1072 1115
 						$txt['custom_option_' . $_GET['msg']], '
1073 1116
 					</div>';
1117
+		}
1074 1118
 	}
1075 1119
 
1076 1120
 	echo '
@@ -1137,9 +1181,10 @@  discard block
 block discarded – undo
1137 1181
 										<dd>
1138 1182
 											<select name="placement" id="placement">';
1139 1183
 
1140
-	foreach ($context['cust_profile_fields_placement'] as $order => $name)
1141
-		echo '
1184
+	foreach ($context['cust_profile_fields_placement'] as $order => $name) {
1185
+			echo '
1142 1186
 												<option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>';
1187
+	}
1143 1188
 
1144 1189
 	echo '
1145 1190
 											</select>
@@ -1163,9 +1208,10 @@  discard block
 block discarded – undo
1163 1208
 										<dd>
1164 1209
 											<select name="field_type" id="field_type" onchange="updateInputBoxes();">';
1165 1210
 
1166
-	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type)
1167
-		echo '
1211
+	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) {
1212
+			echo '
1168 1213
 												<option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>';
1214
+	}
1169 1215
 
1170 1216
 	echo '
1171 1217
 											</select>
@@ -1197,9 +1243,10 @@  discard block
 block discarded – undo
1197 1243
 										</dt>
1198 1244
 										<dd id="options_dd">';
1199 1245
 
1200
-	foreach ($context['field']['options'] as $k => $option)
1201
-		echo '
1246
+	foreach ($context['field']['options'] as $k => $option) {
1247
+			echo '
1202 1248
 											', $k == 0 ? '' : '<br>', '<input type="radio" name="default_select" value="', $k, '"', $context['field']['default_select'] == $option ? ' checked' : '', '><input type="text" name="select_option[', $k, ']" value="', $option, '">';
1249
+	}
1203 1250
 
1204 1251
 	echo '
1205 1252
 											<span id="addopt"></span>
@@ -1263,9 +1310,10 @@  discard block
 block discarded – undo
1263 1310
 								</fieldset>
1264 1311
 								<input type="submit" name="save" value="', $txt['save'], '" class="button">';
1265 1312
 
1266
-	if ($context['fid'])
1267
-		echo '
1313
+	if ($context['fid']) {
1314
+			echo '
1268 1315
 								<input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">';
1316
+	}
1269 1317
 
1270 1318
 	echo '
1271 1319
 							</div><!-- .windowbg2 -->
@@ -1312,8 +1360,7 @@  discard block
 block discarded – undo
1312 1360
 							<p class="centertext">
1313 1361
 								<strong>', $txt['admin_search_results_none'], '</strong>
1314 1362
 							</p>';
1315
-	}
1316
-	else
1363
+	} else
1317 1364
 	{
1318 1365
 		echo '
1319 1366
 							<ol class="search_results">';
@@ -1340,9 +1387,10 @@  discard block
 block discarded – undo
1340 1387
 								<li>
1341 1388
 									<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']';
1342 1389
 
1343
-				if ($result['help'])
1344
-					echo '
1390
+				if ($result['help']) {
1391
+									echo '
1345 1392
 									<p class="double_height">', $result['help'], '</p>';
1393
+				}
1346 1394
 
1347 1395
 				echo '
1348 1396
 								</li>';
@@ -1382,10 +1430,11 @@  discard block
 block discarded – undo
1382 1430
 									<strong>', $txt['setup_verification_answer'], '</strong>
1383 1431
 								</dd>';
1384 1432
 
1385
-		if (!empty($context['qa_by_lang'][$lang_id]))
1386
-			foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1433
+		if (!empty($context['qa_by_lang'][$lang_id])) {
1434
+					foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1387 1435
 			{
1388 1436
 				$question = $context['question_answers'][$q_id];
1437
+		}
1389 1438
 
1390 1439
 				echo '
1391 1440
 								<dt>
@@ -1393,9 +1442,10 @@  discard block
 block discarded – undo
1393 1442
 								</dt>
1394 1443
 								<dd>';
1395 1444
 
1396
-				foreach ($question['answers'] as $answer)
1397
-					echo '
1445
+				foreach ($question['answers'] as $answer) {
1446
+									echo '
1398 1447
 									<input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">';
1448
+				}
1399 1449
 
1400 1450
 				echo '
1401 1451
 									<div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div>
@@ -1434,11 +1484,12 @@  discard block
 block discarded – undo
1434 1484
 							', $txt['errors_found'], ':
1435 1485
 							<ul>';
1436 1486
 
1437
-			foreach ($context['repair_errors'] as $error)
1438
-				echo '
1487
+			foreach ($context['repair_errors'] as $error) {
1488
+							echo '
1439 1489
 								<li>
1440 1490
 									', $error, '
1441 1491
 								</li>';
1492
+			}
1442 1493
 
1443 1494
 			echo '
1444 1495
 							</ul>
@@ -1448,16 +1499,15 @@  discard block
 block discarded – undo
1448 1499
 							<p class="padding">
1449 1500
 								<strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong>
1450 1501
 							</p>';
1451
-		}
1452
-		else
1453
-			echo '
1502
+		} else {
1503
+					echo '
1454 1504
 							<p>', $txt['maintain_no_errors'], '</p>
1455 1505
 							<p class="padding">
1456 1506
 								<a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
1457 1507
 							</p>';
1508
+		}
1458 1509
 
1459
-	}
1460
-	else
1510
+	} else
1461 1511
 	{
1462 1512
 		if (!empty($context['redirect_to_recount']))
1463 1513
 		{
@@ -1469,8 +1519,7 @@  discard block
 block discarded – undo
1469 1519
 								<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1470 1520
 								<input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '">
1471 1521
 							</form>';
1472
-		}
1473
-		else
1522
+		} else
1474 1523
 		{
1475 1524
 			echo '
1476 1525
 							<p>', $txt['errors_fixed'], '</p>
@@ -1561,9 +1610,10 @@  discard block
 block discarded – undo
1561 1610
 								<tr class="windowbg">
1562 1611
 									<td class="equal_table">', $key, '</td>';
1563 1612
 
1564
-				foreach ($setting as $key_lm => $value)
1565
-					echo '
1613
+				foreach ($setting as $key_lm => $value) {
1614
+									echo '
1566 1615
 									<td class="equal_table">', $value, '</td>';
1616
+				}
1567 1617
 
1568 1618
 				echo '
1569 1619
 								</tr>';
@@ -1623,8 +1673,8 @@  discard block
 block discarded – undo
1623 1673
 {
1624 1674
 	global $context, $txt;
1625 1675
 
1626
-	if ($context['user']['is_admin'])
1627
-		echo '
1676
+	if ($context['user']['is_admin']) {
1677
+			echo '
1628 1678
 								<span class="floatright admin_search">
1629 1679
 									<span class="generic_icons filter centericon"></span>
1630 1680
 									<input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';">
@@ -1635,6 +1685,7 @@  discard block
 block discarded – undo
1635 1685
 									</select>
1636 1686
 									<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button">
1637 1687
 								</span>';
1638
-}
1688
+	}
1689
+	}
1639 1690
 
1640 1691
 ?>
1641 1692
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/BoardIndex.template.php 1 patch
Braces   +67 added lines, -47 removed lines patch added patch discarded remove patch
@@ -31,9 +31,10 @@  discard block
 block discarded – undo
31 31
 		echo '
32 32
 		<ul id="smf_slider" class="roundframe">';
33 33
 
34
-		foreach ($context['news_lines'] as $news)
35
-			echo '
34
+		foreach ($context['news_lines'] as $news) {
35
+					echo '
36 36
 			<li>', $news, '</li>';
37
+		}
37 38
 
38 39
 		echo '
39 40
 		</ul>
@@ -65,8 +66,9 @@  discard block
 block discarded – undo
65 66
 	foreach ($context['categories'] as $category)
66 67
 	{
67 68
 		// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
68
-		if (empty($category['boards']) && !$category['is_collapsed'])
69
-			continue;
69
+		if (empty($category['boards']) && !$category['is_collapsed']) {
70
+					continue;
71
+		}
70 72
 
71 73
 		echo '
72 74
 		<div class="main_container">
@@ -74,9 +76,10 @@  discard block
 block discarded – undo
74 76
 				<h3 class="catbg">';
75 77
 
76 78
 		// If this category even can collapse, show a link to collapse it.
77
-		if ($category['can_collapse'])
78
-			echo '
79
+		if ($category['can_collapse']) {
80
+					echo '
79 81
 					<span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>';
82
+		}
80 83
 
81 84
 		echo '
82 85
 					', $category['link'], '
@@ -106,10 +109,11 @@  discard block
 block discarded – undo
106 109
 					</div>';
107 110
 
108 111
 				// Won't somebody think of the children!
109
-				if (function_exists('template_bi_' . $board['type'] . '_children'))
110
-					call_user_func('template_bi_' . $board['type'] . '_children', $board);
111
-				else
112
-					template_bi_board_children($board);
112
+				if (function_exists('template_bi_' . $board['type'] . '_children')) {
113
+									call_user_func('template_bi_' . $board['type'] . '_children', $board);
114
+				} else {
115
+									template_bi_board_children($board);
116
+				}
113 117
 
114 118
 				echo '
115 119
 				</div><!-- #board_[id] -->';
@@ -124,12 +128,13 @@  discard block
 block discarded – undo
124 128
 	</div><!-- #boardindex_table -->';
125 129
 
126 130
 	// Show the mark all as read button?
127
-	if ($context['user']['is_logged'] && !empty($context['categories']))
128
-		echo '
131
+	if ($context['user']['is_logged'] && !empty($context['categories'])) {
132
+			echo '
129 133
 	<div class="mark_read">
130 134
 		', template_button_strip($context['mark_read_button'], 'right'), '
131 135
 	</div>';
132
-}
136
+	}
137
+	}
133 138
 
134 139
 /**
135 140
  * Outputs the board icon for a standard board.
@@ -173,18 +178,20 @@  discard block
 block discarded – undo
173 178
 						</a>';
174 179
 
175 180
 	// Has it outstanding posts for approval?
176
-	if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
177
-		echo '
181
+	if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
182
+			echo '
178 183
 						<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
184
+	}
179 185
 
180 186
 	echo '
181 187
 						<p class="board_description">', $board['description'], '</p>';
182 188
 
183 189
 	// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
184
-	if (!empty($board['link_moderators']))
185
-		echo '
190
+	if (!empty($board['link_moderators'])) {
191
+			echo '
186 192
 						<p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
187
-}
193
+	}
194
+	}
188 195
 
189 196
 /**
190 197
  * Outputs the board stats for a standard board.
@@ -225,10 +232,11 @@  discard block
 block discarded – undo
225 232
  */
226 233
 function template_bi_board_lastpost($board)
227 234
 {
228
-	if (!empty($board['last_post']['id']))
229
-		echo '
235
+	if (!empty($board['last_post']['id'])) {
236
+			echo '
230 237
 						<p>', $board['last_post']['last_post_message'], '</p>';
231
-}
238
+	}
239
+	}
232 240
 
233 241
 /**
234 242
  * Outputs the board children for a standard board.
@@ -248,14 +256,16 @@  discard block
 block discarded – undo
248 256
 			id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
249 257
 		foreach ($board['children'] as $child)
250 258
 		{
251
-			if (!$child['is_redirect'])
252
-				$child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
253
-			else
254
-				$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
259
+			if (!$child['is_redirect']) {
260
+							$child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
261
+			} else {
262
+							$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
263
+			}
255 264
 
256 265
 			// Has it posts awaiting approval?
257
-			if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
258
-				$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
266
+			if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) {
267
+							$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
268
+			}
259 269
 
260 270
 			$children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>';
261 271
 		}
@@ -282,8 +292,9 @@  discard block
 block discarded – undo
282 292
 {
283 293
 	global $context, $options, $txt;
284 294
 
285
-	if (empty($context['info_center']))
286
-		return;
295
+	if (empty($context['info_center'])) {
296
+			return;
297
+	}
287 298
 
288 299
 	// Here's where the "Info Center" starts...
289 300
 	echo '
@@ -383,14 +394,15 @@  discard block
 block discarded – undo
383 394
 		/* Each post in latest_posts has:
384 395
 			board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
385 396
 			subject, short_subject (shortened with...), time, link, and href. */
386
-		foreach ($context['latest_posts'] as $post)
387
-			echo '
397
+		foreach ($context['latest_posts'] as $post) {
398
+					echo '
388 399
 					<tr class="windowbg">
389 400
 						<td class="recentpost"><strong>', $post['link'], '</strong></td>
390 401
 						<td class="recentposter">', $post['poster']['link'], '</td>
391 402
 						<td class="recentboard">', $post['board']['link'], '</td>
392 403
 						<td class="recenttime">', $post['time'], '</td>
393 404
 					</tr>';
405
+		}
394 406
 		echo '
395 407
 				</table>';
396 408
 	}
@@ -414,11 +426,12 @@  discard block
 block discarded – undo
414 426
 			</div>';
415 427
 
416 428
 	// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P
417
-	if (!empty($context['calendar_holidays']))
418
-		echo '
429
+	if (!empty($context['calendar_holidays'])) {
430
+			echo '
419 431
 			<p class="inline holiday">
420 432
 				<span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '
421 433
 			</p>';
434
+	}
422 435
 
423 436
 	// People's birthdays. Like mine. And yours, I guess. Kidding.
424 437
 	if (!empty($context['calendar_birthdays']))
@@ -428,9 +441,10 @@  discard block
 block discarded – undo
428 441
 				<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
429 442
 
430 443
 		// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
431
-		foreach ($context['calendar_birthdays'] as $member)
432
-			echo '
444
+		foreach ($context['calendar_birthdays'] as $member) {
445
+					echo '
433 446
 				<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
447
+		}
434 448
 
435 449
 		echo '
436 450
 			</p>';
@@ -445,9 +459,10 @@  discard block
 block discarded – undo
445 459
 
446 460
 		// Each event in calendar_events should have:
447 461
 		//		title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
448
-		foreach ($context['calendar_events'] as $event)
449
-			echo '
462
+		foreach ($context['calendar_events'] as $event) {
463
+					echo '
450 464
 				', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', ';
465
+		}
451 466
 		echo '
452 467
 			</p>';
453 468
 	}
@@ -493,17 +508,21 @@  discard block
 block discarded – undo
493 508
 	// Handle hidden users and buddies.
494 509
 	$bracketList = array();
495 510
 
496
-	if ($context['show_buddies'])
497
-		$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
511
+	if ($context['show_buddies']) {
512
+			$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
513
+	}
498 514
 
499
-	if (!empty($context['num_spiders']))
500
-		$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
515
+	if (!empty($context['num_spiders'])) {
516
+			$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
517
+	}
501 518
 
502
-	if (!empty($context['num_users_hidden']))
503
-		$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
519
+	if (!empty($context['num_users_hidden'])) {
520
+			$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
521
+	}
504 522
 
505
-	if (!empty($bracketList))
506
-		echo ' (' . implode(', ', $bracketList) . ')';
523
+	if (!empty($bracketList)) {
524
+			echo ' (' . implode(', ', $bracketList) . ')';
525
+	}
507 526
 
508 527
 	echo $context['show_who'] ? '</a>' : '', '
509 528
 
@@ -517,9 +536,10 @@  discard block
 block discarded – undo
517 536
 				', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']);
518 537
 
519 538
 		// Showing membergroups?
520
-		if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
521
-			echo '
539
+		if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) {
540
+					echo '
522 541
 				<span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>';
542
+		}
523 543
 	}
524 544
 
525 545
 	echo '
Please login to merge, or discard this patch.
Themes/default/GenericList.template.php 1 patch
Braces   +65 added lines, -46 removed lines patch added patch discarded remove patch
@@ -22,27 +22,31 @@  discard block
 block discarded – undo
22 22
 	// Get a shortcut to the current list.
23 23
 	$list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id;
24 24
 
25
-	if (empty($list_id) || empty($context[$list_id]))
26
-		return;
25
+	if (empty($list_id) || empty($context[$list_id])) {
26
+			return;
27
+	}
27 28
 
28 29
 	$cur_list = &$context[$list_id];
29 30
 
30 31
 	// These are the main tabs that is used all around the template.
31
-	if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top'))
32
-		template_create_list_menu($cur_list['list_menu'], 'top');
32
+	if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) {
33
+			template_create_list_menu($cur_list['list_menu'], 'top');
34
+	}
33 35
 
34
-	if (isset($cur_list['form']))
35
-		echo '
36
+	if (isset($cur_list['form'])) {
37
+			echo '
36 38
 	<form action="', $cur_list['form']['href'], '" method="post"', empty($cur_list['form']['name']) ? '' : ' name="' . $cur_list['form']['name'] . '" id="' . $cur_list['form']['name'] . '"', ' accept-charset="', $context['character_set'], '">';
39
+	}
37 40
 
38 41
 	// Show the title of the table (if any).
39
-	if (!empty($cur_list['title']))
40
-		echo '
42
+	if (!empty($cur_list['title'])) {
43
+			echo '
41 44
 		<div class="cat_bar">
42 45
 			<h3 class="catbg">
43 46
 				', $cur_list['title'], '
44 47
 			</h3>
45 48
 		</div>';
49
+	}
46 50
 
47 51
 	if (isset($cur_list['additional_rows']['after_title']))
48 52
 	{
@@ -55,20 +59,23 @@  discard block
 block discarded – undo
55 59
 		</div>';
56 60
 	}
57 61
 
58
-	if (isset($cur_list['additional_rows']['top_of_list']))
59
-		template_additional_rows('top_of_list', $cur_list);
62
+	if (isset($cur_list['additional_rows']['top_of_list'])) {
63
+			template_additional_rows('top_of_list', $cur_list);
64
+	}
60 65
 
61 66
 	if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers']))
62 67
 	{
63 68
 		// Show the page index (if this list doesn't intend to show all items).
64
-		if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index']))
65
-			echo '
69
+		if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) {
70
+					echo '
66 71
 		<div class="floatleft">
67 72
 			<div class="pagesection">', $cur_list['page_index'], '</div>
68 73
 		</div>';
74
+		}
69 75
 
70
-		if (isset($cur_list['additional_rows']['above_column_headers']))
71
-			template_additional_rows('above_column_headers', $cur_list);
76
+		if (isset($cur_list['additional_rows']['above_column_headers'])) {
77
+					template_additional_rows('above_column_headers', $cur_list);
78
+		}
72 79
 	}
73 80
 
74 81
 	echo '
@@ -83,11 +90,12 @@  discard block
 block discarded – undo
83 90
 				<tr class="title_bar">';
84 91
 
85 92
 		// Loop through each column and add a table header.
86
-		foreach ($cur_list['headers'] as $col_header)
87
-			echo '
93
+		foreach ($cur_list['headers'] as $col_header) {
94
+					echo '
88 95
 					<th scope="col" id="header_', $list_id, '_', $col_header['id'], '"', empty($col_header['class']) ? '' : ' class="' . $col_header['class'] . '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '>
89 96
 						', empty($col_header['href']) ? '' : '<a href="' . $col_header['href'] . '" rel="nofollow">', empty($col_header['label']) ? '' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '</a>' : ' <span class="generic_icons sort_' . $col_header['sort_image'] . '"></span></a>'), '
90 97
 					</th>';
98
+		}
91 99
 
92 100
 		echo '
93 101
 				</tr>
@@ -98,13 +106,14 @@  discard block
 block discarded – undo
98 106
 			<tbody>';
99 107
 
100 108
 	// Show a nice message informing there are no items in this list.
101
-	if (empty($cur_list['rows']) && !empty($cur_list['no_items_label']))
102
-		echo '
109
+	if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) {
110
+			echo '
103 111
 				<tr class="windowbg">
104 112
 					<td colspan="', $cur_list['num_columns'], '" class="', !empty($cur_list['no_items_align']) ? $cur_list['no_items_align'] : 'centertext', '">
105 113
 						', $cur_list['no_items_label'], '
106 114
 					</td>
107 115
 				</tr>';
116
+	}
108 117
 
109 118
 	// Show the list rows.
110 119
 	elseif (!empty($cur_list['rows']))
@@ -114,12 +123,13 @@  discard block
 block discarded – undo
114 123
 			echo '
115 124
 				<tr class="windowbg', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', ' id="list_', $list_id, '_', $id, '">';
116 125
 
117
-			if (!empty($row['data']))
118
-				foreach ($row['data'] as $row_data)
126
+			if (!empty($row['data'])) {
127
+							foreach ($row['data'] as $row_data)
119 128
 					echo '
120 129
 					<td', empty($row_data['class']) ? '' : ' class="' . $row_data['class'] . '"', empty($row_data['style']) ? '' : ' style="' . $row_data['style'] . '"', '>
121 130
 						', $row_data['value'], '
122 131
 					</td>';
132
+			}
123 133
 
124 134
 			echo '
125 135
 				</tr>';
@@ -136,46 +146,53 @@  discard block
 block discarded – undo
136 146
 		<div class="flow_auto">';
137 147
 
138 148
 		// Show the page index (if this list doesn't intend to show all items).
139
-		if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index']))
140
-			echo '
149
+		if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) {
150
+					echo '
141 151
 			<div class="floatleft">
142 152
 				<div class="pagesection">', $cur_list['page_index'], '</div>
143 153
 			</div>';
154
+		}
144 155
 
145
-		if (isset($cur_list['additional_rows']['below_table_data']))
146
-			template_additional_rows('below_table_data', $cur_list);
156
+		if (isset($cur_list['additional_rows']['below_table_data'])) {
157
+					template_additional_rows('below_table_data', $cur_list);
158
+		}
147 159
 
148 160
 		echo '
149 161
 		</div>';
150 162
 	}
151 163
 
152
-	if (isset($cur_list['additional_rows']['bottom_of_list']))
153
-		template_additional_rows('bottom_of_list', $cur_list);
164
+	if (isset($cur_list['additional_rows']['bottom_of_list'])) {
165
+			template_additional_rows('bottom_of_list', $cur_list);
166
+	}
154 167
 
155 168
 	if (isset($cur_list['form']))
156 169
 	{
157
-		foreach ($cur_list['form']['hidden_fields'] as $name => $value)
158
-			echo '
170
+		foreach ($cur_list['form']['hidden_fields'] as $name => $value) {
171
+					echo '
159 172
 		<input type="hidden" name="', $name, '" value="', $value, '">';
173
+		}
160 174
 
161
-		if (isset($cur_list['form']['token']))
162
-			echo '
175
+		if (isset($cur_list['form']['token'])) {
176
+					echo '
163 177
 		<input type="hidden" name="', $context[$cur_list['form']['token'] . '_token_var'], '" value="', $context[$cur_list['form']['token'] . '_token'], '">';
178
+		}
164 179
 
165 180
 		echo '
166 181
 	</form>';
167 182
 	}
168 183
 
169 184
 	// Tabs at the bottom.  Usually bottom aligned.
170
-	if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom'))
171
-		template_create_list_menu($cur_list['list_menu'], 'bottom');
185
+	if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) {
186
+			template_create_list_menu($cur_list['list_menu'], 'bottom');
187
+	}
172 188
 
173
-	if (isset($cur_list['javascript']))
174
-		echo '
189
+	if (isset($cur_list['javascript'])) {
190
+			echo '
175 191
 	<script>
176 192
 		', $cur_list['javascript'], '
177 193
 	</script>';
178
-}
194
+	}
195
+	}
179 196
 
180 197
 /**
181 198
  * This template displays additional rows above or below the list.
@@ -185,12 +202,13 @@  discard block
 block discarded – undo
185 202
  */
186 203
 function template_additional_rows($row_position, $cur_list)
187 204
 {
188
-	foreach ($cur_list['additional_rows'][$row_position] as $row)
189
-		echo '
205
+	foreach ($cur_list['additional_rows'][$row_position] as $row) {
206
+			echo '
190 207
 			<div class="additional_row', empty($row['class']) ? '' : ' ' . $row['class'], '"', empty($row['style']) ? '' : ' style="' . $row['style'] . '"', '>
191 208
 				', $row['value'], '
192 209
 			</div>';
193
-}
210
+	}
211
+	}
194 212
 
195 213
 /**
196 214
  * This function creates a menu
@@ -249,18 +267,19 @@  discard block
 block discarded – undo
249 267
 
250 268
 		foreach ($list_menu['links'] as $link)
251 269
 		{
252
-			if ($link['is_selected'])
253
-				echo '
270
+			if ($link['is_selected']) {
271
+							echo '
254 272
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '"></td>
255 273
 							<td class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back">
256 274
 								<a href="', $link['href'], '">', $link['label'], '</a>
257 275
 							</td>
258 276
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '"></td>';
259
-			else
260
-				echo '
277
+			} else {
278
+							echo '
261 279
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back">
262 280
 								<a href="', $link['href'], '">', $link['label'], '</a>
263 281
 							</td>';
282
+			}
264 283
 		}
265 284
 
266 285
 		echo '
@@ -271,12 +290,12 @@  discard block
 block discarded – undo
271 290
 				<td></td>' : '', '
272 291
 			</tr>
273 292
 		</table>';
274
-	}
275
-	elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons')
293
+	} elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons')
276 294
 	{
277 295
 		$links = array();
278
-		foreach ($list_menu['links'] as $link)
279
-			$links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>';
296
+		foreach ($list_menu['links'] as $link) {
297
+					$links[] = '<a href="' . $link['href'] . '">' . $link['label'] . '</a>';
298
+		}
280 299
 
281 300
 		echo '
282 301
 		<table style="margin-', $list_menu['position'], ': 10px; width: 100%;">
Please login to merge, or discard this patch.