Completed
Push — release-2.1 ( 306c59...efe294 )
by
unknown
08:30
created
Themes/default/index.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
 			// In maintenance mode, only login is allowed and don't show OverlayDiv
233 233
 			echo '
234 234
 			<ul class="floatleft welcome">
235
-				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
235
+				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li>
236 236
 			</ul>';
237 237
 
238 238
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
Please login to merge, or discard this patch.
Braces   +98 added lines, -67 removed lines patch added patch discarded remove patch
@@ -72,9 +72,10 @@  discard block
 block discarded – undo
72 72
 
73 73
 	// Allow css/js files to be disabled for this specific theme.
74 74
 	// Add the identifier as an array key. IE array('smf_script'); Some external files might not add identifiers, on those cases SMF uses its filename as reference.
75
-	if (!isset($settings['disable_files']))
76
-		$settings['disable_files'] = array();
77
-}
75
+	if (!isset($settings['disable_files'])) {
76
+			$settings['disable_files'] = array();
77
+	}
78
+	}
78 79
 
79 80
 /**
80 81
  * The main sub template above the content.
@@ -112,8 +113,9 @@  discard block
 block discarded – undo
112 113
 		echo '
113 114
 	<meta';
114 115
 
115
-		foreach ($meta_tag as $meta_key => $meta_value)
116
-			echo ' ', $meta_key, '="', $meta_value, '"';
116
+		foreach ($meta_tag as $meta_key => $meta_value) {
117
+					echo ' ', $meta_key, '="', $meta_value, '"';
118
+		}
117 119
 
118 120
 		echo '>';
119 121
 	}
@@ -124,14 +126,16 @@  discard block
 block discarded – undo
124 126
 	<meta name="theme-color" content="#557EA0">';
125 127
 
126 128
 	// Please don't index these Mr Robot.
127
-	if (!empty($context['robot_no_index']))
128
-		echo '
129
+	if (!empty($context['robot_no_index'])) {
130
+			echo '
129 131
 	<meta name="robots" content="noindex">';
132
+	}
130 133
 
131 134
 	// Present a canonical url for search engines to prevent duplicate content in their indices.
132
-	if (!empty($context['canonical_url']))
133
-		echo '
135
+	if (!empty($context['canonical_url'])) {
136
+			echo '
134 137
 	<link rel="canonical" href="', $context['canonical_url'], '">';
138
+	}
135 139
 
136 140
 	// Show all the relative links, such as help, search, contents, and the like.
137 141
 	echo '
@@ -140,24 +144,28 @@  discard block
 block discarded – undo
140 144
 	<link rel="search" href="' . $scripturl . '?action=search">' : '');
141 145
 
142 146
 	// If RSS feeds are enabled, advertise the presence of one.
143
-	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
144
-		echo '
147
+	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) {
148
+			echo '
145 149
 	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?action=.xml;type=rss2', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">
146 150
 	<link rel="alternate" type="application/atom+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?action=.xml;type=atom', !empty($context['current_board']) ? ';board=' . $context['current_board'] : '', '">';
151
+	}
147 152
 
148 153
 	// If we're viewing a topic, these should be the previous and next topics, respectively.
149
-	if (!empty($context['links']['next']))
150
-		echo '
154
+	if (!empty($context['links']['next'])) {
155
+			echo '
151 156
 	<link rel="next" href="', $context['links']['next'], '">';
157
+	}
152 158
 
153
-	if (!empty($context['links']['prev']))
154
-		echo '
159
+	if (!empty($context['links']['prev'])) {
160
+			echo '
155 161
 	<link rel="prev" href="', $context['links']['prev'], '">';
162
+	}
156 163
 
157 164
 	// If we're in a board, or a topic for that matter, the index will be the board's index.
158
-	if (!empty($context['current_board']))
159
-		echo '
165
+	if (!empty($context['current_board'])) {
166
+			echo '
160 167
 	<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">';
168
+	}
161 169
 
162 170
 	// Output any remaining HTML headers. (from mods, maybe?)
163 171
 	echo $context['html_headers'];
@@ -190,20 +198,22 @@  discard block
 block discarded – undo
190 198
 				<li>
191 199
 					<a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
192 200
 
193
-		if (!empty($context['user']['avatar']))
194
-			echo $context['user']['avatar']['image'];
201
+		if (!empty($context['user']['avatar'])) {
202
+					echo $context['user']['avatar']['image'];
203
+		}
195 204
 
196 205
 		echo $context['user']['name'], '</a>
197 206
 					<div id="profile_menu" class="top_menu"></div>
198 207
 				</li>';
199 208
 
200 209
 		// Secondly, PMs if we're doing them
201
-		if ($context['allow_pm'])
202
-			echo '
210
+		if ($context['allow_pm']) {
211
+					echo '
203 212
 				<li>
204 213
 					<a href="', $scripturl, '?action=pm"', !empty($context['self_pm']) ? ' class="active"' : '', ' id="pm_menu_top">', $txt['pm_short'], !empty($context['user']['unread_messages']) ? ' <span class="amt">' . $context['user']['unread_messages'] . '</span>' : '', '</a>
205 214
 					<div id="pm_menu" class="top_menu scrollable"></div>
206 215
 				</li>';
216
+		}
207 217
 
208 218
 		// Thirdly, alerts
209 219
 		echo '
@@ -218,17 +228,18 @@  discard block
 block discarded – undo
218 228
 	}
219 229
 	// Otherwise they're a guest. Ask them to either register or login.
220 230
 	else
221
-		if (empty($maintenance))
222
-			echo '
231
+		if (empty($maintenance)) {
232
+					echo '
223 233
 			<ul class="floatleft welcome">
224 234
 				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '</li>
225 235
 			</ul>';
226
-		else
227
-			// In maintenance mode, only login is allowed and don't show OverlayDiv
236
+		} else {
237
+					// In maintenance mode, only login is allowed and don't show OverlayDiv
228 238
 			echo '
229 239
 			<ul class="floatleft welcome">
230 240
 				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
231 241
 			</ul>';
242
+		}
232 243
 
233 244
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
234 245
 	{
@@ -236,9 +247,10 @@  discard block
 block discarded – undo
236 247
 			<form id="languages_form" method="get" class="floatright">
237 248
 				<select id="language_select" name="language" onchange="this.form.submit()">';
238 249
 
239
-		foreach ($context['languages'] as $language)
240
-			echo '
250
+		foreach ($context['languages'] as $language) {
251
+					echo '
241 252
 					<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
253
+		}
242 254
 
243 255
 		echo '
244 256
 				</select>
@@ -262,32 +274,37 @@  discard block
 block discarded – undo
262 274
 					<option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>';
263 275
 
264 276
 		// Can't limit it to a specific topic if we are not in one
265
-		if (!empty($context['current_topic']))
266
-			echo '
277
+		if (!empty($context['current_topic'])) {
278
+					echo '
267 279
 					<option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>';
280
+		}
268 281
 
269 282
 		// Can't limit it to a specific board if we are not in one
270
-		if (!empty($context['current_board']))
271
-			echo '
283
+		if (!empty($context['current_board'])) {
284
+					echo '
272 285
 					<option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>';
286
+		}
273 287
 
274 288
 		// Can't search for members if we can't see the memberlist
275
-		if (!empty($context['allow_memberlist']))
276
-			echo '
289
+		if (!empty($context['allow_memberlist'])) {
290
+					echo '
277 291
 					<option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>';
292
+		}
278 293
 
279 294
 		echo '
280 295
 				</select>';
281 296
 
282 297
 		// Search within current topic?
283
-		if (!empty($context['current_topic']))
284
-			echo '
298
+		if (!empty($context['current_topic'])) {
299
+					echo '
285 300
 				<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
301
+		}
286 302
 
287 303
 		// If we're on a certain board, limit it to this board ;).
288
-		elseif (!empty($context['current_board']))
289
-			echo '
304
+		elseif (!empty($context['current_board'])) {
305
+					echo '
290 306
 				<input type="hidden" name="sd_brd" value="', $context['current_board'], '">';
307
+		}
291 308
 
292 309
 		echo '
293 310
 				<input type="submit" name="search2" value="', $txt['search'], '" class="button">
@@ -319,12 +336,13 @@  discard block
 block discarded – undo
319 336
 					</div>';
320 337
 
321 338
 	// Show a random news item? (or you could pick one from news_lines...)
322
-	if (!empty($settings['enable_news']) && !empty($context['random_news_line']))
323
-		echo '
339
+	if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
340
+			echo '
324 341
 					<div class="news">
325 342
 						<h2>', $txt['news'], ': </h2>
326 343
 						<p>', $context['random_news_line'], '</p>
327 344
 					</div>';
345
+	}
328 346
 
329 347
 	echo '
330 348
 					<hr class="clear">
@@ -385,9 +403,10 @@  discard block
 block discarded – undo
385 403
 		</ul>';
386 404
 
387 405
 	// Show the load time?
388
-	if ($context['show_load_time'])
389
-		echo '
406
+	if ($context['show_load_time']) {
407
+			echo '
390 408
 		<p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>';
409
+	}
391 410
 
392 411
 	echo '
393 412
 		</div>
@@ -418,18 +437,20 @@  discard block
 block discarded – undo
418 437
 	global $context, $shown_linktree, $scripturl, $txt;
419 438
 
420 439
 	// If linktree is empty, just return - also allow an override.
421
-	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
422
-		return;
440
+	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) {
441
+			return;
442
+	}
423 443
 		echo '
424 444
 				<div class="navigate_section">
425 445
 					<ul>';
426 446
 
427
-	if ($context['user']['is_logged'])
428
-		echo '
447
+	if ($context['user']['is_logged']) {
448
+			echo '
429 449
 						<li class="unread_links">
430 450
 							<a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a>
431 451
 							<a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a>
432 452
 						</li>';
453
+	}
433 454
 
434 455
 	// Each tree item has a URL and name. Some may have extra_before and extra_after.
435 456
 	foreach ($context['linktree'] as $link_num => $tree)
@@ -440,25 +461,29 @@  discard block
 block discarded – undo
440 461
 		// Don't show a separator for the first one.
441 462
 		// Better here. Always points to the next level when the linktree breaks to a second line.
442 463
 		// Picked a better looking HTML entity, and added support for RTL plus a span for styling.
443
-		if ($link_num != 0)
444
-			echo '
464
+		if ($link_num != 0) {
465
+					echo '
445 466
 							<span class="dividers">', $context['right_to_left'] ? ' &#9668; ' : ' &#9658; ', '</span>';
467
+		}
446 468
 
447 469
 		// Show something before the link?
448
-		if (isset($tree['extra_before']))
449
-			echo $tree['extra_before'], ' ';
470
+		if (isset($tree['extra_before'])) {
471
+					echo $tree['extra_before'], ' ';
472
+		}
450 473
 
451 474
 		// Show the link, including a URL if it should have one.
452
-		if (isset($tree['url']))
453
-			echo '
475
+		if (isset($tree['url'])) {
476
+					echo '
454 477
 							<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>';
455
-		else
456
-			echo '
478
+		} else {
479
+					echo '
457 480
 							<span>' . $tree['name'] . '</span>';
481
+		}
458 482
 
459 483
 		// Show something after the link...?
460
-		if (isset($tree['extra_after']))
461
-			echo ' ', $tree['extra_after'];
484
+		if (isset($tree['extra_after'])) {
485
+					echo ' ', $tree['extra_after'];
486
+		}
462 487
 
463 488
 		echo '
464 489
 						</li>';
@@ -509,13 +534,14 @@  discard block
 block discarded – undo
509 534
 					echo '
510 535
 									<ul>';
511 536
 
512
-					foreach ($childbutton['sub_buttons'] as $grandchildbutton)
513
-						echo '
537
+					foreach ($childbutton['sub_buttons'] as $grandchildbutton) {
538
+											echo '
514 539
 										<li>
515 540
 											<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
516 541
 												', $grandchildbutton['title'], '
517 542
 											</a>
518 543
 										</li>';
544
+					}
519 545
 
520 546
 					echo '
521 547
 									</ul>';
@@ -546,8 +572,9 @@  discard block
 block discarded – undo
546 572
 {
547 573
 	global $context, $txt;
548 574
 
549
-	if (!is_array($strip_options))
550
-		$strip_options = array();
575
+	if (!is_array($strip_options)) {
576
+			$strip_options = array();
577
+	}
551 578
 
552 579
 	// Create the buttons...
553 580
 	$buttons = array();
@@ -556,8 +583,9 @@  discard block
 block discarded – undo
556 583
 		// As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!)
557 584
 		if (!isset($value['test']) || !empty($context[$value['test']]))
558 585
 		{
559
-			if (!isset($value['id']))
560
-				$value['id'] = $key;
586
+			if (!isset($value['id'])) {
587
+							$value['id'] = $key;
588
+			}
561 589
 
562 590
 			$button = '
563 591
 				<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
@@ -570,13 +598,15 @@  discard block
 block discarded – undo
570 598
 							<div class="overview">';
571 599
 				foreach ($value['sub_buttons'] as $element)
572 600
 				{
573
-					if (isset($element['test']) && empty($context[$element['test']]))
574
-						continue;
601
+					if (isset($element['test']) && empty($context[$element['test']])) {
602
+											continue;
603
+					}
575 604
 
576 605
 					$button .= '
577 606
 								<a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>';
578
-					if (isset($txt[$element['text'] . '_desc']))
579
-						$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
607
+					if (isset($txt[$element['text'] . '_desc'])) {
608
+											$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
609
+					}
580 610
 					$button .= '</a>';
581 611
 				}
582 612
 				$button .= '
@@ -590,8 +620,9 @@  discard block
 block discarded – undo
590 620
 	}
591 621
 
592 622
 	// No buttons? No button strip either.
593
-	if (empty($buttons))
594
-		return;
623
+	if (empty($buttons)) {
624
+			return;
625
+	}
595 626
 
596 627
 	echo '
597 628
 		<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"' : ''), '>
Please login to merge, or discard this patch.
Themes/default/Admin.template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -945,7 +945,7 @@
 block discarded – undo
945 945
 				}
946 946
 
947 947
 				echo isset($config_var['postinput']) ? '
948
-											' . $config_var['postinput'] : '','
948
+											' . $config_var['postinput'] : '', '
949 949
 									</dd>';
950 950
 			}
951 951
 		}
Please login to merge, or discard this 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 '
@@ -186,9 +190,10 @@  discard block
 block discarded – undo
186 190
 								<em>', $version['version'], '</em>';
187 191
 
188 192
 		// more details for this item, show them a link
189
-		if ($context['can_admin'] && isset($version['more']))
190
-			echo
193
+		if ($context['can_admin'] && isset($version['more'])) {
194
+					echo
191 195
 								' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>';
196
+		}
192 197
 		echo '
193 198
 								<br>';
194 199
 	}
@@ -219,21 +224,23 @@  discard block
 block discarded – undo
219 224
 
220 225
 	foreach ($context['credits'] as $section)
221 226
 	{
222
-		if (isset($section['pretext']))
223
-			echo '
227
+		if (isset($section['pretext'])) {
228
+					echo '
224 229
 								<p>', $section['pretext'], '</p>
225 230
 								<hr>';
231
+		}
226 232
 
227 233
 		echo '
228 234
 								<dl>';
229 235
 
230 236
 		foreach ($section['groups'] as $group)
231 237
 		{
232
-			if (isset($group['title']))
233
-				echo '
238
+			if (isset($group['title'])) {
239
+							echo '
234 240
 									<dt>
235 241
 										<strong>', $group['title'], ':</strong>
236 242
 									</dt>';
243
+			}
237 244
 
238 245
 			echo '
239 246
 									<dd>', implode(', ', $group['members']), '</dd>';
@@ -242,10 +249,11 @@  discard block
 block discarded – undo
242 249
 		echo '
243 250
 								</dl>';
244 251
 
245
-		if (isset($section['posttext']))
246
-			echo '
252
+		if (isset($section['posttext'])) {
253
+					echo '
247 254
 								<hr>
248 255
 								<p>', $section['posttext'], '</p>';
256
+		}
249 257
 	}
250 258
 
251 259
 	echo '
@@ -261,9 +269,10 @@  discard block
 block discarded – undo
261 269
 						smfSupportVersions.forum = "', $context['forum_version'], '";';
262 270
 
263 271
 	// Don't worry, none of this is logged, it's just used to give information that might be of use.
264
-	foreach ($context['current_versions'] as $variable => $version)
265
-		echo '
272
+	foreach ($context['current_versions'] as $variable => $version) {
273
+			echo '
266 274
 						smfSupportVersions.', $variable, ' = "', $version['version'], '";';
275
+	}
267 276
 
268 277
 	// Now we just have to include the script and wait ;).
269 278
 	echo '
@@ -360,8 +369,8 @@  discard block
 block discarded – undo
360 369
 								<tbody>';
361 370
 
362 371
 	// Loop through every source file displaying its version - using javascript.
363
-	foreach ($context['file_versions'] as $filename => $version)
364
-		echo '
372
+	foreach ($context['file_versions'] as $filename => $version) {
373
+			echo '
365 374
 									<tr class="windowbg">
366 375
 										<td class="half_table">
367 376
 											', $filename, '
@@ -373,6 +382,7 @@  discard block
 block discarded – undo
373 382
 											<em id="currentSources', $filename, '">??</em>
374 383
 										</td>
375 384
 									</tr>';
385
+	}
376 386
 
377 387
 	// Default template files.
378 388
 	echo '
@@ -398,8 +408,8 @@  discard block
 block discarded – undo
398 408
 							<table id="Default" class="table_grid">
399 409
 								<tbody>';
400 410
 
401
-	foreach ($context['default_template_versions'] as $filename => $version)
402
-		echo '
411
+	foreach ($context['default_template_versions'] as $filename => $version) {
412
+			echo '
403 413
 									<tr class="windowbg">
404 414
 										<td class="half_table">
405 415
 											', $filename, '
@@ -411,6 +421,7 @@  discard block
 block discarded – undo
411 421
 											<em id="currentDefault', $filename, '">??</em>
412 422
 										</td>
413 423
 									</tr>';
424
+	}
414 425
 
415 426
 	// Now the language files...
416 427
 	echo '
@@ -438,8 +449,8 @@  discard block
 block discarded – undo
438 449
 
439 450
 	foreach ($context['default_language_versions'] as $language => $files)
440 451
 	{
441
-		foreach ($files as $filename => $version)
442
-			echo '
452
+		foreach ($files as $filename => $version) {
453
+					echo '
443 454
 									<tr class="windowbg">
444 455
 										<td class="half_table">
445 456
 											', $filename, '.<em>', $language, '</em>.php
@@ -451,6 +462,7 @@  discard block
 block discarded – undo
451 462
 											<em id="current', $filename, '.', $language, '">??</em>
452 463
 										</td>
453 464
 									</tr>';
465
+		}
454 466
 	}
455 467
 
456 468
 	echo '
@@ -480,8 +492,8 @@  discard block
 block discarded – undo
480 492
 							<table id="Templates" class="table_grid">
481 493
 								<tbody>';
482 494
 
483
-		foreach ($context['template_versions'] as $filename => $version)
484
-			echo '
495
+		foreach ($context['template_versions'] as $filename => $version) {
496
+					echo '
485 497
 									<tr class="windowbg">
486 498
 										<td class="half_table">
487 499
 											', $filename, '
@@ -493,6 +505,7 @@  discard block
 block discarded – undo
493 505
 											<em id="currentTemplates', $filename, '">??</em>
494 506
 										</td>
495 507
 									</tr>';
508
+		}
496 509
 
497 510
 		echo '
498 511
 								</tbody>
@@ -522,8 +535,8 @@  discard block
 block discarded – undo
522 535
 							<table id="Tasks" class="table_grid">
523 536
 								<tbody>';
524 537
 
525
-		foreach ($context['tasks_versions'] as $filename => $version)
526
-			echo '
538
+		foreach ($context['tasks_versions'] as $filename => $version) {
539
+					echo '
527 540
 									<tr class="windowbg">
528 541
 										<td class="half_table">
529 542
 											', $filename, '
@@ -535,6 +548,7 @@  discard block
 block discarded – undo
535 548
 											<em id="currentTasks', $filename, '">??</em>
536 549
 										</td>
537 550
 									</tr>';
551
+		}
538 552
 
539 553
 		echo '
540 554
 								</tbody>
@@ -576,9 +590,10 @@  discard block
 block discarded – undo
576 590
 {
577 591
 	global $context, $scripturl, $txt, $modSettings;
578 592
 
579
-	if (!empty($context['saved_successful']))
580
-		echo '
593
+	if (!empty($context['saved_successful'])) {
594
+			echo '
581 595
 					<div class="infobox">', $txt['settings_saved'], '</div>';
596
+	}
582 597
 
583 598
 	// First section is for adding/removing words from the censored list.
584 599
 	echo '
@@ -593,11 +608,12 @@  discard block
 block discarded – undo
593 608
 								<p>', $txt['admin_censored_where'], '</p>';
594 609
 
595 610
 	// Show text boxes for censoring [bad   ] => [good  ].
596
-	foreach ($context['censored_words'] as $vulgar => $proper)
597
-		echo '
611
+	foreach ($context['censored_words'] as $vulgar => $proper) {
612
+			echo '
598 613
 								<div class="block">
599 614
 									<input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> =&gt; <input type="text" name="censor_proper[]" value="', $proper, '" size="30">
600 615
 								</div>';
616
+	}
601 617
 
602 618
 	// Now provide a way to censor more words.
603 619
 	echo '
@@ -672,19 +688,21 @@  discard block
 block discarded – undo
672 688
 						<div class="windowbg2 noup">
673 689
 							', $txt['not_done_reason'];
674 690
 
675
-	if (!empty($context['continue_percent']))
676
-		echo '
691
+	if (!empty($context['continue_percent'])) {
692
+			echo '
677 693
 							<div class="progress_bar">
678 694
 								<div class="full_bar">', $context['continue_percent'], '%</div>
679 695
 								<div class="green_percent" style="width: ', $context['continue_percent'], '%;"></div>
680 696
 							</div>';
697
+	}
681 698
 
682
-	if (!empty($context['substep_enabled']))
683
-		echo '
699
+	if (!empty($context['substep_enabled'])) {
700
+			echo '
684 701
 							<div class="progress_bar">
685 702
 								<div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div>
686 703
 								<div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;"></div>
687 704
 							</div>';
705
+	}
688 706
 
689 707
 	echo '
690 708
 							<form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
@@ -719,35 +737,40 @@  discard block
 block discarded – undo
719 737
 {
720 738
 	global $context, $txt, $scripturl;
721 739
 
722
-	if (!empty($context['saved_successful']))
723
-		echo '
740
+	if (!empty($context['saved_successful'])) {
741
+			echo '
724 742
 					<div class="infobox">', $txt['settings_saved'], '</div>';
725
-	elseif (!empty($context['saved_failed']))
726
-		echo '
743
+	} elseif (!empty($context['saved_failed'])) {
744
+			echo '
727 745
 					<div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>';
746
+	}
728 747
 
729
-	if (!empty($context['settings_pre_javascript']))
730
-		echo '
748
+	if (!empty($context['settings_pre_javascript'])) {
749
+			echo '
731 750
 					<script>', $context['settings_pre_javascript'], '</script>';
751
+	}
732 752
 
733
-	if (!empty($context['settings_insert_above']))
734
-		echo $context['settings_insert_above'];
753
+	if (!empty($context['settings_insert_above'])) {
754
+			echo $context['settings_insert_above'];
755
+	}
735 756
 
736 757
 	echo '
737 758
 					<div id="admincenter">
738 759
 						<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'] . '"' : '', '>';
739 760
 
740 761
 	// Is there a custom title?
741
-	if (isset($context['settings_title']))
742
-		echo '
762
+	if (isset($context['settings_title'])) {
763
+			echo '
743 764
 							<div class="cat_bar">
744 765
 								<h3 class="catbg">', $context['settings_title'], '</h3>
745 766
 							</div>';
767
+	}
746 768
 
747 769
 	// Have we got a message to display?
748
-	if (!empty($context['settings_message']))
749
-		echo '
770
+	if (!empty($context['settings_message'])) {
771
+			echo '
750 772
 							<div class="information">', $context['settings_message'], '</div>';
773
+	}
751 774
 
752 775
 	// Now actually loop through all the variables.
753 776
 	$is_open = false;
@@ -800,8 +823,9 @@  discard block
 block discarded – undo
800 823
 		// Hang about? Are you pulling my leg - a callback?!
801 824
 		if (is_array($config_var) && $config_var['type'] == 'callback')
802 825
 		{
803
-			if (function_exists('template_callback_' . $config_var['name']))
804
-				call_user_func('template_callback_' . $config_var['name']);
826
+			if (function_exists('template_callback_' . $config_var['name'])) {
827
+							call_user_func('template_callback_' . $config_var['name']);
828
+			}
805 829
 
806 830
 			continue;
807 831
 		}
@@ -831,9 +855,10 @@  discard block
 block discarded – undo
831 855
 				$text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time');
832 856
 
833 857
 				// Show the [?] button.
834
-				if ($config_var['help'])
835
-					echo '
858
+				if ($config_var['help']) {
859
+									echo '
836 860
 										<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> ';
861
+				}
837 862
 
838 863
 				echo '
839 864
 										<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>
@@ -842,23 +867,26 @@  discard block
 block discarded – undo
842 867
 										$config_var['preinput'];
843 868
 
844 869
 				// Show a check box.
845
-				if ($config_var['type'] == 'check')
846
-					echo '
870
+				if ($config_var['type'] == 'check') {
871
+									echo '
847 872
 										<input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1">';
873
+				}
848 874
 				// Escape (via htmlspecialchars.) the text box.
849
-				elseif ($config_var['type'] == 'password')
850
-					echo '
875
+				elseif ($config_var['type'] == 'password') {
876
+									echo '
851 877
 										<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>
852 878
 										<input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), '>';
879
+				}
853 880
 				// Show a selection box.
854 881
 				elseif ($config_var['type'] == 'select')
855 882
 				{
856 883
 					echo '
857 884
 										<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'] . '"' : ''), '>';
858 885
 
859
-					foreach ($config_var['data'] as $option)
860
-						echo '
886
+					foreach ($config_var['data'] as $option) {
887
+											echo '
861 888
 											<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>';
889
+					}
862 890
 					echo '
863 891
 										</select>';
864 892
 				}
@@ -875,16 +903,18 @@  discard block
 block discarded – undo
875 903
 
876 904
 					foreach ($context['board_list'] as $id_cat => $cat)
877 905
 					{
878
-						if (!$first)
879
-							echo '
906
+						if (!$first) {
907
+													echo '
880 908
 											<hr>';
909
+						}
881 910
 						echo '
882 911
 											<strong>', $cat['name'], '</strong>
883 912
 											<ul>';
884 913
 
885
-						foreach ($cat['boards'] as $id_board => $brd)
886
-							echo '
914
+						foreach ($cat['boards'] as $id_board => $brd) {
915
+													echo '
887 916
 												<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>';
917
+						}
888 918
 
889 919
 						echo '
890 920
 											</ul>';
@@ -894,12 +924,14 @@  discard block
 block discarded – undo
894 924
 										</fieldset>';
895 925
 				}
896 926
 				// Text area?
897
-				elseif ($config_var['type'] == 'large_text')
898
-					echo '
927
+				elseif ($config_var['type'] == 'large_text') {
928
+									echo '
899 929
 										<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>';
930
+				}
900 931
 				// Permission group?
901
-				elseif ($config_var['type'] == 'permissions')
902
-					theme_inline_permissions($config_var['name']);
932
+				elseif ($config_var['type'] == 'permissions') {
933
+									theme_inline_permissions($config_var['name']);
934
+				}
903 935
 
904 936
 				// BBC selection?
905 937
 				elseif ($config_var['type'] == 'bbc')
@@ -911,22 +943,24 @@  discard block
 block discarded – undo
911 943
 
912 944
 					foreach ($context['bbc_columns'] as $bbcColumn)
913 945
 					{
914
-						foreach ($bbcColumn as $bbcTag)
915
-							echo '
946
+						foreach ($bbcColumn as $bbcTag) {
947
+													echo '
916 948
 												<li class="list_bbc floatleft">
917 949
 													<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>)' : '', '
918 950
 												</li>';
951
+						}
919 952
 					}
920 953
 					echo '					</ul>
921 954
 											<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>
922 955
 										</fieldset>';
923 956
 				}
924 957
 				// A simple message?
925
-				elseif ($config_var['type'] == 'var_message')
926
-					echo '
958
+				elseif ($config_var['type'] == 'var_message') {
959
+									echo '
927 960
 										<div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>
928 961
 											', $config_var['var_message'], '
929 962
 										</div>';
963
+				}
930 964
 				// Assume it must be a text box
931 965
 				else
932 966
 				{
@@ -951,62 +985,70 @@  discard block
 block discarded – undo
951 985
 											' . $config_var['postinput'] : '','
952 986
 									</dd>';
953 987
 			}
954
-		}
955
-		else
988
+		} else
956 989
 		{
957 990
 			// Just show a separator.
958
-			if ($config_var == '')
959
-				echo '
991
+			if ($config_var == '') {
992
+							echo '
960 993
 								</dl>
961 994
 								<hr>
962 995
 								<dl class="settings">';
963
-			else
964
-				echo '
996
+			} else {
997
+							echo '
965 998
 									<dd>
966 999
 										<strong>' . $config_var . '</strong>
967 1000
 									</dd>';
1001
+			}
968 1002
 		}
969 1003
 	}
970 1004
 
971
-	if ($is_open)
972
-		echo '
1005
+	if ($is_open) {
1006
+			echo '
973 1007
 								</dl>';
1008
+	}
974 1009
 
975
-	if (empty($context['settings_save_dont_show']))
976
-		echo '
1010
+	if (empty($context['settings_save_dont_show'])) {
1011
+			echo '
977 1012
 								<input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button">';
1013
+	}
978 1014
 
979
-	if ($is_open)
980
-		echo '
1015
+	if ($is_open) {
1016
+			echo '
981 1017
 							</div><!-- .windowbg2 -->';
1018
+	}
982 1019
 
983 1020
 
984 1021
 	// At least one token has to be used!
985
-	if (isset($context['admin-ssc_token']))
986
-		echo '
1022
+	if (isset($context['admin-ssc_token'])) {
1023
+			echo '
987 1024
 							<input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">';
1025
+	}
988 1026
 
989
-	if (isset($context['admin-dbsc_token']))
990
-		echo '
1027
+	if (isset($context['admin-dbsc_token'])) {
1028
+			echo '
991 1029
 							<input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">';
1030
+	}
992 1031
 
993
-	if (isset($context['admin-mp_token']))
994
-		echo '
1032
+	if (isset($context['admin-mp_token'])) {
1033
+			echo '
995 1034
 							<input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">';
1035
+	}
996 1036
 
997 1037
 	echo '
998 1038
 							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
999 1039
 						</form>
1000 1040
 					</div><!-- #admincenter -->';
1001 1041
 
1002
-	if (!empty($context['settings_post_javascript']))
1003
-		echo '
1042
+	if (!empty($context['settings_post_javascript'])) {
1043
+			echo '
1004 1044
 					<script>
1005 1045
 						', $context['settings_post_javascript'], '
1006 1046
 					</script>';
1047
+	}
1007 1048
 
1008
-	if (!empty($context['settings_insert_below']))
1009
-		echo $context['settings_insert_below'];
1049
+	if (!empty($context['settings_insert_below'])) {
1050
+			echo $context['settings_insert_below'];
1051
+	}
1010 1052
 
1011 1053
 	// We may have added a board listing. If we did, we need to make it work.
1012 1054
 	addInlineJavascript('
@@ -1029,9 +1071,10 @@  discard block
 block discarded – undo
1029 1071
 {
1030 1072
 	global $context, $txt;
1031 1073
 
1032
-	if (!empty($context['saved_successful']))
1033
-		echo '
1074
+	if (!empty($context['saved_successful'])) {
1075
+			echo '
1034 1076
 					<div class="infobox">', $txt['settings_saved'], '</div>';
1077
+	}
1035 1078
 
1036 1079
 	// Standard fields.
1037 1080
 	template_show_list('standard_profile_fields');
@@ -1065,11 +1108,12 @@  discard block
 block discarded – undo
1065 1108
 	{
1066 1109
 		loadLanguage('Errors');
1067 1110
 
1068
-		if (isset($txt['custom_option_' . $_GET['msg']]))
1069
-			echo '
1111
+		if (isset($txt['custom_option_' . $_GET['msg']])) {
1112
+					echo '
1070 1113
 					<div class="errorbox">',
1071 1114
 						$txt['custom_option_' . $_GET['msg']], '
1072 1115
 					</div>';
1116
+		}
1073 1117
 	}
1074 1118
 
1075 1119
 	echo '
@@ -1136,9 +1180,10 @@  discard block
 block discarded – undo
1136 1180
 										<dd>
1137 1181
 											<select name="placement" id="placement">';
1138 1182
 
1139
-	foreach ($context['cust_profile_fields_placement'] as $order => $name)
1140
-		echo '
1183
+	foreach ($context['cust_profile_fields_placement'] as $order => $name) {
1184
+			echo '
1141 1185
 												<option value="', $order, '"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_' . $name], '</option>';
1186
+	}
1142 1187
 
1143 1188
 	echo '
1144 1189
 											</select>
@@ -1162,9 +1207,10 @@  discard block
 block discarded – undo
1162 1207
 										<dd>
1163 1208
 											<select name="field_type" id="field_type" onchange="updateInputBoxes();">';
1164 1209
 
1165
-	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type)
1166
-		echo '
1210
+	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) {
1211
+			echo '
1167 1212
 												<option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>';
1213
+	}
1168 1214
 
1169 1215
 	echo '
1170 1216
 											</select>
@@ -1196,9 +1242,10 @@  discard block
 block discarded – undo
1196 1242
 										</dt>
1197 1243
 										<dd id="options_dd">';
1198 1244
 
1199
-	foreach ($context['field']['options'] as $k => $option)
1200
-		echo '
1245
+	foreach ($context['field']['options'] as $k => $option) {
1246
+			echo '
1201 1247
 											', $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, '">';
1248
+	}
1202 1249
 
1203 1250
 	echo '
1204 1251
 											<span id="addopt"></span>
@@ -1262,9 +1309,10 @@  discard block
 block discarded – undo
1262 1309
 								</fieldset>
1263 1310
 								<input type="submit" name="save" value="', $txt['save'], '" class="button">';
1264 1311
 
1265
-	if ($context['fid'])
1266
-		echo '
1312
+	if ($context['fid']) {
1313
+			echo '
1267 1314
 								<input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button you_sure">';
1315
+	}
1268 1316
 
1269 1317
 	echo '
1270 1318
 							</div><!-- .windowbg2 -->
@@ -1311,8 +1359,7 @@  discard block
 block discarded – undo
1311 1359
 							<p class="centertext">
1312 1360
 								<strong>', $txt['admin_search_results_none'], '</strong>
1313 1361
 							</p>';
1314
-	}
1315
-	else
1362
+	} else
1316 1363
 	{
1317 1364
 		echo '
1318 1365
 							<ol class="search_results">';
@@ -1339,9 +1386,10 @@  discard block
 block discarded – undo
1339 1386
 								<li>
1340 1387
 									<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'], ']';
1341 1388
 
1342
-				if ($result['help'])
1343
-					echo '
1389
+				if ($result['help']) {
1390
+									echo '
1344 1391
 									<p class="double_height">', $result['help'], '</p>';
1392
+				}
1345 1393
 
1346 1394
 				echo '
1347 1395
 								</li>';
@@ -1381,10 +1429,11 @@  discard block
 block discarded – undo
1381 1429
 									<strong>', $txt['setup_verification_answer'], '</strong>
1382 1430
 								</dd>';
1383 1431
 
1384
-		if (!empty($context['qa_by_lang'][$lang_id]))
1385
-			foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1432
+		if (!empty($context['qa_by_lang'][$lang_id])) {
1433
+					foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1386 1434
 			{
1387 1435
 				$question = $context['question_answers'][$q_id];
1436
+		}
1388 1437
 
1389 1438
 				echo '
1390 1439
 								<dt>
@@ -1392,9 +1441,10 @@  discard block
 block discarded – undo
1392 1441
 								</dt>
1393 1442
 								<dd>';
1394 1443
 
1395
-				foreach ($question['answers'] as $answer)
1396
-					echo '
1444
+				foreach ($question['answers'] as $answer) {
1445
+									echo '
1397 1446
 									<input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="verification_answer">';
1447
+				}
1398 1448
 
1399 1449
 				echo '
1400 1450
 									<div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div>
@@ -1433,11 +1483,12 @@  discard block
 block discarded – undo
1433 1483
 							', $txt['errors_found'], ':
1434 1484
 							<ul>';
1435 1485
 
1436
-			foreach ($context['repair_errors'] as $error)
1437
-				echo '
1486
+			foreach ($context['repair_errors'] as $error) {
1487
+							echo '
1438 1488
 								<li>
1439 1489
 									', $error, '
1440 1490
 								</li>';
1491
+			}
1441 1492
 
1442 1493
 			echo '
1443 1494
 							</ul>
@@ -1447,15 +1498,14 @@  discard block
 block discarded – undo
1447 1498
 							<p class="padding">
1448 1499
 								<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>
1449 1500
 							</p>';
1450
-		}
1451
-		else
1452
-			echo '
1501
+		} else {
1502
+					echo '
1453 1503
 							<p>', $txt['maintain_no_errors'], '</p>
1454 1504
 							<p class="padding">
1455 1505
 								<a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
1456 1506
 							</p>';
1457
-	}
1458
-	else
1507
+		}
1508
+	} else
1459 1509
 	{
1460 1510
 		if (!empty($context['redirect_to_recount']))
1461 1511
 		{
@@ -1467,8 +1517,7 @@  discard block
 block discarded – undo
1467 1517
 								<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1468 1518
 								<input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '">
1469 1519
 							</form>';
1470
-		}
1471
-		else
1520
+		} else
1472 1521
 		{
1473 1522
 			echo '
1474 1523
 							<p>', $txt['errors_fixed'], '</p>
@@ -1559,9 +1608,10 @@  discard block
 block discarded – undo
1559 1608
 								<tr class="windowbg">
1560 1609
 									<td class="equal_table">', $key, '</td>';
1561 1610
 
1562
-				foreach ($setting as $key_lm => $value)
1563
-					echo '
1611
+				foreach ($setting as $key_lm => $value) {
1612
+									echo '
1564 1613
 									<td class="equal_table">', $value, '</td>';
1614
+				}
1565 1615
 
1566 1616
 				echo '
1567 1617
 								</tr>';
@@ -1621,8 +1671,8 @@  discard block
 block discarded – undo
1621 1671
 {
1622 1672
 	global $context, $txt;
1623 1673
 
1624
-	if ($context['user']['is_admin'])
1625
-		echo '
1674
+	if ($context['user']['is_admin']) {
1675
+			echo '
1626 1676
 								<span class="floatright admin_search">
1627 1677
 									<span class="generic_icons filter centericon"></span>
1628 1678
 									<input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';">
@@ -1633,6 +1683,7 @@  discard block
 block discarded – undo
1633 1683
 									</select>
1634 1684
 									<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button">
1635 1685
 								</span>';
1636
-}
1686
+	}
1687
+	}
1637 1688
 
1638 1689
 ?>
1639 1690
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/Printpage.template.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -144,11 +144,12 @@  discard block
 block discarded – undo
144 144
 				<div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
145 145
 
146 146
 		$options = 1;
147
-		foreach ($context['poll']['options'] as $option)
148
-			echo '
147
+		foreach ($context['poll']['options'] as $option) {
148
+					echo '
149 149
 					<div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
150 150
 						', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
151 151
 					</div>';
152
+		}
152 153
 
153 154
 		echo '
154 155
 			</div>';
@@ -170,9 +171,10 @@  discard block
 block discarded – undo
170 171
 			echo '
171 172
 				<hr>';
172 173
 
173
-			foreach ($context['printattach'][$post['id_msg']] as $attach)
174
-				echo '
174
+			foreach ($context['printattach'][$post['id_msg']] as $attach) {
175
+							echo '
175 176
 					<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">';
177
+			}
176 178
 		}
177 179
 
178 180
 		echo '
@@ -207,12 +209,13 @@  discard block
 block discarded – undo
207 209
 		<div class="print_options">';
208 210
 
209 211
 	// Which option is set, text or text&images
210
-	if (isset($_REQUEST['images']))
211
-		echo '
212
+	if (isset($_REQUEST['images'])) {
213
+			echo '
212 214
 			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
213
-	else
214
-		echo '
215
+	} else {
216
+			echo '
215 217
 			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
218
+	}
216 219
 
217 220
 	echo '
218 221
 		</div><!-- .print_options -->';
Please login to merge, or discard this patch.
Themes/default/Likes.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 		<div class="windowbg">
32 32
 			<ul id="likes">';
33 33
 
34
-	foreach ($context['likers'] as $liker => $like_details)
35
-		echo '
34
+	foreach ($context['likers'] as $liker => $like_details) {
35
+			echo '
36 36
 				<li>
37 37
 					', $like_details['profile']['avatar']['image'], '
38 38
 					<span>
@@ -41,6 +41,7 @@  discard block
 block discarded – undo
41 41
 					</span>
42 42
 					<span class="floatright">', $like_details['time'], '</span>
43 43
 				</li>';
44
+	}
44 45
 
45 46
 	echo '
46 47
 			</ul>
@@ -61,11 +62,12 @@  discard block
 block discarded – undo
61 62
 	echo '
62 63
 	<ul class="floatleft">';
63 64
 
64
-	if (!empty($context['data']['can_like']))
65
-		echo '
65
+	if (!empty($context['data']['can_like'])) {
66
+			echo '
66 67
 		<li class="like_button" id="', $context['data']['type'], '_', $context['data']['id_content'], '_likes"', '>
67 68
 			<a href="', $scripturl, '?action=likes;ltype=', $context['data']['type'], ';sa=like;like=', $context['data']['id_content'], ';', $context['session_var'], '=', $context['session_id'], '" class="', $context['data']['type'], '_like"><span class="generic_icons ', $context['data']['already_liked'] ? 'unlike' : 'like', '"></span> ', $context['data']['already_liked'] ? $txt['unlike'] : $txt['like'], '</a>
68 69
 		</li>';
70
+	}
69 71
 
70 72
 	if (!empty($context['data']['count']))
71 73
 	{
Please login to merge, or discard this patch.
Themes/default/ManageBans.template.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 				</h3>
27 27
 			</div>';
28 28
 
29
-	if ($context['ban']['is_new'])
30
-		echo '
29
+	if ($context['ban']['is_new']) {
30
+			echo '
31 31
 			<div class="information noup">', $txt['ban_add_notes'], '</div>';
32
+	}
32 33
 
33 34
 	// If there were errors creating the ban, show them.
34 35
 	if (!empty($context['error_messages']))
@@ -38,9 +39,10 @@  discard block
 block discarded – undo
38 39
 				<strong>', $txt['ban_errors_detected'], '</strong>
39 40
 				<ul>';
40 41
 
41
-		foreach ($context['error_messages'] as $error)
42
-			echo '
42
+		foreach ($context['error_messages'] as $error) {
43
+					echo '
43 44
 					<li class="error">', $error, '</li>';
45
+		}
44 46
 
45 47
 		echo '
46 48
 				</ul>
@@ -57,8 +59,8 @@  discard block
 block discarded – undo
57 59
 						<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60">
58 60
 					</dd>';
59 61
 
60
-	if (isset($context['ban']['reason']))
61
-		echo '
62
+	if (isset($context['ban']['reason'])) {
63
+			echo '
62 64
 					<dt>
63 65
 						<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br>
64 66
 						<span class="smalltext">', $txt['ban_reason_desc'], '</span>
@@ -66,9 +68,10 @@  discard block
 block discarded – undo
66 68
 					<dd>
67 69
 						<textarea name="reason" id="reason" cols="40" rows="3">', $context['ban']['reason'], '</textarea>
68 70
 					</dd>';
71
+	}
69 72
 
70
-	if (isset($context['ban']['notes']))
71
-		echo '
73
+	if (isset($context['ban']['notes'])) {
74
+			echo '
72 75
 					<dt>
73 76
 						<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br>
74 77
 						<span class="smalltext">', $txt['ban_notes_desc'], '</span>
@@ -76,6 +79,7 @@  discard block
 block discarded – undo
76 79
 					<dd>
77 80
 						<textarea name="notes" id="ban_notes" cols="40" rows="3">', $context['ban']['notes'], '</textarea>
78 81
 					</dd>';
82
+	}
79 83
 
80 84
 	echo '
81 85
 				</dl>
@@ -115,8 +119,8 @@  discard block
 block discarded – undo
115 119
 							<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
116 120
 						</dd>';
117 121
 
118
-		if (empty($modSettings['disableHostnameLookup']))
119
-			echo '
122
+		if (empty($modSettings['disableHostnameLookup'])) {
123
+					echo '
120 124
 						<dt>
121 125
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '>
122 126
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -124,6 +128,7 @@  discard block
 block discarded – undo
124 128
 						<dd>
125 129
 							<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
126 130
 						</dd>';
131
+		}
127 132
 
128 133
 		echo '
129 134
 						<dt>
@@ -153,14 +158,15 @@  discard block
 block discarded – undo
153 158
 					<dl class="settings">';
154 159
 
155 160
 					$count = 0;
156
-					foreach ($ban_ips as $ip)
157
-						echo '
161
+					foreach ($ban_ips as $ip) {
162
+											echo '
158 163
 						<dt>
159 164
 							<input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '">
160 165
 						</dt>
161 166
 						<dd>
162 167
 							<label for="suggestions_', $key, '_', $count++, '">', $ip, '</label>
163 168
 						</dd>';
169
+					}
164 170
 
165 171
 					echo '
166 172
 					</dl>';
@@ -202,8 +208,8 @@  discard block
 block discarded – undo
202 208
 		addLoadEvent(fUpdateStatus);';
203 209
 
204 210
 	// Auto suggest only needed for adding new bans, not editing
205
-	if ($context['ban']['is_new'] && empty($_REQUEST['u']))
206
-		echo '
211
+	if ($context['ban']['is_new'] && empty($_REQUEST['u'])) {
212
+			echo '
207 213
 		var oAddMemberSuggest = new smc_AutoSuggest({
208 214
 			sSelf: \'oAddMemberSuggest\',
209 215
 			sSessionId: smf_session_id,
@@ -221,6 +227,7 @@  discard block
 block discarded – undo
221 227
 			return true;
222 228
 		}
223 229
 		oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');';
230
+	}
224 231
 
225 232
 	echo '
226 233
 		function confirmBan(aForm)
@@ -269,8 +276,8 @@  discard block
 block discarded – undo
269 276
 							<input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;">
270 277
 						</dd>';
271 278
 
272
-	if (empty($modSettings['disableHostnameLookup']))
273
-		echo '
279
+	if (empty($modSettings['disableHostnameLookup'])) {
280
+			echo '
274 281
 						<dt>
275 282
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '>
276 283
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -278,6 +285,7 @@  discard block
 block discarded – undo
278 285
 						<dd>
279 286
 							<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;">
280 287
 						</dd>';
288
+	}
281 289
 
282 290
 	echo '
283 291
 						<dt>
Please login to merge, or discard this patch.
Themes/default/ManageScheduledTasks.template.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,13 +20,12 @@  discard block
 block discarded – undo
20 20
 	// We completed some tasks?
21 21
 	if (!empty($context['tasks_were_run']))
22 22
 	{
23
-		if (empty($context['scheduled_errors']))
24
-			echo '
23
+		if (empty($context['scheduled_errors'])) {
24
+					echo '
25 25
 	<div class="infobox">
26 26
 		', $txt['scheduled_tasks_were_run'], '
27 27
 	</div>';
28
-
29
-		else
28
+		} else
30 29
 		{
31 30
 			echo '
32 31
 	<div class="errorbox" id="errors">
@@ -35,14 +34,15 @@  discard block
 block discarded – undo
35 34
 				<strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong>
36 35
 			</dt>';
37 36
 
38
-			foreach ($context['scheduled_errors'] as $task => $errors)
39
-				echo '
37
+			foreach ($context['scheduled_errors'] as $task => $errors) {
38
+							echo '
40 39
 			<dd class="error">
41 40
 				<strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong>
42 41
 				<ul>
43 42
 					<li>', implode('</li><li>', $errors), '</li>
44 43
 				</ul>
45 44
 			</dd>';
45
+			}
46 46
 
47 47
 			echo '
48 48
 		</dl>
Please login to merge, or discard this patch.
Themes/default/Post.template.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
 									</div><!-- .attached_BBC -->
418 418
 									<div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
419 419
 									<div class="attach-ui">
420
-										<a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a>
421
-										<a class="button upload">', $txt['upload'] ,'</a>
420
+										<a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a>
421
+										<a class="button upload">', $txt['upload'], '</a>
422 422
 									</div>
423 423
 								</div><!-- .attach-info -->
424 424
 							</div><!-- #au-template -->
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
 							</dt>
434 434
 							<dd class="smalltext fallback">
435 435
 								<div id="attachUpload" class="descbox">
436
-									<h5>', $txt['attach_drop_zone'] ,'</h5>
437
-									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a>
438
-									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a>
439
-									<a class="button fileinput-button">', $txt['attach_add'] ,'</a>
436
+									<h5>', $txt['attach_drop_zone'], '</h5>
437
+									<a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a>
438
+									<a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a>
439
+									<a class="button fileinput-button">', $txt['attach_add'], '</a>
440 440
 									<div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
441 441
 									<div class="fallback">
442 442
 										<input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	// Option to delete an event if user is editing one.
542 542
 	if ($context['make_event'] && !$context['event']['new'])
543 543
 		echo '
544
-						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
544
+						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">';
545 545
 
546 546
 	echo '
547 547
 					</span>
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 			});';
796 796
 
797 797
 	echo '
798
-			var oEditorID = "', $context['post_box_name'] ,'";
798
+			var oEditorID = "', $context['post_box_name'], '";
799 799
 			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
800 800
 		</script>';
801 801
 
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 			if ($context['can_quote'])
828 828
 				echo '
829 829
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
830
-						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
830
+						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li>
831 831
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
832 832
 					</ul>';
833 833
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 	<head>
912 912
 		<meta charset="', $context['character_set'], '">
913 913
 		<title>', $txt['spell_check'], '</title>
914
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
914
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
915 915
 		<style>
916 916
 			body, td {
917 917
 				font-size: small;
@@ -941,8 +941,8 @@  discard block
 block discarded – undo
941 941
 			var spell_formname = window.opener.spell_formname;
942 942
 			var spell_fieldname = window.opener.spell_fieldname;
943 943
 		</script>
944
-		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script>
945
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
944
+		<script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script>
945
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
946 946
 		<script>
947 947
 			', $context['spell_js'], '
948 948
 		</script>
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
 	<head>
987 987
 		<meta charset="', $context['character_set'], '">
988 988
 		<title>', $txt['retrieving_quote'], '</title>
989
-		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script>
989
+		<script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script>
990 990
 	</head>
991 991
 	<body>
992 992
 		', $txt['retrieving_quote'], '
Please login to merge, or discard this patch.
Braces   +105 added lines, -71 removed lines patch added patch discarded remove patch
@@ -22,24 +22,26 @@  discard block
 block discarded – undo
22 22
 		<script>';
23 23
 
24 24
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
25
-	if (isBrowser('is_firefox'))
26
-		echo '
25
+	if (isBrowser('is_firefox')) {
26
+			echo '
27 27
 			window.addEventListener("pageshow", reActivate, false);';
28
+	}
28 29
 
29 30
 	// Start with message icons - and any missing from this theme.
30 31
 	echo '
31 32
 			var icon_urls = {';
32 33
 
33
-	foreach ($context['icons'] as $icon)
34
-		echo '
34
+	foreach ($context['icons'] as $icon) {
35
+			echo '
35 36
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
37
+	}
36 38
 
37 39
 	echo '
38 40
 			};';
39 41
 
40 42
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
41
-	if ($context['make_poll'])
42
-		echo '
43
+	if ($context['make_poll']) {
44
+			echo '
43 45
 			var pollOptionNum = 0, pollTabIndex;
44 46
 			var pollOptionId = ', $context['last_choice_id'], ';
45 47
 			function addPollOption()
@@ -58,11 +60,13 @@  discard block
 block discarded – undo
58 60
 
59 61
 				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), ');
60 62
 			}';
63
+	}
61 64
 
62 65
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
63
-	if ($context['make_event'])
64
-		echo '
66
+	if ($context['make_event']) {
67
+			echo '
65 68
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
69
+	}
66 70
 
67 71
 	// End of the javascript, start the form and display the link tree.
68 72
 	echo '
@@ -83,9 +87,10 @@  discard block
 block discarded – undo
83 87
 			</div>
84 88
 			<br>';
85 89
 
86
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
87
-		echo '
90
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
91
+			echo '
88 92
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
93
+	}
89 94
 
90 95
 	// Start the main table.
91 96
 	echo '
@@ -110,26 +115,29 @@  discard block
 block discarded – undo
110 115
 					</div>';
111 116
 
112 117
 	// If this won't be approved let them know!
113
-	if (!$context['becomes_approved'])
114
-		echo '
118
+	if (!$context['becomes_approved']) {
119
+			echo '
115 120
 					<div class="noticebox">
116 121
 						<em>', $txt['wait_for_approval'], '</em>
117 122
 						<input type="hidden" name="not_approved" value="1">
118 123
 					</div>';
124
+	}
119 125
 
120 126
 	// If it's locked, show a message to warn the replier.
121
-	if (!empty($context['locked']))
122
-	echo '
127
+	if (!empty($context['locked'])) {
128
+		echo '
123 129
 					<div class="errorbox">
124 130
 						', $txt['topic_locked_no_reply'], '
125 131
 					</div>';
132
+	}
126 133
 
127
-	if (!empty($modSettings['drafts_post_enabled']))
128
-		echo '
134
+	if (!empty($modSettings['drafts_post_enabled'])) {
135
+			echo '
129 136
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
130 137
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
131 138
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
132 139
 					</div>';
140
+	}
133 141
 
134 142
 	// The post header... important stuff
135 143
 	echo '
@@ -139,14 +147,15 @@  discard block
 block discarded – undo
139 147
 	// Mod & theme authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php)
140 148
 	if (!empty($context['posting_fields']) && is_array($context['posting_fields']))
141 149
 	{
142
-		foreach ($context['posting_fields'] as $pfid => $pf)
143
-			echo '
150
+		foreach ($context['posting_fields'] as $pfid => $pf) {
151
+					echo '
144 152
 						<dt class="clear', !is_numeric($pfid) ? ' pf_' . $pfid : '', '">
145 153
 							', $pf['dt'], '
146 154
 						</dt>
147 155
 						<dd', !is_numeric($pfid) ? ' class="pf_' . $pfid . '"' : '', '>
148 156
 							', preg_replace('~<(input|select|textarea|button|area|a|object)\b~', '<$1 tabindex="' . $context['tabindex']++ . '"', $pf['dd']), '
149 157
 						</dd>';
158
+		}
150 159
 	}
151 160
 
152 161
 	echo '
@@ -180,9 +189,10 @@  discard block
 block discarded – undo
180 189
 				echo '
181 190
 										<optgroup label="', $category['name'], '">';
182 191
 
183
-				foreach ($category['boards'] as $board)
184
-					echo '
192
+				foreach ($category['boards'] as $board) {
193
+									echo '
185 194
 											<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
195
+				}
186 196
 				echo '
187 197
 										</optgroup>';
188 198
 			}
@@ -218,9 +228,10 @@  discard block
 block discarded – undo
218 228
 									<span class="label">', $txt['calendar_timezone'], '</span>
219 229
 									<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
220 230
 
221
-		foreach ($context['all_timezones'] as $tz => $tzname)
222
-			echo '
231
+		foreach ($context['all_timezones'] as $tz => $tzname) {
232
+					echo '
223 233
 										<option', is_numeric($tz) ? ' value="" disabled' : ' value="' . $tz . '"', $tz === $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
234
+		}
224 235
 
225 236
 		echo '
226 237
 									</select>
@@ -249,14 +260,15 @@  discard block
 block discarded – undo
249 260
 								</dd>';
250 261
 
251 262
 		// Loop through all the choices and print them out.
252
-		foreach ($context['choices'] as $choice)
253
-			echo '
263
+		foreach ($context['choices'] as $choice) {
264
+					echo '
254 265
 								<dt>
255 266
 									<label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>:
256 267
 								</dt>
257 268
 								<dd>
258 269
 									<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255">
259 270
 								</dd>';
271
+		}
260 272
 
261 273
 		echo '
262 274
 								<p id="pollMoreOptions"></p>
@@ -286,14 +298,15 @@  discard block
 block discarded – undo
286 298
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
287 299
 								</dd>';
288 300
 
289
-		if ($context['poll_options']['guest_vote_enabled'])
290
-			echo '
301
+		if ($context['poll_options']['guest_vote_enabled']) {
302
+					echo '
291 303
 								<dt>
292 304
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
293 305
 								</dt>
294 306
 								<dd>
295 307
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '>
296 308
 								</dd>';
309
+		}
297 310
 
298 311
 		echo '
299 312
 								<dt>
@@ -314,8 +327,8 @@  discard block
 block discarded – undo
314 327
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
315 328
 
316 329
 	// If we're editing and displaying edit details, show a box where they can say why
317
-	if (isset($context['editing']) && $modSettings['show_modify'])
318
-		echo '
330
+	if (isset($context['editing']) && $modSettings['show_modify']) {
331
+			echo '
319 332
 					<dl>
320 333
 						<dt class="clear">
321 334
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -324,20 +337,23 @@  discard block
 block discarded – undo
324 337
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80">
325 338
 						</dd>
326 339
 					</dl>';
340
+	}
327 341
 
328 342
 	// If this message has been edited in the past - display when it was.
329
-	if (isset($context['last_modified']))
330
-		echo '
343
+	if (isset($context['last_modified'])) {
344
+			echo '
331 345
 					<div class="padding smalltext">
332 346
 						', $context['last_modified_text'], '
333 347
 					</div>';
348
+	}
334 349
 
335 350
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
336
-	if (!empty($modSettings['additional_options_collapsable']))
337
-		echo '
351
+	if (!empty($modSettings['additional_options_collapsable'])) {
352
+			echo '
338 353
 					<div id="postAdditionalOptionsHeader">
339 354
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
340 355
 					</div>';
356
+	}
341 357
 
342 358
 	echo '
343 359
 					<div id="postAdditionalOptions">';
@@ -370,19 +386,21 @@  discard block
 block discarded – undo
370 386
 								', $txt['uncheck_unwatchd_attach'], ':
371 387
 							</dd>';
372 388
 
373
-		foreach ($context['current_attachments'] as $attachment)
374
-			echo '
389
+		foreach ($context['current_attachments'] as $attachment) {
390
+					echo '
375 391
 							<dd class="smalltext">
376 392
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
377 393
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label>
378 394
 							</dd>';
395
+		}
379 396
 
380 397
 		echo '
381 398
 						</dl>';
382 399
 
383
-		if (!empty($context['files_in_session_warning']))
384
-			echo '
400
+		if (!empty($context['files_in_session_warning'])) {
401
+					echo '
385 402
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
403
+		}
386 404
 	}
387 405
 
388 406
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -443,8 +461,8 @@  discard block
 block discarded – undo
443 461
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">');
444 462
 
445 463
 		// Show more boxes if they aren't approaching that limit.
446
-		if ($context['num_allowed_attachments'] > 1)
447
-			echo '
464
+		if ($context['num_allowed_attachments'] > 1) {
465
+					echo '
448 466
 										<script>
449 467
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
450 468
 											var current_attachment = 1;
@@ -464,6 +482,7 @@  discard block
 block discarded – undo
464 482
 										<a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a>
465 483
 									</div><!-- .fallback -->
466 484
 								</div><!-- #attachUpload -->';
485
+		}
467 486
 
468 487
 		echo '
469 488
 							</dd>';
@@ -475,21 +494,25 @@  discard block
 block discarded – undo
475 494
 							<dd class="smalltext">';
476 495
 
477 496
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
478
-		if (!empty($modSettings['attachmentCheckExtensions']))
479
-			echo '
497
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
498
+					echo '
480 499
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
500
+		}
481 501
 
482
-		if (!empty($context['attachment_restrictions']))
483
-			echo '
502
+		if (!empty($context['attachment_restrictions'])) {
503
+					echo '
484 504
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
505
+		}
485 506
 
486
-		if ($context['num_allowed_attachments'] == 0)
487
-			echo '
507
+		if ($context['num_allowed_attachments'] == 0) {
508
+					echo '
488 509
 								', $txt['attach_limit_nag'], '<br>';
510
+		}
489 511
 
490
-		if (!$context['can_post_attachment_unapproved'])
491
-			echo '
512
+		if (!$context['can_post_attachment_unapproved']) {
513
+					echo '
492 514
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
515
+		}
493 516
 
494 517
 		echo '
495 518
 							</dd>
@@ -513,24 +536,26 @@  discard block
 block discarded – undo
513 536
 							<dt><strong>', $txt['subject'], '</strong></dt>
514 537
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
515 538
 
516
-		foreach ($context['drafts'] as $draft)
517
-			echo '
539
+		foreach ($context['drafts'] as $draft) {
540
+					echo '
518 541
 							<dt>', $draft['link'], '</dt>
519 542
 							<dd>', $draft['poster_time'], '</dd>';
543
+		}
520 544
 		echo '
521 545
 						</dl>
522 546
 					</div>';
523 547
 	}
524 548
 
525 549
 	// Is visual verification enabled?
526
-	if ($context['require_verification'])
527
-		echo '
550
+	if ($context['require_verification']) {
551
+			echo '
528 552
 					<div class="post_verification">
529 553
 						<span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '>
530 554
 							<strong>', $txt['verification'], ':</strong>
531 555
 						</span>
532 556
 						', template_control_verification($context['visual_verification_id'], 'all'), '
533 557
 					</div>';
558
+	}
534 559
 
535 560
 	// Finally, the submit buttons.
536 561
 	echo '
@@ -539,9 +564,10 @@  discard block
 block discarded – undo
539 564
 						', template_control_richedit_buttons($context['post_box_name']);
540 565
 
541 566
 	// Option to delete an event if user is editing one.
542
-	if ($context['make_event'] && !$context['event']['new'])
543
-		echo '
567
+	if ($context['make_event'] && !$context['event']['new']) {
568
+			echo '
544 569
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">';
570
+	}
545 571
 
546 572
 	echo '
547 573
 					</span>
@@ -550,9 +576,10 @@  discard block
 block discarded – undo
550 576
 			<br class="clear">';
551 577
 
552 578
 	// Assuming this isn't a new topic pass across the last message id.
553
-	if (isset($context['topic_last_message']))
554
-		echo '
579
+	if (isset($context['topic_last_message'])) {
580
+			echo '
555 581
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
582
+	}
556 583
 
557 584
 	echo '
558 585
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -695,9 +722,10 @@  discard block
 block discarded – undo
695 722
 
696 723
 						newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \'&nbsp;&#187;</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';';
697 724
 
698
-	if ($context['can_quote'])
699
-		echo '
725
+	if ($context['can_quote']) {
726
+			echo '
700 727
 						newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';';
728
+	}
701 729
 
702 730
 	echo '
703 731
 						newPostsHTML += \'<br class="clear">\';
@@ -740,8 +768,8 @@  discard block
 block discarded – undo
740 768
 			}';
741 769
 
742 770
 	// Code for showing and hiding additional options.
743
-	if (!empty($modSettings['additional_options_collapsable']))
744
-		echo '
771
+	if (!empty($modSettings['additional_options_collapsable'])) {
772
+			echo '
745 773
 			var oSwapAdditionalOptions = new smc_Toggle({
746 774
 				bToggleEnabled: true,
747 775
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -769,10 +797,11 @@  discard block
 block discarded – undo
769 797
 					}
770 798
 				]
771 799
 			});';
800
+	}
772 801
 
773 802
 	// Code for showing and hiding drafts
774
-	if (!empty($context['drafts']))
775
-		echo '
803
+	if (!empty($context['drafts'])) {
804
+			echo '
776 805
 			var oSwapDraftOptions = new smc_Toggle({
777 806
 				bToggleEnabled: true,
778 807
 				bCurrentlyCollapsed: true,
@@ -794,6 +823,7 @@  discard block
 block discarded – undo
794 823
 					}
795 824
 				]
796 825
 			});';
826
+	}
797 827
 
798 828
 	echo '
799 829
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -814,8 +844,9 @@  discard block
 block discarded – undo
814 844
 		foreach ($context['previous_posts'] as $post)
815 845
 		{
816 846
 			$ignoring = false;
817
-			if (!empty($post['is_ignored']))
818
-				$ignored_posts[] = $ignoring = $post['id'];
847
+			if (!empty($post['is_ignored'])) {
848
+							$ignored_posts[] = $ignoring = $post['id'];
849
+			}
819 850
 
820 851
 			echo '
821 852
 			<div class="windowbg">
@@ -825,22 +856,24 @@  discard block
 block discarded – undo
825 856
 					</h5>
826 857
 					&nbsp;-&nbsp;', $post['time'];
827 858
 
828
-			if ($context['can_quote'])
829
-				echo '
859
+			if ($context['can_quote']) {
860
+							echo '
830 861
 					<ul class="quickbuttons" id="msg_', $post['id'], '_quote">
831 862
 						<li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>
832 863
 						<li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li>
833 864
 					</ul>';
865
+			}
834 866
 
835 867
 			echo '
836 868
 					<br class="clear">';
837 869
 
838
-			if ($ignoring)
839
-				echo '
870
+			if ($ignoring) {
871
+							echo '
840 872
 					<div id="msg_', $post['id'], '_ignored_prompt" class="smalltext">
841 873
 						', $txt['ignoring_user'], '
842 874
 						<a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
843 875
 					</div>';
876
+			}
844 877
 
845 878
 			echo '
846 879
 					<div class="list_posts smalltext" id="msg_', $post['id'], '_body" data-msgid="', $post['id'], '">', $post['message'], '</div>
@@ -995,10 +1028,10 @@  discard block
 block discarded – undo
995 1028
 		<div id="temporary_posting_area" style="display: none;"></div>
996 1029
 		<script>';
997 1030
 
998
-	if ($context['close_window'])
999
-		echo '
1031
+	if ($context['close_window']) {
1032
+			echo '
1000 1033
 			window.close();';
1001
-	else
1034
+	} else
1002 1035
 	{
1003 1036
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;)
1004 1037
 		echo '
@@ -1052,11 +1085,12 @@  discard block
 block discarded – undo
1052 1085
 				</p>
1053 1086
 				<ul>';
1054 1087
 
1055
-	foreach ($context['groups'] as $group)
1056
-		echo '
1088
+	foreach ($context['groups'] as $group) {
1089
+			echo '
1057 1090
 					<li>
1058 1091
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1059 1092
 					</li>';
1093
+	}
1060 1094
 
1061 1095
 	echo '
1062 1096
 					<li>
Please login to merge, or discard this patch.
Themes/default/ManageSmileys.template.php 1 patch
Braces   +58 added lines, -44 removed lines patch added patch discarded remove patch
@@ -41,11 +41,12 @@  discard block
 block discarded – undo
41 41
 			</div>';
42 42
 
43 43
 	// If this is an existing set, and there are still un-added smileys - offer an import opportunity.
44
-	if (!empty($context['current_set']['can_import']))
45
-		echo '
44
+	if (!empty($context['current_set']['can_import'])) {
45
+			echo '
46 46
 			<div class="information">
47 47
 				', $context['current_set']['can_import'] == 1 ? sprintf($txt['smiley_set_import_single'], $context['current_set']['import_url']) : sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import'], $context['current_set']['import_url']), '
48 48
 			</div>';
49
+	}
49 50
 
50 51
 	echo '
51 52
 			<div class="windowbg2 noup">
@@ -62,20 +63,20 @@  discard block
 block discarded – undo
62 63
 					<dd>
63 64
 						', $modSettings['smileys_url'], '/';
64 65
 
65
-	if ($context['current_set']['id'] == 'default')
66
-		echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
67
-
68
-	elseif (empty($context['smiley_set_dirs']))
69
-		echo '
66
+	if ($context['current_set']['id'] == 'default') {
67
+			echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
68
+	} elseif (empty($context['smiley_set_dirs'])) {
69
+			echo '
70 70
 						<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> ';
71
-	else
71
+	} else
72 72
 	{
73 73
 		echo '
74 74
 						<select name="smiley_sets_path" id="smiley_sets_path">';
75 75
 
76
-		foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
77
-			echo '
76
+		foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
77
+					echo '
78 78
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
79
+		}
79 80
 		echo '
80 81
 						</select> ';
81 82
 	}
@@ -90,14 +91,15 @@  discard block
 block discarded – undo
90 91
 					</dd>';
91 92
 
92 93
 	// If this is a new smiley set they have the option to import smileys already in the directory.
93
-	if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
94
-		echo '
94
+	if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
95
+			echo '
95 96
 					<dt>
96 97
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
97 98
 					</dt>
98 99
 					<dd>
99 100
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1">
100 101
 					</dd>';
102
+	}
101 103
 
102 104
 	echo '
103 105
 				</dl>
@@ -131,9 +133,10 @@  discard block
 block discarded – undo
131 133
 					<dd>
132 134
 						<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">';
133 135
 
134
-	foreach ($context['smiley_sets'] as $smiley_set)
135
-		echo '
136
+	foreach ($context['smiley_sets'] as $smiley_set) {
137
+			echo '
136 138
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
139
+	}
137 140
 
138 141
 	echo '
139 142
 						</select>)
@@ -149,17 +152,18 @@  discard block
 block discarded – undo
149 152
 					</dt>
150 153
 					<dd>';
151 154
 
152
-	if (empty($context['filenames']))
153
-		echo '
155
+	if (empty($context['filenames'])) {
156
+			echo '
154 157
 						<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">';
155
-	else
158
+	} else
156 159
 	{
157 160
 		echo '
158 161
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
159 162
 
160
-		foreach ($context['filenames'] as $filename)
161
-			echo '
163
+		foreach ($context['filenames'] as $filename) {
164
+					echo '
162 165
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
166
+		}
163 167
 		echo '
164 168
 						</select>';
165 169
 	}
@@ -228,9 +232,10 @@  discard block
 block discarded – undo
228 232
 						<dd>
229 233
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
230 234
 
231
-	foreach ($context['smiley_sets'] as $smiley_set)
232
-		echo '
235
+	foreach ($context['smiley_sets'] as $smiley_set) {
236
+			echo '
233 237
 								<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
238
+	}
234 239
 
235 240
 	echo '
236 241
 							</select>
@@ -240,17 +245,18 @@  discard block
 block discarded – undo
240 245
 						</dt>
241 246
 						<dd>';
242 247
 
243
-	if (empty($context['filenames']))
244
-		echo '
248
+	if (empty($context['filenames'])) {
249
+			echo '
245 250
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">';
246
-	else
251
+	} else
247 252
 	{
248 253
 		echo '
249 254
 							<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
250 255
 
251
-		foreach ($context['filenames'] as $filename)
252
-			echo '
256
+		foreach ($context['filenames'] as $filename) {
257
+					echo '
253 258
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
259
+		}
254 260
 		echo '
255 261
 							</select>';
256 262
 	}
@@ -279,14 +285,15 @@  discard block
 block discarded – undo
279 285
 
280 286
 				<dl id="uploadMore" style="display: none;" class="settings">';
281 287
 
282
-	foreach ($context['smiley_sets'] as $smiley_set)
283
-		echo '
288
+	foreach ($context['smiley_sets'] as $smiley_set) {
289
+			echo '
284 290
 					<dt>
285 291
 						', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ':
286 292
 					</dt>
287 293
 					<dd>
288 294
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');">
289 295
 					</dd>';
296
+	}
290 297
 
291 298
 	echo '
292 299
 				</dl>
@@ -357,27 +364,30 @@  discard block
 block discarded – undo
357 364
 
358 365
 		foreach ($location['rows'] as $row)
359 366
 		{
360
-			if (!empty($context['move_smiley']))
361
-				echo '
367
+			if (!empty($context['move_smiley'])) {
368
+							echo '
362 369
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
370
+			}
363 371
 
364 372
 			foreach ($row as $smiley)
365 373
 			{
366
-				if (empty($context['move_smiley']))
367
-					echo '
374
+				if (empty($context['move_smiley'])) {
375
+									echo '
368 376
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>';
369
-				else
370
-					echo '
377
+				} else {
378
+									echo '
371 379
 				<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '>
372 380
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
381
+				}
373 382
 			}
374 383
 
375 384
 			echo '
376 385
 				<br>';
377 386
 		}
378
-		if (!empty($context['move_smiley']))
379
-			echo '
387
+		if (!empty($context['move_smiley'])) {
388
+					echo '
380 389
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
390
+		}
381 391
 		echo '
382 392
 			</div><!-- .windowbg2 -->
383 393
 			<input type="hidden" name="reorder" value="1">
@@ -414,14 +424,15 @@  discard block
 block discarded – undo
414 424
 			<div class="windowbg2">
415 425
 				<dl class="settings">';
416 426
 
417
-	if (!$context['new_icon'])
418
-		echo '
427
+	if (!$context['new_icon']) {
428
+			echo '
419 429
 					<dt>
420 430
 						<strong>', $txt['smiley_preview'], ': </strong>
421 431
 					</dt>
422 432
 					<dd>
423 433
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
424 434
 					</dd>';
435
+	}
425 436
 
426 437
 	echo '
427 438
 					<dt>
@@ -448,9 +459,10 @@  discard block
 block discarded – undo
448 459
 		echo '
449 460
 							<optgroup label="', $category['name'], '">';
450 461
 
451
-		foreach ($category['boards'] as $board)
452
-			echo '
462
+		foreach ($category['boards'] as $board) {
463
+					echo '
453 464
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
465
+		}
454 466
 
455 467
 		echo '
456 468
 							</optgroup>';
@@ -467,19 +479,21 @@  discard block
 block discarded – undo
467 479
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
468 480
 
469 481
 	// Print the list of all the icons it can be put after...
470
-	foreach ($context['icons'] as $id => $data)
471
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
482
+	foreach ($context['icons'] as $id => $data) {
483
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
472 484
 			echo '
473 485
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
486
+	}
474 487
 
475 488
 	echo '
476 489
 						</select>
477 490
 					</dd>
478 491
 				</dl>';
479 492
 
480
-	if (!$context['new_icon'])
481
-		echo '
493
+	if (!$context['new_icon']) {
494
+			echo '
482 495
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
496
+	}
483 497
 
484 498
 	echo '
485 499
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/ReportToMod.template.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,16 +62,17 @@
 block discarded – undo
62 62
 				<div id="error_box" class="errorbox">
63 63
 					<ul id="error_list">';
64 64
 
65
-		foreach ($context['post_errors'] as $key => $error)
66
-			echo '
65
+		foreach ($context['post_errors'] as $key => $error) {
66
+					echo '
67 67
 						<li id="error_', $key, '" class="error">', $error, '</li>';
68
+		}
68 69
 
69 70
 		echo '
70 71
 					</ul>';
71
-	}
72
-	else
73
-		echo '
72
+	} else {
73
+			echo '
74 74
 				<div style="display:none" id="error_box" class="errorbox">';
75
+	}
75 76
 
76 77
 	echo '
77 78
 				</div>';
Please login to merge, or discard this patch.