Completed
Push — release-2.1 ( 5fca16...3ecb1d )
by Michael
07:15
created
Themes/default/index.template.php 1 patch
Braces   +89 added lines, -61 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 disable 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.
@@ -111,8 +112,9 @@  discard block
 block discarded – undo
111 112
 		echo '
112 113
 	<meta';
113 114
 
114
-		foreach ($meta_tag as $meta_key => $meta_value)
115
-			echo ' ', $meta_key, '="', $meta_value, '"';
115
+		foreach ($meta_tag as $meta_key => $meta_value) {
116
+					echo ' ', $meta_key, '="', $meta_value, '"';
117
+		}
116 118
 
117 119
 		echo '>';
118 120
 	}
@@ -123,14 +125,16 @@  discard block
 block discarded – undo
123 125
 	<meta name="theme-color" content="#557EA0">';
124 126
 
125 127
 	// Please don't index these Mr Robot.
126
-	if (!empty($context['robot_no_index']))
127
-		echo '
128
+	if (!empty($context['robot_no_index'])) {
129
+			echo '
128 130
 	<meta name="robots" content="noindex">';
131
+	}
129 132
 
130 133
 	// Present a canonical url for search engines to prevent duplicate content in their indices.
131
-	if (!empty($context['canonical_url']))
132
-		echo '
134
+	if (!empty($context['canonical_url'])) {
135
+			echo '
133 136
 	<link rel="canonical" href="', $context['canonical_url'], '">';
137
+	}
134 138
 
135 139
 	// Show all the relative links, such as help, search, contents, and the like.
136 140
 	echo '
@@ -139,10 +143,11 @@  discard block
 block discarded – undo
139 143
 	<link rel="search" href="' . $scripturl . '?action=search">' : '');
140 144
 
141 145
 	// If RSS feeds are enabled, advertise the presence of one.
142
-	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
143
-		echo '
146
+	if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) {
147
+			echo '
144 148
 	<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'] : '', '">
145 149
 	<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'] : '', '">';
150
+	}
146 151
 
147 152
 	// If we're viewing a topic, these should be the previous and next topics, respectively.
148 153
 	if (!empty($context['links']['next']))
@@ -158,9 +163,10 @@  discard block
 block discarded – undo
158 163
 	}
159 164
 
160 165
 	// If we're in a board, or a topic for that matter, the index will be the board's index.
161
-	if (!empty($context['current_board']))
162
-		echo '
166
+	if (!empty($context['current_board'])) {
167
+			echo '
163 168
 	<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0">';
169
+	}
164 170
 
165 171
 	// Output any remaining HTML headers. (from mods, maybe?)
166 172
 	echo $context['html_headers'];
@@ -191,8 +197,9 @@  discard block
 block discarded – undo
191 197
 		<ul class="floatleft" id="top_info">
192 198
 			<li>
193 199
 				<a href="', $scripturl, '?action=profile"', !empty($context['self_profile']) ? ' class="active"' : '', ' id="profile_menu_top" onclick="return false;">';
194
-					if (!empty($context['user']['avatar']))
195
-						echo $context['user']['avatar']['image'];
200
+					if (!empty($context['user']['avatar'])) {
201
+											echo $context['user']['avatar']['image'];
202
+					}
196 203
 					echo $context['user']['name'], '</a>
197 204
 				<div id="profile_menu" class="top_menu"></div>
198 205
 			</li>';
@@ -220,17 +227,18 @@  discard block
 block discarded – undo
220 227
 	}
221 228
 	// Otherwise they're a guest. Ask them to either register or login.
222 229
 	else
223
-		if (empty($maintenance))
224
-			echo '
230
+		if (empty($maintenance)) {
231
+					echo '
225 232
 			<ul class="floatleft welcome">
226 233
 				<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>
227 234
 			</ul>';
228
-		else
229
-			//In maintenance mode, only login is allowed and don't show OverlayDiv
235
+		} else {
236
+					//In maintenance mode, only login is allowed and don't show OverlayDiv
230 237
 			echo '
231 238
 			<ul class="floatleft welcome">
232 239
 				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
233 240
 			</ul>';
241
+		}
234 242
 
235 243
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
236 244
 	{
@@ -238,9 +246,10 @@  discard block
 block discarded – undo
238 246
 		<form id="languages_form" method="get" class="floatright">
239 247
 			<select id="language_select" name="language" onchange="this.form.submit()">';
240 248
 
241
-		foreach ($context['languages'] as $language)
242
-			echo '
249
+		foreach ($context['languages'] as $language) {
250
+					echo '
243 251
 				<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
252
+		}
244 253
 
245 254
 		echo '
246 255
 			</select>
@@ -264,31 +273,36 @@  discard block
 block discarded – undo
264 273
 				<option value="all"', ($selected == 'all' ? ' selected' : ''), '>', $txt['search_entireforum'], ' </option>';
265 274
 
266 275
 		// Can't limit it to a specific topic if we are not in one
267
-		if (!empty($context['current_topic']))
268
-			echo '
276
+		if (!empty($context['current_topic'])) {
277
+					echo '
269 278
 				<option value="topic"', ($selected == 'current_topic' ? ' selected' : ''), '>', $txt['search_thistopic'], '</option>';
279
+		}
270 280
 
271 281
 		// Can't limit it to a specific board if we are not in one
272
-		if (!empty($context['current_board']))
273
-			echo '
282
+		if (!empty($context['current_board'])) {
283
+					echo '
274 284
 				<option value="board"', ($selected == 'current_board' ? ' selected' : ''), '>', $txt['search_thisbrd'], '</option>';
285
+		}
275 286
 
276 287
 		// Can't search for members if we can't see the memberlist
277
-		if (!empty($context['allow_memberlist']))
278
-			echo '
288
+		if (!empty($context['allow_memberlist'])) {
289
+					echo '
279 290
 				<option value="members"', ($selected == 'members' ? ' selected' : ''), '>', $txt['search_members'], ' </option>';
291
+		}
280 292
 
281 293
 		echo '
282 294
 			</select>';
283 295
 
284 296
 		// Search within current topic?
285
-		if (!empty($context['current_topic']))
286
-			echo '
297
+		if (!empty($context['current_topic'])) {
298
+					echo '
287 299
 			<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
300
+		}
288 301
 		// If we're on a certain board, limit it to this board ;).
289
-		elseif (!empty($context['current_board']))
290
-			echo '
302
+		elseif (!empty($context['current_board'])) {
303
+					echo '
291 304
 			<input type="hidden" name="sd_brd" value="', $context['current_board'], '">';
305
+		}
292 306
 
293 307
 		echo '
294 308
 			<input type="submit" name="search2" value="', $txt['search'], '" class="button">
@@ -318,12 +332,13 @@  discard block
 block discarded – undo
318 332
 						', $context['current_time'], '
319 333
 					</div>';
320 334
 	// Show a random news item? (or you could pick one from news_lines...)
321
-	if (!empty($settings['enable_news']) && !empty($context['random_news_line']))
322
-		echo '
335
+	if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
336
+			echo '
323 337
 					<div class="news">
324 338
 						<h2>', $txt['news'], ': </h2>
325 339
 						<p>', $context['random_news_line'], '</p>
326 340
 					</div>';
341
+	}
327 342
 
328 343
 	echo '
329 344
 					<hr class="clear">
@@ -386,9 +401,10 @@  discard block
 block discarded – undo
386 401
 		</ul>';
387 402
 
388 403
 	// Show the load time?
389
-	if ($context['show_load_time'])
390
-		echo '
404
+	if ($context['show_load_time']) {
405
+			echo '
391 406
 		<p>', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</p>';
407
+	}
392 408
 
393 409
 	echo '
394 410
 	</div>';
@@ -418,19 +434,21 @@  discard block
 block discarded – undo
418 434
 	global $context, $shown_linktree, $scripturl, $txt;
419 435
 
420 436
 	// If linktree is empty, just return - also allow an override.
421
-	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
422
-		return;
437
+	if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show)) {
438
+			return;
439
+	}
423 440
 
424 441
 	echo '
425 442
 				<div class="navigate_section">
426 443
 					<ul>';
427 444
 
428
-	if ($context['user']['is_logged'])
429
-	echo '
445
+	if ($context['user']['is_logged']) {
446
+		echo '
430 447
 						<li class="unread_links">
431 448
 							<a href="', $scripturl, '?action=unread" title="', $txt['unread_since_visit'], '">', $txt['view_unread_category'], '</a>
432 449
 							<a href="', $scripturl, '?action=unreadreplies" title="', $txt['show_unread_replies'], '">', $txt['unread_replies'], '</a>
433 450
 						</li>';
451
+	}
434 452
 
435 453
 	// Each tree item has a URL and name. Some may have extra_before and extra_after.
436 454
 	foreach ($context['linktree'] as $link_num => $tree)
@@ -441,25 +459,29 @@  discard block
 block discarded – undo
441 459
 		// Don't show a separator for the first one.
442 460
 		// Better here. Always points to the next level when the linktree breaks to a second line.
443 461
 		// Picked a better looking HTML entity, and added support for RTL plus a span for styling.
444
-		if ($link_num != 0)
445
-			echo '
462
+		if ($link_num != 0) {
463
+					echo '
446 464
 							<span class="dividers">', $context['right_to_left'] ? ' &#9668; ' : ' &#9658; ', '</span>';
465
+		}
447 466
 
448 467
 		// Show something before the link?
449
-		if (isset($tree['extra_before']))
450
-			echo $tree['extra_before'], ' ';
468
+		if (isset($tree['extra_before'])) {
469
+					echo $tree['extra_before'], ' ';
470
+		}
451 471
 
452 472
 		// Show the link, including a URL if it should have one.
453
-		if (isset($tree['url']))
454
-			echo '
473
+		if (isset($tree['url'])) {
474
+					echo '
455 475
 					<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>';
456
-		else
457
-			echo '
476
+		} else {
477
+					echo '
458 478
 					<span>' . $tree['name'] . '</span>';
479
+		}
459 480
 
460 481
 		// Show something after the link...?
461
-		if (isset($tree['extra_after']))
462
-			echo ' ', $tree['extra_after'];
482
+		if (isset($tree['extra_after'])) {
483
+					echo ' ', $tree['extra_after'];
484
+		}
463 485
 
464 486
 		echo '
465 487
 						</li>';
@@ -509,13 +531,14 @@  discard block
 block discarded – undo
509 531
 					echo '
510 532
 									<ul>';
511 533
 
512
-					foreach ($childbutton['sub_buttons'] as $grandchildbutton)
513
-						echo '
534
+					foreach ($childbutton['sub_buttons'] as $grandchildbutton) {
535
+											echo '
514 536
 										<li>
515 537
 											<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
516 538
 												', $grandchildbutton['title'], '
517 539
 											</a>
518 540
 										</li>';
541
+					}
519 542
 
520 543
 					echo '
521 544
 									</ul>';
@@ -546,8 +569,9 @@  discard block
 block discarded – undo
546 569
 {
547 570
 	global $context, $txt;
548 571
 
549
-	if (!is_array($strip_options))
550
-		$strip_options = array();
572
+	if (!is_array($strip_options)) {
573
+			$strip_options = array();
574
+	}
551 575
 
552 576
 	// Create the buttons...
553 577
 	$buttons = array();
@@ -556,8 +580,9 @@  discard block
 block discarded – undo
556 580
 		// 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 581
 		if (!isset($value['test']) || !empty($context[$value['test']]))
558 582
 		{
559
-			if (!isset($value['id']))
560
-				$value['id'] = $key;
583
+			if (!isset($value['id'])) {
584
+							$value['id'] = $key;
585
+			}
561 586
 
562 587
 			$button = '
563 588
 				<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 +595,15 @@  discard block
 block discarded – undo
570 595
 							<div class="overview">';
571 596
 				foreach ($value['sub_buttons'] as $element)
572 597
 				{
573
-					if (isset($element['test']) && empty($context[$element['test']]))
574
-						continue;
598
+					if (isset($element['test']) && empty($context[$element['test']])) {
599
+											continue;
600
+					}
575 601
 
576 602
 					$button .= '
577 603
 								<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>';
604
+					if (isset($txt[$element['text'] . '_desc'])) {
605
+											$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
606
+					}
580 607
 					$button .= '</a>';
581 608
 				}
582 609
 				$button .= '
@@ -590,8 +617,9 @@  discard block
 block discarded – undo
590 617
 	}
591 618
 
592 619
 	// No buttons? No button strip either.
593
-	if (empty($buttons))
594
-		return;
620
+	if (empty($buttons)) {
621
+			return;
622
+	}
595 623
 
596 624
 	echo '
597 625
 		<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/ManageMembergroups.template.php 1 patch
Braces   +92 added lines, -65 removed lines patch added patch discarded remove patch
@@ -52,9 +52,10 @@  discard block
 block discarded – undo
52 52
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
53 53
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0" checked onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
54 54
 
55
-		if ($context['allow_protected'])
56
-			echo '
55
+		if ($context['allow_protected']) {
56
+					echo '
57 57
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
58
+		}
58 59
 
59 60
 		echo '
60 61
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2" onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -64,14 +65,15 @@  discard block
 block discarded – undo
64 65
 					</dd>';
65 66
 	}
66 67
 
67
-	if ($context['post_group'] || $context['undefined_group'])
68
-		echo '
68
+	if ($context['post_group'] || $context['undefined_group']) {
69
+			echo '
69 70
 					<dt id="min_posts_text">
70 71
 						<strong>', $txt['membergroups_min_posts'], ':</strong>
71 72
 					</dt>
72 73
 					<dd>
73 74
 						<input type="number" name="min_posts" id="min_posts_input" size="5">
74 75
 					</dd>';
76
+	}
75 77
 	if (!$context['post_group'] || !empty($modSettings['permission_enable_postgroups']))
76 78
 	{
77 79
 		echo '
@@ -87,9 +89,10 @@  discard block
 block discarded – undo
87 89
 							<select name="inheritperm" id="inheritperm_select" onclick="document.getElementById(\'perm_type_inherit\').checked = true;">
88 90
 								<option value="-1">', $txt['membergroups_guests'], '</option>
89 91
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
90
-		foreach ($context['groups'] as $group)
91
-			echo '
92
+		foreach ($context['groups'] as $group) {
93
+					echo '
92 94
 								<option value="', $group['id'], '">', $group['name'], '</option>';
95
+		}
93 96
 		echo '
94 97
 							</select>
95 98
 							<br>
@@ -98,9 +101,10 @@  discard block
 block discarded – undo
98 101
 							<select name="copyperm" id="copyperm_select" onclick="document.getElementById(\'perm_type_copy\').checked = true;">
99 102
 								<option value="-1">', $txt['membergroups_guests'], '</option>
100 103
 								<option value="0" selected>', $txt['membergroups_members'], '</option>';
101
-		foreach ($context['groups'] as $group)
102
-			echo '
104
+		foreach ($context['groups'] as $group) {
105
+					echo '
103 106
 								<option value="', $group['id'], '">', $group['name'], '</option>';
107
+		}
104 108
 		echo '
105 109
 							</select>
106 110
 							<br>
@@ -173,8 +177,8 @@  discard block
 block discarded – undo
173 177
 						<input type="text" name="group_name" id="group_name_input" value="', $context['group']['editable_name'], '" size="30">
174 178
 					</dd>';
175 179
 
176
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
177
-		echo '
180
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
181
+			echo '
178 182
 
179 183
 					<dt id="group_desc_text">
180 184
 						<label for="group_desc_input"><strong>', $txt['membergroups_edit_desc'], ':</strong></label>
@@ -182,6 +186,7 @@  discard block
 block discarded – undo
182 186
 					<dd>
183 187
 						<textarea name="group_desc" id="group_desc_input" rows="4" cols="40">', $context['group']['description'], '</textarea>
184 188
 					</dd>';
189
+	}
185 190
 
186 191
 	// Group type...
187 192
 	if ($context['group']['allow_post_group'])
@@ -195,9 +200,10 @@  discard block
 block discarded – undo
195 200
 							<legend>', $txt['membergroups_edit_select_group_type'], '</legend>
196 201
 							<label for="group_type_private"><input type="radio" name="group_type" id="group_type_private" value="0"', !$context['group']['is_post_group'] && $context['group']['type'] == 0 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_private'], '</label><br>';
197 202
 
198
-		if ($context['group']['allow_protected'])
199
-			echo '
203
+		if ($context['group']['allow_protected']) {
204
+					echo '
200 205
 							<label for="group_type_protected"><input type="radio" name="group_type" id="group_type_protected" value="1"', $context['group']['type'] == 1 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_protected'], '</label><br>';
206
+		}
201 207
 
202 208
 		echo '
203 209
 							<label for="group_type_request"><input type="radio" name="group_type" id="group_type_request" value="2"', $context['group']['type'] == 2 ? ' checked' : '', ' onclick="swapPostGroup(0);">', $txt['membergroups_group_type_request'], '</label><br>
@@ -207,8 +213,8 @@  discard block
 block discarded – undo
207 213
 					</dd>';
208 214
 	}
209 215
 
210
-	if ($context['group']['id'] != 3 && $context['group']['id'] != 4)
211
-		echo '
216
+	if ($context['group']['id'] != 3 && $context['group']['id'] != 4) {
217
+			echo '
212 218
 					<dt id="group_moderators_text">
213 219
 						<label for="group_moderators"><strong>', $txt['moderators'], ':</strong></label>
214 220
 					</dt>
@@ -226,6 +232,7 @@  discard block
 block discarded – undo
226 232
 							<option value="2"', $context['group']['hidden'] == 2 ? ' selected' : '', '>', $txt['membergroups_edit_hidden_all'], '</option>
227 233
 						</select>
228 234
 					</dd>';
235
+	}
229 236
 
230 237
 	// Can they inherit permissions?
231 238
 	if ($context['group']['id'] > 1 && $context['group']['id'] != 3)
@@ -242,9 +249,10 @@  discard block
 block discarded – undo
242 249
 							<option value="0"', $context['group']['inherited_from'] == 0 ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $txt['membergroups_members'], '</option>';
243 250
 
244 251
 		// For all the inheritable groups show an option.
245
-		foreach ($context['inheritable_groups'] as $id => $group)
246
-			echo '
252
+		foreach ($context['inheritable_groups'] as $id => $group) {
253
+					echo '
247 254
 							<option value="', $id, '"', $context['group']['inherited_from'] == $id ? ' selected' : '', '>', $txt['membergroups_edit_inherit_permissions_from'], ': ', $group, '</option>';
255
+		}
248 256
 
249 257
 		echo '
250 258
 						</select>
@@ -252,8 +260,8 @@  discard block
 block discarded – undo
252 260
 					</dd>';
253 261
 	}
254 262
 
255
-	if ($context['group']['allow_post_group'])
256
-		echo '
263
+	if ($context['group']['allow_post_group']) {
264
+			echo '
257 265
 
258 266
 					<dt id="min_posts_text">
259 267
 						<label for="min_posts_input"><strong>', $txt['membergroups_min_posts'], ':</strong></label>
@@ -261,6 +269,7 @@  discard block
 block discarded – undo
261 269
 					<dd>
262 270
 						<input type="number" name="min_posts" id="min_posts_input"', $context['group']['is_post_group'] ? ' value="' . $context['group']['min_posts'] . '"' : '', ' size="6">
263 271
 					</dd>';
272
+	}
264 273
 	echo '
265 274
 					<dt>
266 275
 						<label for="online_color_input"><strong>', $txt['membergroups_online_color'], ':</strong></label>
@@ -302,9 +311,10 @@  discard block
 block discarded – undo
302 311
 	}
303 312
 
304 313
 	// No? Hide the entire control.
305
-	else
306
-		echo '
314
+	else {
315
+			echo '
307 316
 					<input type="hidden" name="icon_image" value="">';
317
+	}
308 318
 
309 319
 	echo '
310 320
 					<dt>
@@ -315,8 +325,8 @@  discard block
 block discarded – undo
315 325
 						<input type="text" name="max_messages" id="max_messages_input" value="', $context['group']['id'] == 1 ? 0 : $context['group']['max_messages'], '" size="6"', $context['group']['id'] == 1 ? ' disabled' : '', '>
316 326
 					</dd>';
317 327
 	//Force 2FA for this membergroup?
318
-	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2)
319
-	echo '
328
+	if (!empty($modSettings['tfa_mode']) && $modSettings['tfa_mode'] == 2) {
329
+		echo '
320 330
 					<dt>
321 331
 						<label for="group_tfa_force_input"><strong>', $txt['membergroups_tfa_force'], ':</strong></label><br>
322 332
 						<span class="smalltext">', $txt['membergroups_tfa_force_note'], '</span>
@@ -324,6 +334,7 @@  discard block
 block discarded – undo
324 334
 					<dd>
325 335
 						<input type="checkbox" name="group_tfa_force"', $context['group']['tfa_required'] ? ' checked' : '', '>
326 336
 					</dd>';
337
+	}
327 338
 
328 339
 	if (!empty($context['categories']))
329 340
 	{
@@ -333,10 +344,11 @@  discard block
 block discarded – undo
333 344
 						<span class="smalltext">' . $txt['membergroups_new_board_post_groups'] . '</span>' : '', '
334 345
 					</dt>
335 346
 					<dd>';
336
-		if (!empty($context['can_manage_boards']))
337
-			echo $txt['membergroups_can_manage_access'];
338
-		else
339
-			template_add_edit_group_boards_list();
347
+		if (!empty($context['can_manage_boards'])) {
348
+					echo $txt['membergroups_can_manage_access'];
349
+		} else {
350
+					template_add_edit_group_boards_list();
351
+		}
340 352
 
341 353
 		echo '
342 354
 					</dd>';
@@ -365,20 +377,21 @@  discard block
 block discarded – undo
365 377
 				sItemListContainerId: \'moderator_container\',
366 378
 				aListItems: [';
367 379
 
368
-			foreach ($context['group']['moderators'] as $id_member => $member_name)
369
-				echo '
380
+			foreach ($context['group']['moderators'] as $id_member => $member_name) {
381
+							echo '
370 382
 							{
371 383
 								sItemId: ', JavaScriptEscape($id_member), ',
372 384
 								sItemName: ', JavaScriptEscape($member_name), '
373 385
 							}', $id_member == $context['group']['last_moderator_id'] ? '' : ',';
386
+			}
374 387
 
375 388
 			echo '
376 389
 				]
377 390
 			});
378 391
 		</script>';
379 392
 
380
-	if ($context['group']['allow_post_group'])
381
-		echo '
393
+	if ($context['group']['allow_post_group']) {
394
+			echo '
382 395
 		<script>
383 396
 			function swapPostGroup(isChecked)
384 397
 			{
@@ -426,7 +439,8 @@  discard block
 block discarded – undo
426 439
 
427 440
 			swapPostGroup(', $context['group']['is_post_group'] ? 'true' : 'false', ');
428 441
 		</script>';
429
-}
442
+	}
443
+	}
430 444
 
431 445
 /**
432 446
  * The template for determining which boards a group has access to.
@@ -443,13 +457,13 @@  discard block
 block discarded – undo
443 457
 
444 458
 	foreach ($context['categories'] as $category)
445 459
 	{
446
-		if (empty($modSettings['deny_boards_access']))
447
-			echo '
460
+		if (empty($modSettings['deny_boards_access'])) {
461
+					echo '
448 462
 									<li class="category">
449 463
 										<a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'new_group\'); return false;"><strong>', $category['name'], '</strong></a>
450 464
 									<ul style="width:100%">';
451
-		else
452
-			echo '
465
+		} else {
466
+					echo '
453 467
 									<li class="category">
454 468
 										<strong>', $category['name'], '</strong>
455 469
 										<span class="select_all_box">
@@ -462,16 +476,17 @@  discard block
 block discarded – undo
462 476
 											</select>
463 477
 										</span>
464 478
 										<ul style="width:100%" id="boards_list_', $category['id'], '">';
479
+		}
465 480
 
466 481
 		foreach ($category['boards'] as $board)
467 482
 		{
468
-			if (empty($modSettings['deny_boards_access']))
469
-				echo '
483
+			if (empty($modSettings['deny_boards_access'])) {
484
+							echo '
470 485
 										<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
471 486
 											<input type="checkbox" name="boardaccess[', $board['id'], ']" id="brd', $board['id'], '" value="allow"', $board['allow'] ? ' checked' : '', '> <label for="brd', $board['id'], '">', $board['name'], '</label>
472 487
 										</li>';
473
-			else
474
-				echo '
488
+			} else {
489
+							echo '
475 490
 											<li class="board" style="width:100%">
476 491
 												<span style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">', $board['name'], ': </span>
477 492
 												<span style="width:50%;float:right">
@@ -480,6 +495,7 @@  discard block
 block discarded – undo
480 495
 													<input type="radio" name="boardaccess[', $board['id'], ']" id="deny_brd', $board['id'], '" value="deny"', $board['deny'] ? ' checked' : '', '> <label for="deny_brd', $board['id'], '">', $txt['permissions_option_deny'], '</label>
481 496
 												</span>
482 497
 											</li>';
498
+			}
483 499
 		}
484 500
 
485 501
 		echo '
@@ -490,13 +506,13 @@  discard block
 block discarded – undo
490 506
 	echo '
491 507
 							</ul>';
492 508
 
493
-	if (empty($modSettings['deny_boards_access']))
494
-		echo '
509
+	if (empty($modSettings['deny_boards_access'])) {
510
+			echo '
495 511
 								<br class="clear"><br>
496 512
 								<input type="checkbox" id="checkall_check" onclick="invertAll(this, this.form, \'boardaccess\');"> <label for="checkall_check"><em>', $txt['check_all'], '</em></label>
497 513
 							</fieldset>';
498
-	else
499
-		echo '
514
+	} else {
515
+			echo '
500 516
 								<br class="clear">
501 517
 								<span class="select_all_box">
502 518
 									<em>', $txt['all'], ': </em>
@@ -512,15 +528,17 @@  discard block
 block discarded – undo
512 528
 									});
513 529
 								});
514 530
 							</script>';
531
+	}
515 532
 
516
-	if ($collapse)
517
-		echo '
533
+	if ($collapse) {
534
+			echo '
518 535
 							<a href="javascript:void(0);" onclick="document.getElementById(\'visible_boards\').style.display = \'block\'; document.getElementById(\'visible_boards_link\').style.display = \'none\'; return false;" id="visible_boards_link" style="display: none;">[ ', $txt['membergroups_select_visible_boards'], ' ]</a>
519 536
 							<script>
520 537
 								document.getElementById("visible_boards_link").style.display = "";
521 538
 								document.getElementById("visible_boards").style.display = "none";
522 539
 							</script>';
523
-}
540
+	}
541
+	}
524 542
 
525 543
 /**
526 544
  * Templatine for viewing the members of a group.
@@ -544,14 +562,15 @@  discard block
 block discarded – undo
544 562
 						<span ', $context['group']['online_color'] ? 'style="color: ' . $context['group']['online_color'] . ';"' : '', '>', $context['group']['name'], '</span> ', $context['group']['icons'], '
545 563
 					</dd>';
546 564
 	//Any description to show?
547
-	if (!empty($context['group']['description']))
548
-		echo '
565
+	if (!empty($context['group']['description'])) {
566
+			echo '
549 567
 					<dt>
550 568
 						<strong>' . $txt['membergroups_members_description'] . ':</strong>
551 569
 					</dt>
552 570
 					<dd>
553 571
 						', $context['group']['description'], '
554 572
 					</dd>';
573
+	}
555 574
 
556 575
 	echo '
557 576
 					<dt>
@@ -564,8 +583,9 @@  discard block
 block discarded – undo
564 583
 	if (!empty($context['group']['moderators']))
565 584
 	{
566 585
 		$moderators = array();
567
-		foreach ($context['group']['moderators'] as $moderator)
568
-			$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
586
+		foreach ($context['group']['moderators'] as $moderator) {
587
+					$moderators[] = '<a href="' . $scripturl . '?action=profile;u=' . $moderator['id'] . '">' . $moderator['name'] . '</a>';
588
+		}
569 589
 
570 590
 		echo '
571 591
 					<dt>
@@ -591,27 +611,30 @@  discard block
 block discarded – undo
591 611
 					<tr class="title_bar">
592 612
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['name'], $context['sort_by'] == 'name' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
593 613
 
594
-	if ($context['can_send_email'])
595
-		echo '
614
+	if ($context['can_send_email']) {
615
+			echo '
596 616
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=email', $context['sort_by'] == 'email' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['email'], $context['sort_by'] == 'email' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
617
+	}
597 618
 
598 619
 	echo '
599 620
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=active', $context['sort_by'] == 'active' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['membergroups_members_last_active'], $context['sort_by'] == 'active' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
600 621
 						<th><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=registered', $context['sort_by'] == 'registered' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['date_registered'], $context['sort_by'] == 'registered' ? '<span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>
601 622
 						<th ', empty($context['group']['assignable']) ? ' colspan="2"' : '', '><a href="', $scripturl, '?action=', $context['current_action'], (isset($context['admin_area']) ? ';area=' . $context['admin_area'] : ''), ';sa=members;start=', $context['start'], ';sort=posts', $context['sort_by'] == 'posts' && $context['sort_direction'] == 'up' ? ';desc' : '', ';group=', $context['group']['id'], '">', $txt['posts'], $context['sort_by'] == 'posts' ? ' <span class="generic_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a></th>';
602
-	if (!empty($context['group']['assignable']))
603
-		echo '
623
+	if (!empty($context['group']['assignable'])) {
624
+			echo '
604 625
 						<th style="width: 4%"><input type="checkbox" onclick="invertAll(this, this.form);"></th>';
626
+	}
605 627
 	echo '
606 628
 					</tr>
607 629
 				</thead>
608 630
 				<tbody>';
609 631
 
610
-	if (empty($context['members']))
611
-		echo '
632
+	if (empty($context['members'])) {
633
+			echo '
612 634
 					<tr class="windowbg">
613 635
 						<td colspan="6">', $txt['membergroups_members_no_members'], '</td>
614 636
 					</tr>';
637
+	}
615 638
 
616 639
 	foreach ($context['members'] as $member)
617 640
 	{
@@ -630,9 +653,10 @@  discard block
 block discarded – undo
630 653
 						<td>', $member['last_online'], '</td>
631 654
 						<td>', $member['registered'], '</td>
632 655
 						<td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';
633
-		if (!empty($context['group']['assignable']))
634
-			echo '
656
+		if (!empty($context['group']['assignable'])) {
657
+					echo '
635 658
 						<td style="width: 4%"><input type="checkbox" name="rem[]" value="', $member['id'], '" ', ($context['user']['id'] == $member['id'] && $context['group']['id'] == 1 ? 'onclick="if (this.checked) return confirm(\'' . $txt['membergroups_members_deadmin_confirm'] . '\')" ' : ''), '/></td>';
659
+		}
636 660
 		echo '
637 661
 					</tr>';
638 662
 	}
@@ -641,11 +665,12 @@  discard block
 block discarded – undo
641 665
 				</tbody>
642 666
 			</table>';
643 667
 
644
-	if (!empty($context['group']['assignable']))
645
-		echo '
668
+	if (!empty($context['group']['assignable'])) {
669
+			echo '
646 670
 			<div class="floatright">
647 671
 				<input type="submit" name="remove" value="', $txt['membergroups_members_remove'], '" class="button ">
648 672
 			</div>';
673
+	}
649 674
 
650 675
 	echo '
651 676
 			<div class="pagesection flow_hidden">
@@ -679,8 +704,8 @@  discard block
 block discarded – undo
679 704
 		</form>
680 705
 	</div>';
681 706
 
682
-	if (!empty($context['group']['assignable']))
683
-		echo '
707
+	if (!empty($context['group']['assignable'])) {
708
+			echo '
684 709
 		<script>
685 710
 			var oAddMemberSuggest = new smc_AutoSuggest({
686 711
 				sSelf: \'oAddMemberSuggest\',
@@ -696,7 +721,8 @@  discard block
 block discarded – undo
696 721
 				sItemListContainerId: \'toAddItemContainer\'
697 722
 			});
698 723
 		</script>';
699
-}
724
+	}
725
+	}
700 726
 
701 727
 /**
702 728
  * Allow the moderator to enter a reason to each user being rejected.
@@ -716,8 +742,8 @@  discard block
 block discarded – undo
716 742
 				<dl class="settings">';
717 743
 
718 744
 	// Loop through and print out a reason box for each...
719
-	foreach ($context['group_requests'] as $request)
720
-		echo '
745
+	foreach ($context['group_requests'] as $request) {
746
+			echo '
721 747
 					<dt>
722 748
 						<strong>', sprintf($txt['mc_groupr_reason_desc'], $request['member_link'], $request['group_link']), ':</strong>
723 749
 					</dt>
@@ -725,6 +751,7 @@  discard block
 block discarded – undo
725 751
 						<input type="hidden" name="groupr[]" value="', $request['id'], '">
726 752
 						<textarea name="groupreason[', $request['id'], ']" rows="3" cols="40" style="min-width: 80%; max-width: 99%;"></textarea>
727 753
 					</dd>';
754
+	}
728 755
 
729 756
 	echo '
730 757
 				</dl>
Please login to merge, or discard this patch.
Themes/default/Search.template.php 1 patch
Braces   +85 added lines, -60 removed lines patch added patch discarded remove patch
@@ -25,13 +25,15 @@  discard block
 block discarded – undo
25 25
 			</h3>
26 26
 		</div>';
27 27
 
28
-	if (!empty($context['search_errors']))
29
-		echo '
28
+	if (!empty($context['search_errors'])) {
29
+			echo '
30 30
 		<div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>';
31
+	}
31 32
 
32
-	if (!empty($context['search_ignored']))
33
-		echo '
33
+	if (!empty($context['search_ignored'])) {
34
+			echo '
34 35
 		<p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
36
+	}
35 37
 
36 38
 	echo '
37 39
 		<div id="advanced_search" class="roundframe">
@@ -42,9 +44,10 @@  discard block
 block discarded – undo
42 44
 				<dd>
43 45
 					<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40">';
44 46
 
45
-	if (empty($modSettings['search_simple_fulltext']))
46
-		echo '
47
+	if (empty($modSettings['search_simple_fulltext'])) {
48
+			echo '
47 49
 					<br><em class="smalltext">', $txt['search_example'], '</em>';
50
+	}
48 51
 
49 52
 	echo '
50 53
 				</dd>
@@ -115,11 +118,12 @@  discard block
 block discarded – undo
115 118
 	}
116 119
 
117 120
 	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
118
-	if (!empty($context['search_params']['topic']))
119
-		echo '
121
+	if (!empty($context['search_params']['topic'])) {
122
+			echo '
120 123
 				<p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
121 124
 				<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
122 125
 				<input type="submit" name="b_search" value="', $txt['search'], '" class="button">';
126
+	}
123 127
 
124 128
 	echo '
125 129
 			</div>
@@ -150,14 +154,15 @@  discard block
 block discarded – undo
150 154
 
151 155
 			foreach ($category['boards'] as $board)
152 156
 			{
153
-				if ($i == $limit)
154
-					echo '
157
+				if ($i == $limit) {
158
+									echo '
155 159
 							</ul>
156 160
 						</li>
157 161
 					</ul>
158 162
 					<ul class="ignoreboards floatright">
159 163
 						<li class="category">
160 164
 							<ul>';
165
+				}
161 166
 
162 167
 				echo '
163 168
 								<li class="board">
@@ -245,13 +250,15 @@  discard block
 block discarded – undo
245 250
 		<div class="roundframe">';
246 251
 
247 252
 		// Did they make any typos or mistakes, perhaps?
248
-		if (isset($context['did_you_mean']))
249
-			echo '
253
+		if (isset($context['did_you_mean'])) {
254
+					echo '
250 255
 			<p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>';
256
+		}
251 257
 
252
-		if (!empty($context['search_ignored']))
253
-			echo '
258
+		if (!empty($context['search_ignored'])) {
259
+					echo '
254 260
 			<p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
261
+		}
255 262
 
256 263
 		echo '
257 264
 			<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
@@ -273,10 +280,11 @@  discard block
 block discarded – undo
273 280
 					<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '">
274 281
 					<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">
275 282
 				</div>';
276
-		if (!empty($context['search_params']['brd']))
277
-			foreach ($context['search_params']['brd'] as $board_id)
283
+		if (!empty($context['search_params']['brd'])) {
284
+					foreach ($context['search_params']['brd'] as $board_id)
278 285
 				echo '
279 286
 				<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
287
+		}
280 288
 
281 289
 		echo '
282 290
 			</form>
@@ -287,17 +295,19 @@  discard block
 block discarded – undo
287 295
 	if ($context['compact'])
288 296
 	{
289 297
 		// Quick moderation set to checkboxes? Oh, how fun :/.
290
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
291
-			echo '
298
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
299
+					echo '
292 300
 	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
301
+		}
293 302
 
294 303
 	echo '
295 304
 		<div class="cat_bar">
296 305
 			<h3 class="catbg">
297 306
 				<span class="floatright">';
298
-					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
299
-					echo '
307
+					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
308
+										echo '
300 309
 							<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');">';
310
+					}
301 311
 				echo '
302 312
 				</span>
303 313
 				<span class="generic_icons filter"></span>&nbsp;', $txt['mlist_search_results'], ':&nbsp;', $context['search_params']['search'], '
@@ -305,14 +315,15 @@  discard block
 block discarded – undo
305 315
 		</div>';
306 316
 
307 317
 		// was anything even found?
308
-		if (!empty($context['topics']))
309
-		echo'
318
+		if (!empty($context['topics'])) {
319
+				echo'
310 320
 		<div class="pagesection">
311 321
 			<span>', $context['page_index'], '</span>
312 322
 		</div>';
313
-		else
314
-			echo '
323
+		} else {
324
+					echo '
315 325
 			<div class="roundframe">', $txt['find_no_results'], '</div>';
326
+		}
316 327
 
317 328
 		// while we have results to show ...
318 329
 		while ($topic = $context['get_topics']())
@@ -340,38 +351,43 @@  discard block
 block discarded – undo
340 351
 					{
341 352
 						echo '
342 353
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '">';
343
-					}
344
-					else
354
+					} else
345 355
 					{
346
-						if ($topic['quick_mod']['remove'])
347
-							echo '
356
+						if ($topic['quick_mod']['remove']) {
357
+													echo '
348 358
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons delete" title="', $txt['remove_topic'], '"></span></a>';
359
+						}
349 360
 
350
-						if ($topic['quick_mod']['lock'])
351
-							echo '
361
+						if ($topic['quick_mod']['lock']) {
362
+													echo '
352 363
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>';
364
+						}
353 365
 
354
-						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
355
-							echo '
366
+						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
367
+													echo '
356 368
 						<br>';
369
+						}
357 370
 
358
-						if ($topic['quick_mod']['sticky'])
359
-							echo '
371
+						if ($topic['quick_mod']['sticky']) {
372
+													echo '
360 373
 						<a href="', $scripturl, '?action=quickmod;board=' . $topic['board']['id'] . '.0;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="generic_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>';
374
+						}
361 375
 
362
-						if ($topic['quick_mod']['move'])
363
-							echo '
376
+						if ($topic['quick_mod']['move']) {
377
+													echo '
364 378
 						<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
379
+						}
365 380
 					}
366 381
 
367 382
 					echo '
368 383
 					</div>';
369 384
 				}
370 385
 
371
-				if ($message['body_highlighted'] != '')
372
-					echo '
386
+				if ($message['body_highlighted'] != '') {
387
+									echo '
373 388
 					<br class="clear">
374 389
 					<div class="list_posts double_height">', $message['body_highlighted'], '</div>';
390
+				}
375 391
 			}
376 392
 
377 393
 			echo '
@@ -379,11 +395,12 @@  discard block
 block discarded – undo
379 395
 			</div>';
380 396
 
381 397
 		}
382
-		if (!empty($context['topics']))
383
-		echo '
398
+		if (!empty($context['topics'])) {
399
+				echo '
384 400
 		<div class="pagesection">
385 401
 			<span>', $context['page_index'], '</span>
386 402
 		</div>';
403
+		}
387 404
 
388 405
 		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
389 406
 		{
@@ -393,17 +410,19 @@  discard block
 block discarded – undo
393 410
 					<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
394 411
 						<option value="">--------</option>';
395 412
 
396
-			foreach ($context['qmod_actions'] as $qmod_action)
397
-				if ($context['can_' . $qmod_action])
413
+			foreach ($context['qmod_actions'] as $qmod_action) {
414
+							if ($context['can_' . $qmod_action])
398 415
 					echo '
399 416
 							<option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>';
417
+			}
400 418
 
401 419
 			echo '
402 420
 					</select>';
403 421
 
404
-			if ($context['can_move'])
405
-				echo '
422
+			if ($context['can_move']) {
423
+							echo '
406 424
 				<span id="quick_mod_jump_to">&nbsp;</span>';
425
+			}
407 426
 
408 427
 			echo '
409 428
 					<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '">
@@ -413,13 +432,13 @@  discard block
 block discarded – undo
413 432
 		}
414 433
 
415 434
 
416
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
417
-			echo '
435
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
436
+					echo '
418 437
 			<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
419 438
 		</form>';
439
+		}
420 440
 
421
-	}
422
-	else
441
+	} else
423 442
 	{
424 443
 		echo '
425 444
 		<div class="cat_bar">
@@ -431,9 +450,10 @@  discard block
 block discarded – undo
431 450
 			<span>', $context['page_index'], '</span>
432 451
 		</div>';
433 452
 
434
-		if (empty($context['topics']))
435
-			echo '
453
+		if (empty($context['topics'])) {
454
+					echo '
436 455
 		<div class="information">(', $txt['search_no_results'], ')</div>';
456
+		}
437 457
 
438 458
 		while ($topic = $context['get_topics']())
439 459
 		{
@@ -448,23 +468,27 @@  discard block
 block discarded – undo
448 468
 					</div>
449 469
 					<div class="list_posts">', $message['body_highlighted'], '</div>';
450 470
 
451
-			if ($topic['can_reply'])
452
-				echo '
471
+			if ($topic['can_reply']) {
472
+							echo '
453 473
 						<ul class="quickbuttons">';
474
+			}
454 475
 
455 476
 				// If they *can* reply?
456
-			if ($topic['can_reply'])
457
-				echo '
477
+			if ($topic['can_reply']) {
478
+							echo '
458 479
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
480
+			}
459 481
 
460 482
 				// If they *can* quote?
461
-			if ($topic['can_quote'])
462
-				echo '
483
+			if ($topic['can_quote']) {
484
+							echo '
463 485
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'] . ';quote=' . $message['id'] . '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
486
+			}
464 487
 
465
-			if ($topic['can_reply'])
466
-				echo '
488
+			if ($topic['can_reply']) {
489
+							echo '
467 490
 						</ul>';
491
+			}
468 492
 			echo '
469 493
 					<br class="clear">
470 494
 				</div>';
@@ -483,8 +507,8 @@  discard block
 block discarded – undo
483 507
 		<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
484 508
 		<script>';
485 509
 
486
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
487
-		echo '
510
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
511
+			echo '
488 512
 				if (typeof(window.XMLHttpRequest) != "undefined")
489 513
 					aJumpTo[aJumpTo.length] = new JumpTo({
490 514
 						sContainerId: "quick_mod_jump_to",
@@ -499,6 +523,7 @@  discard block
 block discarded – undo
499 523
 						bDisabled: true,
500 524
 						sCustomName: "move_to"
501 525
 					});';
526
+	}
502 527
 
503 528
 	echo '
504 529
 			if (typeof(window.XMLHttpRequest) != "undefined")
Please login to merge, or discard this patch.
Themes/default/Calendar.template.php 1 patch
Braces   +154 added lines, -118 removed lines patch added patch discarded remove patch
@@ -40,16 +40,14 @@  discard block
 block discarded – undo
40 40
 				', template_show_upcoming_list('main'), '
41 41
 			</div>
42 42
 		';
43
-	}
44
-	elseif ($context['calendar_view'] == 'viewweek')
43
+	} elseif ($context['calendar_view'] == 'viewweek')
45 44
 	{
46 45
 		echo '
47 46
 			<div id="main_grid">
48 47
 				', template_show_week_grid('main'), '
49 48
 			</div>
50 49
 		';
51
-	}
52
-	else
50
+	} else
53 51
 	{
54 52
 		echo '
55 53
 			<div id="main_grid">
@@ -75,8 +73,9 @@  discard block
 block discarded – undo
75 73
 	global $context, $scripturl, $txt;
76 74
 
77 75
 	// Bail out if we have nothing to work with
78
-	if (!isset($context['calendar_grid_' . $grid_name]))
79
-		return false;
76
+	if (!isset($context['calendar_grid_' . $grid_name])) {
77
+			return false;
78
+	}
80 79
 
81 80
 	// Protect programmer sanity
82 81
 	$calendar_data = &$context['calendar_grid_' . $grid_name];
@@ -113,11 +112,13 @@  discard block
 block discarded – undo
113 112
 					<li class="windowbg">
114 113
 						<b class="event_title">', $event['link'], '</b>';
115 114
 
116
-				if ($event['can_edit'])
117
-					echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
115
+				if ($event['can_edit']) {
116
+									echo ' <a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
117
+				}
118 118
 
119
-				if ($event['can_export'])
120
-					echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
119
+				if ($event['can_export']) {
120
+									echo ' <a href="' . $event['export_href'] . '"><span class="generic_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
121
+				}
121 122
 
122 123
 				echo '
123 124
 						<br>';
@@ -125,14 +126,14 @@  discard block
 block discarded – undo
125 126
 				if (!empty($event['allday']))
126 127
 				{
127 128
 					echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : '';
128
-				}
129
-				else
129
+				} else
130 130
 				{
131 131
 					// Display event info relative to user's local timezone
132 132
 					echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
133 133
 
134
-					if ($event['start_date_local'] != $event['end_date_local'])
135
-						echo trim($event['end_date_local']) . ', ';
134
+					if ($event['start_date_local'] != $event['end_date_local']) {
135
+											echo trim($event['end_date_local']) . ', ';
136
+					}
136 137
 
137 138
 					echo trim($event['end_time_local']);
138 139
 
@@ -141,23 +142,27 @@  discard block
 block discarded – undo
141 142
 					{
142 143
 						echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">';
143 144
 
144
-						if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig'])
145
-							echo trim($event['start_date_orig']), ', ';
145
+						if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig']) {
146
+													echo trim($event['start_date_orig']), ', ';
147
+						}
146 148
 
147 149
 						echo trim($event['start_time_orig']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
148 150
 
149
-						if ($event['start_date_orig'] != $event['end_date_orig'])
150
-							echo trim($event['end_date_orig']) . ', ';
151
+						if ($event['start_date_orig'] != $event['end_date_orig']) {
152
+													echo trim($event['end_date_orig']) . ', ';
153
+						}
151 154
 
152 155
 						echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)';
153 156
 					}
154 157
 					// Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion
155
-					else
156
-						echo ' ', $event['tz_abbrev'], '</time>';
158
+					else {
159
+											echo ' ', $event['tz_abbrev'], '</time>';
160
+					}
157 161
 				}
158 162
 
159
-				if (!empty($event['location']))
160
-					echo '<br>', $event['location'];
163
+				if (!empty($event['location'])) {
164
+									echo '<br>', $event['location'];
165
+				}
161 166
 
162 167
 				echo '
163 168
 					</li>';
@@ -189,8 +194,9 @@  discard block
 block discarded – undo
189 194
 
190 195
 			$birthdays = array();
191 196
 
192
-			foreach ($date as $member)
193
-				$birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>';
197
+			foreach ($date as $member) {
198
+							$birthdays[] = '<a href="' . $scripturl . '?action=profile;u=' . $member['id'] . '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>';
199
+			}
194 200
 
195 201
 			echo implode(', ', $birthdays);
196 202
 
@@ -221,8 +227,9 @@  discard block
 block discarded – undo
221 227
 			$date_local = $date['date_local'];
222 228
 			unset($date['date_local']);
223 229
 
224
-			foreach ($date as $holiday)
225
-				$holidays[] = $holiday . ' (' . $date_local . ')';
230
+			foreach ($date as $holiday) {
231
+							$holidays[] = $holiday . ' (' . $date_local . ')';
232
+			}
226 233
 		}
227 234
 
228 235
 		echo implode(', ', $holidays);
@@ -245,17 +252,19 @@  discard block
 block discarded – undo
245 252
 	global $context, $txt, $scripturl, $modSettings;
246 253
 
247 254
 	// If the grid doesn't exist, no point in proceeding.
248
-	if (!isset($context['calendar_grid_' . $grid_name]))
249
-		return false;
255
+	if (!isset($context['calendar_grid_' . $grid_name])) {
256
+			return false;
257
+	}
250 258
 
251 259
 	// A handy little pointer variable.
252 260
 	$calendar_data = &$context['calendar_grid_' . $grid_name];
253 261
 
254 262
 	// Some conditions for whether or not we should show the week links *here*.
255
-	if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false)))
256
-		$show_week_links = true;
257
-	else
258
-		$show_week_links = false;
263
+	if (isset($calendar_data['show_week_links']) && ($calendar_data['show_week_links'] == 3 || (($calendar_data['show_week_links'] == 1 && $is_mini === true) || $calendar_data['show_week_links'] == 2 && $is_mini === false))) {
264
+			$show_week_links = true;
265
+	} else {
266
+			$show_week_links = false;
267
+	}
259 268
 
260 269
 	// Assuming that we've not disabled it, show the title block!
261 270
 	if (empty($calendar_data['disable_title']))
@@ -294,8 +303,9 @@  discard block
 block discarded – undo
294 303
 	}
295 304
 
296 305
 	// Show the controls on main grids
297
-	if ($is_mini === false)
298
-		template_calendar_top($calendar_data);
306
+	if ($is_mini === false) {
307
+			template_calendar_top($calendar_data);
308
+	}
299 309
 
300 310
 	// Finally, the main calendar table.
301 311
 	echo '<table class="calendar_table">';
@@ -306,8 +316,9 @@  discard block
 block discarded – undo
306 316
 		echo '<tr>';
307 317
 
308 318
 		// If we're showing week links, there's an extra column ahead of the week links, so let's think ahead and be prepared!
309
-		if ($show_week_links === true)
310
-			echo '<th>&nbsp;</th>';
319
+		if ($show_week_links === true) {
320
+					echo '<th>&nbsp;</th>';
321
+		}
311 322
 
312 323
 		// Now, loop through each actual day of the week.
313 324
 		foreach ($calendar_data['week_days'] as $day)
@@ -354,27 +365,29 @@  discard block
 block discarded – undo
354 365
 				// Additional classes are given for events, holidays, and birthdays.
355 366
 				if (!empty($day['events']) && !empty($calendar_data['highlight']['events']))
356 367
 				{
357
-					if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3)))
358
-						$classes[] = 'events';
359
-					elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3)))
360
-						$classes[] = 'events';
368
+					if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1, 3))) {
369
+											$classes[] = 'events';
370
+					} elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2, 3))) {
371
+											$classes[] = 'events';
372
+					}
361 373
 				}
362 374
 				if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays']))
363 375
 				{
364
-					if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3)))
365
-						$classes[] = 'holidays';
366
-					elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3)))
367
-						$classes[] = 'holidays';
376
+					if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1, 3))) {
377
+											$classes[] = 'holidays';
378
+					} elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2, 3))) {
379
+											$classes[] = 'holidays';
380
+					}
368 381
 				}
369 382
 				if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays']))
370 383
 				{
371
-					if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3)))
372
-						$classes[] = 'birthdays';
373
-					elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3)))
374
-						$classes[] = 'birthdays';
384
+					if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1, 3))) {
385
+											$classes[] = 'birthdays';
386
+					} elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2, 3))) {
387
+											$classes[] = 'birthdays';
388
+					}
375 389
 				}
376
-			}
377
-			else
390
+			} else
378 391
 			{
379 392
 				// Default Classes (either compact or comfortable and disabled).
380 393
 				$classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable';
@@ -392,19 +405,21 @@  discard block
 block discarded – undo
392 405
 				$title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : '';
393 406
 
394 407
 				// The actual day number - be it a link, or just plain old text!
395
-				if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
396
-					echo '<a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>';
397
-				elseif ($is_mini)
398
-					echo '<a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>';
399
-				else
400
-					echo '<span class="day_text">', $title_prefix, $day['day'], '</span>';
408
+				if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) {
409
+									echo '<a href="', $scripturl, '?action=calendar;sa=post;year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>';
410
+				} elseif ($is_mini) {
411
+									echo '<a href="', $scripturl, '?action=calendar;', $context['calendar_view'], ';year=', $calendar_data['current_year'], ';month=', $calendar_data['current_month'], ';day=', $day['day'], '"><span class="day_text">', $title_prefix, $day['day'], '</span></a>';
412
+				} else {
413
+									echo '<span class="day_text">', $title_prefix, $day['day'], '</span>';
414
+				}
401 415
 
402 416
 				// A lot of stuff, we're not showing on mini-calendars to conserve space.
403 417
 				if ($is_mini === false)
404 418
 				{
405 419
 					// Holidays are always fun, let's show them!
406
-					if (!empty($day['holidays']))
407
-						echo '<div class="smalltext holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), '</div>';
420
+					if (!empty($day['holidays'])) {
421
+											echo '<div class="smalltext holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $day['holidays']), '</div>';
422
+					}
408 423
 
409 424
 					// Happy Birthday Dear, Member!
410 425
 					if (!empty($day['birthdays']))
@@ -422,14 +437,16 @@  discard block
 block discarded – undo
422 437
 							echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"><span class="fix_rtl_names">', $member['name'], '</span>', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', ';
423 438
 
424 439
 							// 9...10! Let's stop there.
425
-							if ($birthday_count == 10 && $use_js_hide)
426
-								// !!TODO - Inline CSS and JavaScript should be moved.
440
+							if ($birthday_count == 10 && $use_js_hide) {
441
+															// !!TODO - Inline CSS and JavaScript should be moved.
427 442
 								echo '<span class="hidelink" id="bdhidelink_', $day['day'], '">...<br><a href="', $scripturl, '?action=calendar;month=', $calendar_data['current_month'], ';year=', $calendar_data['current_year'], ';showbd" onclick="document.getElementById(\'bdhide_', $day['day'], '\').style.display = \'\'; document.getElementById(\'bdhidelink_', $day['day'], '\').style.display = \'none\'; return false;">(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')</a></span><span id="bdhide_', $day['day'], '" style="display: none;">, ';
443
+							}
428 444
 
429 445
 							++$birthday_count;
430 446
 						}
431
-						if ($use_js_hide)
432
-							echo '</span>';
447
+						if ($use_js_hide) {
448
+													echo '</span>';
449
+						}
433 450
 
434 451
 						echo '</div>';
435 452
 					}
@@ -439,8 +456,9 @@  discard block
 block discarded – undo
439 456
 					{
440 457
 						// Sort events by start time (all day events will be listed first)
441 458
 						uasort($day['events'], function($a, $b) {
442
-						    if ($a['start_timestamp'] == $b['start_timestamp'])
443
-						        return 0;
459
+						    if ($a['start_timestamp'] == $b['start_timestamp']) {
460
+						    						        return 0;
461
+						    }
444 462
 						    return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
445 463
 						});
446 464
 
@@ -456,17 +474,19 @@  discard block
 block discarded – undo
456 474
 
457 475
 							echo '<div class="event_wrapper', $event['starts_today'] == true ? ' event_starts_today' : '', $event['ends_today'] == true ? ' event_ends_today' : '', $event['allday'] == true ? ' allday' : '', $event['is_selected'] ? ' sel_event' : '', '">', $event['link'], '<br><span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">';
458 476
 
459
-							if (!empty($event['start_time_local']) && $event['starts_today'] == true)
460
-								echo trim(str_replace(':00 ', ' ', $event['start_time_local']));
461
-							elseif (!empty($event['end_time_local']) && $event['ends_today'] == true)
462
-								echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local']));
463
-							elseif (!empty($event['allday']))
464
-								echo $txt['calendar_allday'];
477
+							if (!empty($event['start_time_local']) && $event['starts_today'] == true) {
478
+															echo trim(str_replace(':00 ', ' ', $event['start_time_local']));
479
+							} elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) {
480
+															echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local']));
481
+							} elseif (!empty($event['allday'])) {
482
+															echo $txt['calendar_allday'];
483
+							}
465 484
 
466 485
 							echo '</span>';
467 486
 
468
-							if (!empty($event['location']))
469
-								echo '<br><span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>';
487
+							if (!empty($event['location'])) {
488
+															echo '<br><span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>';
489
+							}
470 490
 
471 491
 							if ($event['can_edit'] || $event['can_export'])
472 492
 							{
@@ -503,10 +523,11 @@  discard block
 block discarded – undo
503 523
 			// Otherwise, assuming it's not a mini-calendar, we can show previous / next month days!
504 524
 			elseif ($is_mini === false)
505 525
 			{
506
-				if (empty($current_month_started) && !empty($context['calendar_grid_prev']))
507
-					echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>';
508
-				elseif (!empty($current_month_started) && !empty($context['calendar_grid_next']))
509
-					echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>';
526
+				if (empty($current_month_started) && !empty($context['calendar_grid_prev'])) {
527
+									echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '</a>';
528
+				} elseif (!empty($current_month_started) && !empty($context['calendar_grid_next'])) {
529
+									echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>';
530
+				}
510 531
 			}
511 532
 
512 533
 			// Close this day and increase var count.
@@ -532,8 +553,9 @@  discard block
 block discarded – undo
532 553
 	global $context, $txt, $scripturl, $modSettings;
533 554
 
534 555
 	// We might have no reason to proceed, if the variable isn't there.
535
-	if (!isset($context['calendar_grid_' . $grid_name]))
536
-		return false;
556
+	if (!isset($context['calendar_grid_' . $grid_name])) {
557
+			return false;
558
+	}
537 559
 
538 560
 	// Handy pointer.
539 561
 	$calendar_data = &$context['calendar_grid_' . $grid_name];
@@ -568,8 +590,9 @@  discard block
 block discarded – undo
568 590
 					}
569 591
 
570 592
 					// The Month Title + Week Number...
571
-					if (!empty($calendar_data['week_title']))
572
-							echo $calendar_data['week_title'];
593
+					if (!empty($calendar_data['week_title'])) {
594
+												echo $calendar_data['week_title'];
595
+					}
573 596
 
574 597
 					echo '
575 598
 					</h3>
@@ -608,10 +631,11 @@  discard block
 block discarded – undo
608 631
 						<tr class="days_wrapper">
609 632
 							<td class="', implode(' ', $classes), ' act_day">';
610 633
 							// Should the day number be a link?
611
-							if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
612
-								echo '<a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>';
613
-							else
614
-								echo $txt['days'][$day['day_of_week']], ' - ', $day['day'];
634
+							if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) {
635
+															echo '<a href="', $scripturl, '?action=calendar;sa=post;month=', $month_data['current_month'], ';year=', $month_data['current_year'], ';day=', $day['day'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['days'][$day['day_of_week']], ' - ', $day['day'], '</a>';
636
+							} else {
637
+															echo $txt['days'][$day['day_of_week']], ' - ', $day['day'];
638
+							}
615 639
 
616 640
 							echo '</td>
617 641
 							<td class="', implode(' ', $classes), '', empty($day['events']) ? (' disabled' . ($context['can_post'] ? ' week_post' : '')) : ' events', ' event_col" data-css-prefix="' . $txt['events'] . ' ', (empty($day['events']) && empty($context['can_post'])) ? $txt['none'] : '', '">';
@@ -620,8 +644,9 @@  discard block
 block discarded – undo
620 644
 							{
621 645
 								// Sort events by start time (all day events will be listed first)
622 646
 								uasort($day['events'], function($a, $b) {
623
-								    if ($a['start_timestamp'] == $b['start_timestamp'])
624
-								        return 0;
647
+								    if ($a['start_timestamp'] == $b['start_timestamp']) {
648
+								    								        return 0;
649
+								    }
625 650
 								    return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
626 651
 								});
627 652
 
@@ -633,15 +658,17 @@  discard block
 block discarded – undo
633 658
 
634 659
 									echo $event['link'], '<br><span class="event_time', empty($event_icons_needed) ? ' floatright' : '', '">';
635 660
 
636
-									if (!empty($event['start_time_local']))
637
-										echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' &ndash; ' . trim($event['end_time_local']) : '';
638
-									else
639
-										echo $txt['calendar_allday'];
661
+									if (!empty($event['start_time_local'])) {
662
+																			echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' &ndash; ' . trim($event['end_time_local']) : '';
663
+									} else {
664
+																			echo $txt['calendar_allday'];
665
+									}
640 666
 
641 667
 									echo '</span>';
642 668
 
643
-									if (!empty($event['location']))
644
-										echo '<br><span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>';
669
+									if (!empty($event['location'])) {
670
+																			echo '<br><span class="event_location', empty($event_icons_needed) ? ' floatright' : '', '">' . $event['location'] . '</span>';
671
+									}
645 672
 
646 673
 									if (!empty($event_icons_needed))
647 674
 									{
@@ -678,8 +705,7 @@  discard block
 block discarded – undo
678 705
 									</div>
679 706
 									<br class="clear">';
680 707
 								}
681
-							}
682
-							else
708
+							} else
683 709
 							{
684 710
 								if (!empty($context['can_post']))
685 711
 								{
@@ -692,8 +718,9 @@  discard block
 block discarded – undo
692 718
 							echo '</td>
693 719
 							<td class="', implode(' ', $classes), !empty($day['holidays']) ? ' holidays' : ' disabled', ' holiday_col" data-css-prefix="' . $txt['calendar_prompt'] . ' ">';
694 720
 							// Show any holidays!
695
-							if (!empty($day['holidays']))
696
-								echo implode('<br>', $day['holidays']);
721
+							if (!empty($day['holidays'])) {
722
+															echo implode('<br>', $day['holidays']);
723
+							}
697 724
 
698 725
 							echo '</td>
699 726
 							<td class="', implode(' ', $classes), '', !empty($day['birthdays']) ? ' birthdays' : ' disabled', ' birthday_col" data-css-prefix="' . $txt['birthdays'] . ' ">';
@@ -751,8 +778,7 @@  discard block
 block discarded – undo
751 778
 				<input type="text" name="end_date" id="end_date" maxlength="10" value="', $calendar_data['end_date'], '" tabindex="', $context['tabindex']++, '" class="date_input end" data-type="date">
752 779
 				<input type="submit" class="button" style="float:none" id="view_button" value="', $txt['view'], '">
753 780
 			</form>';
754
-	}
755
-	else
781
+	} else
756 782
 	{
757 783
 		echo'
758 784
 			<form action="', $scripturl, '?action=calendar" id="calendar_navigation" method="post" accept-charset="', $context['character_set'], '">
@@ -794,8 +820,9 @@  discard block
 block discarded – undo
794 820
 	echo '
795 821
 		<form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);smc_saveEntities(\'postevent\', [\'evtitle\']);" style="margin: 0;">';
796 822
 
797
-	if (!empty($context['event']['new']))
798
-		echo '<input type="hidden" name="eventid" value="', $context['event']['eventid'], '">';
823
+	if (!empty($context['event']['new'])) {
824
+			echo '<input type="hidden" name="eventid" value="', $context['event']['eventid'], '">';
825
+	}
799 826
 
800 827
 	// Start the main table.
801 828
 	echo '
@@ -845,9 +872,10 @@  discard block
 block discarded – undo
845 872
 		{
846 873
 			echo '
847 874
 								<optgroup label="', $category['name'], '">';
848
-			foreach ($category['boards'] as $board)
849
-				echo '
875
+			foreach ($category['boards'] as $board) {
876
+							echo '
850 877
 									<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
878
+			}
851 879
 			echo '
852 880
 								</optgroup>';
853 881
 		}
@@ -883,9 +911,10 @@  discard block
 block discarded – undo
883 911
 							<span class="label">', $txt['calendar_timezone'], '</span>
884 912
 							<select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>';
885 913
 
886
-	foreach ($context['all_timezones'] as $tz => $tzname)
887
-		echo '
914
+	foreach ($context['all_timezones'] as $tz => $tzname) {
915
+			echo '
888 916
 								<option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>';
917
+	}
889 918
 
890 919
 	echo '
891 920
 							</select>
@@ -900,9 +929,10 @@  discard block
 block discarded – undo
900 929
 	echo '
901 930
 				<input type="submit" value="', empty($context['event']['new']) ? $txt['save'] : $txt['post'], '" class="button">';
902 931
 	// Delete button?
903
-	if (empty($context['event']['new']))
904
-		echo '
932
+	if (empty($context['event']['new'])) {
933
+			echo '
905 934
 				<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['calendar_confirm_delete'], '" class="button you_sure">';
935
+	}
906 936
 
907 937
 	echo '
908 938
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -946,9 +976,10 @@  discard block
 block discarded – undo
946 976
 
947 977
 		foreach ($context['clockicons'] as $t => $v)
948 978
 		{
949
-			foreach ($v as $i)
950
-				echo '
979
+			foreach ($v as $i) {
980
+							echo '
951 981
 			icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
982
+			}
952 983
 		}
953 984
 
954 985
 		echo '
@@ -973,13 +1004,14 @@  discard block
 block discarded – undo
973 1004
 
974 1005
 		foreach ($context['clockicons'] as $t => $v)
975 1006
 		{
976
-			foreach ($v as $i)
977
-				echo '
1007
+			foreach ($v as $i) {
1008
+							echo '
978 1009
 			if (', $t, ' >= ', $i, ')
979 1010
 			{
980 1011
 				turnon.push("', $t, '_', $i, '");
981 1012
 				', $t, ' -= ', $i, ';
982 1013
 			}';
1014
+			}
983 1015
 		}
984 1016
 
985 1017
 		echo '
@@ -1043,9 +1075,10 @@  discard block
 block discarded – undo
1043 1075
 
1044 1076
 	foreach ($context['clockicons'] as $t => $v)
1045 1077
 	{
1046
-		foreach ($v as $i)
1047
-			echo '
1078
+		foreach ($v as $i) {
1079
+					echo '
1048 1080
 		icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
1081
+		}
1049 1082
 	}
1050 1083
 
1051 1084
 	echo '
@@ -1062,13 +1095,14 @@  discard block
 block discarded – undo
1062 1095
 
1063 1096
 	foreach ($context['clockicons'] as $t => $v)
1064 1097
 	{
1065
-		foreach ($v as $i)
1066
-			echo '
1098
+		foreach ($v as $i) {
1099
+					echo '
1067 1100
 		if (', $t, ' >= ', $i, ')
1068 1101
 		{
1069 1102
 			turnon.push("', $t, '_', $i, '");
1070 1103
 			', $t, ' -= ', $i, ';
1071 1104
 		}';
1105
+		}
1072 1106
 	}
1073 1107
 
1074 1108
 	echo '
@@ -1127,9 +1161,10 @@  discard block
 block discarded – undo
1127 1161
 
1128 1162
 	foreach ($context['clockicons'] as $t => $v)
1129 1163
 	{
1130
-		foreach ($v as $i)
1131
-			echo '
1164
+		foreach ($v as $i) {
1165
+					echo '
1132 1166
 		icons[\'', $t, '_', $i, '\'] = document.getElementById(\'', $t, '_', $i, '\');';
1167
+		}
1133 1168
 	}
1134 1169
 
1135 1170
 	echo '
@@ -1150,13 +1185,14 @@  discard block
 block discarded – undo
1150 1185
 
1151 1186
 	foreach ($context['clockicons'] as $t => $v)
1152 1187
 	{
1153
-		foreach ($v as $i)
1154
-		echo '
1188
+		foreach ($v as $i) {
1189
+				echo '
1155 1190
 		if (', $t, ' >= ', $i, ')
1156 1191
 		{
1157 1192
 			turnon.push("', $t, '_', $i, '");
1158 1193
 			', $t, ' -= ', $i, ';
1159 1194
 		}';
1195
+		}
1160 1196
 	}
1161 1197
 
1162 1198
 	echo '
Please login to merge, or discard this patch.
Themes/default/ManageSmileys.template.php 1 patch
Braces   +55 added lines, -41 removed lines patch added patch discarded remove patch
@@ -63,18 +63,19 @@  discard block
 block discarded – undo
63 63
 					</dt>
64 64
 					<dd>
65 65
 						', $modSettings['smileys_url'], '/';
66
-		if ($context['current_set']['id'] == 'default')
67
-			echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
68
-		elseif (empty($context['smiley_set_dirs']))
69
-			echo '
66
+		if ($context['current_set']['id'] == 'default') {
67
+					echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">';
68
+		} elseif (empty($context['smiley_set_dirs'])) {
69
+					echo '
70 70
 						<input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> ';
71
-		else
71
+		} else
72 72
 		{
73 73
 			echo '
74 74
 						<select name="smiley_sets_path" id="smiley_sets_path">';
75
-			foreach ($context['smiley_set_dirs'] as $smiley_set_dir)
76
-				echo '
75
+			foreach ($context['smiley_set_dirs'] as $smiley_set_dir) {
76
+							echo '
77 77
 							<option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>';
78
+			}
78 79
 			echo '
79 80
 						</select> ';
80 81
 		}
@@ -89,14 +90,15 @@  discard block
 block discarded – undo
89 90
 					</dd>';
90 91
 
91 92
 		// If this is a new smiley set they have the option to import smileys already in the directory.
92
-		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable']))
93
-			echo '
93
+		if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) {
94
+					echo '
94 95
 					<dt>
95 96
 						<strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong>
96 97
 					</dt>
97 98
 					<dd>
98 99
 						<input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1">
99 100
 					</dd>';
101
+		}
100 102
 
101 103
 		echo '
102 104
 				</dl>
@@ -130,9 +132,10 @@  discard block
 block discarded – undo
130 132
 					<dd>
131 133
 						<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">';
132 134
 
133
-		foreach ($context['smiley_sets'] as $smiley_set)
134
-			echo '
135
+		foreach ($context['smiley_sets'] as $smiley_set) {
136
+					echo '
135 137
 						<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
138
+		}
136 139
 
137 140
 		echo '
138 141
 						</select>)
@@ -147,16 +150,17 @@  discard block
 block discarded – undo
147 150
 						<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
148 151
 					</dt>
149 152
 					<dd>';
150
-			if (empty($context['filenames']))
151
-				echo '
153
+			if (empty($context['filenames'])) {
154
+							echo '
152 155
 						<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">';
153
-			else
156
+			} else
154 157
 			{
155 158
 				echo '
156 159
 						<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">';
157
-				foreach ($context['filenames'] as $filename)
158
-					echo '
160
+				foreach ($context['filenames'] as $filename) {
161
+									echo '
159 162
 							<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
163
+				}
160 164
 				echo '
161 165
 						</select>';
162 166
 			}
@@ -225,9 +229,10 @@  discard block
 block discarded – undo
225 229
 						<dd>
226 230
 							', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">';
227 231
 
228
-		foreach ($context['smiley_sets'] as $smiley_set)
229
-			echo '
232
+		foreach ($context['smiley_sets'] as $smiley_set) {
233
+					echo '
230 234
 							<option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>';
235
+		}
231 236
 
232 237
 		echo '
233 238
 							</select>
@@ -236,16 +241,17 @@  discard block
 block discarded – undo
236 241
 							<strong><label for="smiley_filename">', $txt['smileys_filename'], '</label>: </strong>
237 242
 						</dt>
238 243
 						<dd>';
239
-	if (empty($context['filenames']))
240
-		echo '
244
+	if (empty($context['filenames'])) {
245
+			echo '
241 246
 							<input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">';
242
-	else
247
+	} else
243 248
 	{
244 249
 		echo '
245 250
 								<select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">';
246
-		foreach ($context['filenames'] as $filename)
247
-			echo '
251
+		foreach ($context['filenames'] as $filename) {
252
+					echo '
248 253
 								<option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>';
254
+		}
249 255
 		echo '
250 256
 							</select>';
251 257
 	}
@@ -273,14 +279,15 @@  discard block
 block discarded – undo
273 279
 				</fieldset>
274 280
 
275 281
 				<dl id="uploadMore" style="display: none;" class="settings">';
276
-	foreach ($context['smiley_sets'] as $smiley_set)
277
-		echo '
282
+	foreach ($context['smiley_sets'] as $smiley_set) {
283
+			echo '
278 284
 					<dt>
279 285
 						', $txt['smileys_add_upload_for1'], ' <strong>', $smiley_set['name'], '</strong> ', $txt['smileys_add_upload_for2'], ':
280 286
 					</dt>
281 287
 					<dd>
282 288
 						<input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');">
283 289
 					</dd>';
290
+	}
284 291
 	echo '
285 292
 				</dl>
286 293
 			</div>
@@ -349,24 +356,27 @@  discard block
 block discarded – undo
349 356
 				<strong>', empty($context['move_smiley']) ? $txt['smileys_move_select_smiley'] : $txt['smileys_move_select_destination'], '...</strong><br>';
350 357
 		foreach ($location['rows'] as $row)
351 358
 		{
352
-			if (!empty($context['move_smiley']))
353
-				echo '
359
+			if (!empty($context['move_smiley'])) {
360
+							echo '
354 361
 					<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
362
+			}
355 363
 
356 364
 			foreach ($row as $smiley)
357 365
 			{
358
-				if (empty($context['move_smiley']))
359
-					echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>';
360
-				else
361
-					echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
366
+				if (empty($context['move_smiley'])) {
367
+									echo '<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px; border: 0px solid black;" alt="', $smiley['description'], '"></a>';
368
+				} else {
369
+									echo '<img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" style="padding: 2px;', $smiley['selected'] ? ' border: 2px solid red' : '', ';" alt="', $smiley['description'], '"><a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
370
+				}
362 371
 			}
363 372
 
364 373
 			echo '
365 374
 				<br>';
366 375
 		}
367
-		if (!empty($context['move_smiley']))
368
-			echo '
376
+		if (!empty($context['move_smiley'])) {
377
+					echo '
369 378
 				<a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>';
379
+		}
370 380
 		echo '
371 381
 			</div>
372 382
 		<input type="hidden" name="reorder" value="1">
@@ -402,14 +412,15 @@  discard block
 block discarded – undo
402 412
 			</div>
403 413
 			<div class="windowbg2">
404 414
 				<dl class="settings">';
405
-	if (!$context['new_icon'])
406
-		echo '
415
+	if (!$context['new_icon']) {
416
+			echo '
407 417
 					<dt>
408 418
 						<strong>', $txt['smiley_preview'], ': </strong>
409 419
 					</dt>
410 420
 					<dd>
411 421
 						<img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '">
412 422
 					</dd>';
423
+	}
413 424
 	echo '
414 425
 					<dt>
415 426
 						<strong><label for="icon_filename">', $txt['smileys_filename'], '</label>: </strong><br><span class="smalltext">', $txt['icons_filename_all_png'], '</span>
@@ -434,9 +445,10 @@  discard block
 block discarded – undo
434 445
 	{
435 446
 		echo '
436 447
 							<optgroup label="', $category['name'], '">';
437
-		foreach ($category['boards'] as $board)
438
-			echo '
448
+		foreach ($category['boards'] as $board) {
449
+					echo '
439 450
 								<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
451
+		}
440 452
 		echo '
441 453
 							</optgroup>';
442 454
 	}
@@ -451,19 +463,21 @@  discard block
 block discarded – undo
451 463
 							<option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>';
452 464
 
453 465
 	// Print the list of all the icons it can be put after...
454
-	foreach ($context['icons'] as $id => $data)
455
-		if (empty($context['icon']['id']) || $id != $context['icon']['id'])
466
+	foreach ($context['icons'] as $id => $data) {
467
+			if (empty($context['icon']['id']) || $id != $context['icon']['id'])
456 468
 			echo '
457 469
 							<option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>';
470
+	}
458 471
 
459 472
 	echo '
460 473
 						</select>
461 474
 					</dd>
462 475
 				</dl>';
463 476
 
464
-	if (!$context['new_icon'])
465
-		echo '
477
+	if (!$context['new_icon']) {
478
+			echo '
466 479
 				<input type="hidden" name="icon" value="', $context['icon']['id'], '">';
480
+	}
467 481
 
468 482
 	echo '
469 483
 				<input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/Register.template.php 1 patch
Braces   +72 added lines, -52 removed lines patch added patch discarded remove patch
@@ -28,13 +28,14 @@  discard block
 block discarded – undo
28 28
 			<div id="confirm_buttons">';
29 29
 
30 30
 	// Age restriction in effect?
31
-	if ($context['show_coppa'])
32
-		echo '
31
+	if ($context['show_coppa']) {
32
+			echo '
33 33
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br><br>
34 34
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
35
-	else
36
-		echo '
35
+	} else {
36
+			echo '
37 37
 				<input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button">';
38
+	}
38 39
 
39 40
 	echo '
40 41
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -77,9 +78,10 @@  discard block
 block discarded – undo
77 78
 			<ul>';
78 79
 
79 80
 		// Cycle through each error and display an error message.
80
-		foreach ($context['registration_errors'] as $error)
81
-			echo '
81
+		foreach ($context['registration_errors'] as $error) {
82
+					echo '
82 83
 				<li>', $error, '</li>';
84
+		}
83 85
 
84 86
 		echo '
85 87
 			</ul>
@@ -143,14 +145,15 @@  discard block
 block discarded – undo
143 145
 
144 146
 					<dl class="register_form">';
145 147
 
146
-		foreach ($context['custom_fields'] as $field)
147
-			if ($field['show_reg'] > 1)
148
+		foreach ($context['custom_fields'] as $field) {
149
+					if ($field['show_reg'] > 1)
148 150
 				echo '
149 151
 						<dt>
150 152
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
151 153
 							<span class="smalltext">', $field['desc'], '</span>
152 154
 						</dt>
153 155
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
156
+		}
154 157
 
155 158
 		echo '
156 159
 					</dl>';
@@ -184,41 +187,45 @@  discard block
 block discarded – undo
184 187
 					$callback_func = 'template_profile_' . $field['callback_func'];
185 188
 					$callback_func();
186 189
 				}
187
-			}
188
-			else
190
+			} else
189 191
 			{
190 192
 					echo '
191 193
 						<dt>
192 194
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>';
193 195
 
194 196
 				// Does it have any subtext to show?
195
-				if (!empty($field['subtext']))
196
-					echo '
197
+				if (!empty($field['subtext'])) {
198
+									echo '
197 199
 							<span class="smalltext">', $field['subtext'], '</span>';
200
+				}
198 201
 
199 202
 				echo '
200 203
 						</dt>
201 204
 						<dd>';
202 205
 
203 206
 				// Want to put something infront of the box?
204
-				if (!empty($field['preinput']))
205
-					echo '
207
+				if (!empty($field['preinput'])) {
208
+									echo '
206 209
 							', $field['preinput'];
210
+				}
207 211
 
208 212
 				// What type of data are we showing?
209
-				if ($field['type'] == 'label')
210
-					echo '
213
+				if ($field['type'] == 'label') {
214
+									echo '
211 215
 							', $field['value'];
216
+				}
212 217
 
213 218
 				// Maybe it's a text box - very likely!
214
-				elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
215
-					echo '
219
+				elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) {
220
+									echo '
216 221
 							<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
222
+				}
217 223
 
218 224
 				// You "checking" me out? ;)
219
-				elseif ($field['type'] == 'check')
220
-					echo '
225
+				elseif ($field['type'] == 'check') {
226
+									echo '
221 227
 							<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>';
228
+				}
222 229
 
223 230
 				// Always fun - select boxes!
224 231
 				elseif ($field['type'] == 'select')
@@ -229,13 +236,15 @@  discard block
 block discarded – undo
229 236
 					if (isset($field['options']))
230 237
 					{
231 238
 						// Is this some code to generate the options?
232
-						if (!is_array($field['options']))
233
-							$field['options'] = eval($field['options']);
239
+						if (!is_array($field['options'])) {
240
+													$field['options'] = eval($field['options']);
241
+						}
234 242
 						// Assuming we now have some!
235
-						if (is_array($field['options']))
236
-							foreach ($field['options'] as $value => $name)
243
+						if (is_array($field['options'])) {
244
+													foreach ($field['options'] as $value => $name)
237 245
 								echo '
238 246
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
247
+						}
239 248
 					}
240 249
 
241 250
 					echo '
@@ -243,9 +252,10 @@  discard block
 block discarded – undo
243 252
 				}
244 253
 
245 254
 				// Something to end with?
246
-				if (!empty($field['postinput']))
247
-					echo '
255
+				if (!empty($field['postinput'])) {
256
+									echo '
248 257
 							', $field['postinput'];
258
+				}
249 259
 
250 260
 				echo '
251 261
 						</dd>';
@@ -258,13 +268,14 @@  discard block
 block discarded – undo
258 268
 	{
259 269
 		foreach ($context['custom_fields'] as $field)
260 270
 		{
261
-			if ($field['show_reg'] < 2)
262
-				echo '
271
+			if ($field['show_reg'] < 2) {
272
+							echo '
263 273
 						<dt>
264 274
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
265 275
 							<span class="smalltext">', $field['desc'], '</span>
266 276
 						</dt>
267 277
 						<dd>', $field['input_html'], '</dd>';
278
+			}
268 279
 		}
269 280
 	}
270 281
 
@@ -294,13 +305,14 @@  discard block
 block discarded – undo
294 305
 			<div id="confirm_buttons" class="flow_auto">';
295 306
 
296 307
 	// Age restriction in effect?
297
-	if (!$context['require_agreement'] && $context['show_coppa'])
298
-		echo '
308
+	if (!$context['require_agreement'] && $context['show_coppa']) {
309
+			echo '
299 310
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button"><br><br>
300 311
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button">';
301
-	else
302
-		echo '
312
+	} else {
313
+			echo '
303 314
 				<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button">';
315
+	}
304 316
 	echo '
305 317
 			</div>
306 318
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -445,19 +457,20 @@  discard block
 block discarded – undo
445 457
 	</head>
446 458
 	<body style="margin: 1ex;">
447 459
 		<div class="windowbg description" style="text-align: center;">';
448
-	if (isBrowser('is_ie') || isBrowser('is_ie11'))
449
-		echo '
460
+	if (isBrowser('is_ie') || isBrowser('is_ie11')) {
461
+			echo '
450 462
 			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
451 463
 				<param name="AutoStart" value="1">
452 464
 				<param name="FileName" value="', $context['verification_sound_href'], '">
453 465
 			</object>';
454
-	else
455
-		echo '
466
+	} else {
467
+			echo '
456 468
 			<audio src="', $context['verification_sound_href'], '" controls>
457 469
 				<object type="audio/x-wav" data="', $context['verification_sound_href'], '">
458 470
 					<a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
459 471
 				</object>
460 472
 			</audio>';
473
+	}
461 474
 	echo '
462 475
 		<br>
463 476
 		<a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br>
@@ -484,11 +497,12 @@  discard block
 block discarded – undo
484 497
 				</div>
485 498
 				<div id="register_screen" class="windowbg2 noup">';
486 499
 
487
-	if (!empty($context['registration_done']))
488
-		echo '
500
+	if (!empty($context['registration_done'])) {
501
+			echo '
489 502
 					<div class="infobox">
490 503
 						', $context['registration_done'], '
491 504
 					</div>';
505
+	}
492 506
 
493 507
 	echo '
494 508
 					<dl class="register_form" id="admin_register_form">
@@ -524,9 +538,10 @@  discard block
 block discarded – undo
524 538
 						<dd>
525 539
 							<select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
526 540
 
527
-		foreach ($context['member_groups'] as $id => $name)
528
-			echo '
541
+		foreach ($context['member_groups'] as $id => $name) {
542
+					echo '
529 543
 								<option value="', $id, '">', $name, '</option>';
544
+		}
530 545
 
531 546
 		echo '
532 547
 							</select>
@@ -534,8 +549,8 @@  discard block
 block discarded – undo
534 549
 	}
535 550
 
536 551
 	// If there is any field marked as required, show it here!
537
-	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
538
-		foreach ($context['custom_fields'] as $field)
552
+	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) {
553
+			foreach ($context['custom_fields'] as $field)
539 554
 			if ($field['show_reg'] > 1)
540 555
 				echo '
541 556
 						<dt>
@@ -543,6 +558,7 @@  discard block
 block discarded – undo
543 558
 							<span class="smalltext">', $field['desc'], '</span>
544 559
 						</dt>
545 560
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
561
+	}
546 562
 
547 563
 	echo '
548 564
 						<dt>
@@ -579,12 +595,13 @@  discard block
 block discarded – undo
579 595
 {
580 596
 	global $context, $scripturl, $txt;
581 597
 
582
-	if (!empty($context['saved_successful']))
583
-		echo '
598
+	if (!empty($context['saved_successful'])) {
599
+			echo '
584 600
 					<div class="infobox">', $txt['settings_saved'], '</div>';
585
-	elseif (!empty($context['could_not_save']))
586
-		echo '
601
+	} elseif (!empty($context['could_not_save'])) {
602
+			echo '
587 603
 					<div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
604
+	}
588 605
 
589 606
 	// Just a big box to edit the text file ;).
590 607
 	echo '
@@ -594,9 +611,10 @@  discard block
 block discarded – undo
594 611
 			</div>';
595 612
 
596 613
 	// Warning for if the file isn't writable.
597
-	if (!empty($context['warning']))
598
-		echo '
614
+	if (!empty($context['warning'])) {
615
+			echo '
599 616
 			<p class="error">', $context['warning'], '</p>';
617
+	}
600 618
 
601 619
 	echo '
602 620
 			<div class="windowbg2 noup" id="registration_agreement">';
@@ -613,9 +631,10 @@  discard block
 block discarded – undo
613 631
 						<strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
614 632
 						<select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
615 633
 
616
-		foreach ($context['editable_agreements'] as $file => $name)
617
-			echo '
634
+		foreach ($context['editable_agreements'] as $file => $name) {
635
+					echo '
618 636
 							<option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
637
+		}
619 638
 
620 639
 		echo '
621 640
 						</select>
@@ -655,9 +674,10 @@  discard block
 block discarded – undo
655 674
 {
656 675
 	global $context, $scripturl, $txt;
657 676
 
658
-	if (!empty($context['saved_successful']))
659
-		echo '
677
+	if (!empty($context['saved_successful'])) {
678
+			echo '
660 679
 	<div class="infobox">', $txt['settings_saved'], '</div>';
680
+	}
661 681
 
662 682
 	echo '
663 683
 		<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
Please login to merge, or discard this patch.
Themes/default/Memberlist.template.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['members_list'], '</span>';
29
-		if (!isset($context['old_search']))
30
-				echo '
29
+		if (!isset($context['old_search'])) {
30
+						echo '
31 31
 				<span class="floatright">', $context['letter_links'], '</span>';
32
+		}
32 33
 		echo '
33 34
 			</h3>
34 35
 		</div>';
@@ -43,19 +44,22 @@  discard block
 block discarded – undo
43 44
 	foreach ($context['columns'] as $key => $column)
44 45
 	{
45 46
 		// @TODO maybe find something nicer?
46
-		if ($key == 'email_address' && !$context['can_send_email'])
47
-			continue;
47
+		if ($key == 'email_address' && !$context['can_send_email']) {
48
+					continue;
49
+		}
48 50
 
49 51
 		// This is a selected column, so underline it or some such.
50
-		if ($column['selected'])
51
-			echo '
52
+		if ($column['selected']) {
53
+					echo '
52 54
 					<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', ' selected" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . '>
53 55
 						<a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . '</a><span class="generic_icons sort_' . $context['sort_direction'] . '"></span></th>';
56
+		}
54 57
 		// This is just some column... show the link and be done with it.
55
-		else
56
-			echo '
58
+		else {
59
+					echo '
57 60
 					<th scope="col" class="', $key, isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' style="width: ' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
58 61
 						', $column['link'], '</th>';
62
+		}
59 63
 	}
60 64
 	echo '
61 65
 				</tr>
@@ -74,9 +78,10 @@  discard block
 block discarded – undo
74 78
 					</td>
75 79
 					<td class="lefttext">', $member['link'], '</td>';
76 80
 
77
-		if (!isset($context['disabled_fields']['website']))
78
-			echo '
81
+		if (!isset($context['disabled_fields']['website'])) {
82
+					echo '
79 83
 					<td class="centertext website_url">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><span class="generic_icons www" title="' . $member['website']['title'] . '"></span></a>' : '', '</td>';
84
+		}
80 85
 
81 86
 		// Group and date.
82 87
 		echo '
@@ -89,11 +94,12 @@  discard block
 block discarded – undo
89 94
 					<td class="centertext" style="white-space: nowrap; width: 15px">', $member['posts'], '</td>
90 95
 					<td class="centertext statsbar" style="width: 120px">';
91 96
 
92
-			if (!empty($member['post_percent']))
93
-				echo '
97
+			if (!empty($member['post_percent'])) {
98
+							echo '
94 99
 						<div class="bar" style="width: ', $member['post_percent'] + 4, 'px;">
95 100
 							<div style="width: ', $member['post_percent'], 'px;"></div>
96 101
 						</div>';
102
+			}
97 103
 
98 104
 			echo '
99 105
 					</td>';
@@ -102,9 +108,10 @@  discard block
 block discarded – undo
102 108
 		// Show custom fields marked to be shown here
103 109
 		if (!empty($context['custom_profile_fields']['columns']))
104 110
 		{
105
-			foreach ($context['custom_profile_fields']['columns'] as $key => $column)
106
-				echo '
111
+			foreach ($context['custom_profile_fields']['columns'] as $key => $column) {
112
+							echo '
107 113
 					<td class="righttext">', $member['options'][$key], '</td>';
114
+			}
108 115
 		}
109 116
 
110 117
 		echo '
@@ -112,11 +119,12 @@  discard block
 block discarded – undo
112 119
 		}
113 120
 	}
114 121
 	// No members?
115
-	else
116
-		echo '
122
+	else {
123
+			echo '
117 124
 				<tr>
118 125
 					<td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td>
119 126
 				</tr>';
127
+	}
120 128
 
121 129
 				echo '
122 130
 			</tbody>
@@ -129,9 +137,10 @@  discard block
 block discarded – undo
129 137
 			<div class="pagelinks floatleft">', $context['page_index'], '</div>';
130 138
 
131 139
 	// If it is displaying the result of a search show a "search again" link to edit their criteria.
132
-	if (isset($context['old_search']))
133
-		echo '
140
+	if (isset($context['old_search'])) {
141
+			echo '
134 142
 			<a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>';
143
+	}
135 144
 	echo '
136 145
 		</div>
137 146
 	</div>';
Please login to merge, or discard this patch.
Themes/default/Poll.template.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 				<h3 class="catbg">', $context['page_title'], '</h3>
47 47
 			</div>';
48 48
 
49
-	if (!empty($context['poll_error']['messages']))
50
-		echo '
49
+	if (!empty($context['poll_error']['messages'])) {
50
+			echo '
51 51
 			<div class="errorbox">
52 52
 				<dl class="poll_error">
53 53
 					<dt>
@@ -58,6 +58,7 @@  discard block
 block discarded – undo
58 58
 					</dt>
59 59
 				</dl>
60 60
 			</div>';
61
+	}
61 62
 
62 63
 	echo '
63 64
 			<div>
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 								<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" size="80" maxlength="255">';
80 81
 
81 82
 		// Does this option have a vote count yet, or is it new?
82
-		if ($choice['votes'] != -1)
83
-			echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
83
+		if ($choice['votes'] != -1) {
84
+					echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
85
+		}
84 86
 
85 87
 		echo '
86 88
 							</dd>';
@@ -118,14 +120,15 @@  discard block
 block discarded – undo
118 120
 								<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '>
119 121
 							</dd>';
120 122
 
121
-		if ($context['poll']['guest_vote_allowed'])
122
-			echo '
123
+		if ($context['poll']['guest_vote_allowed']) {
124
+					echo '
123 125
 							<dt>
124 126
 								<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
125 127
 							</dt>
126 128
 							<dd>
127 129
 								<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', '>
128 130
 							</dd>';
131
+		}
129 132
 	}
130 133
 
131 134
 	echo '
@@ -140,12 +143,13 @@  discard block
 block discarded – undo
140 143
 						</dl>
141 144
 					</fieldset>';
142 145
 	// If this is an edit, we can allow them to reset the vote counts.
143
-	if ($context['is_edit'])
144
-		echo '
146
+	if ($context['is_edit']) {
147
+			echo '
145 148
 					<fieldset id="poll_reset">
146 149
 						<legend>', $txt['reset_votes'], '</legend>
147 150
 						<input type="checkbox" name="resetVoteCount" value="on"> ' . $txt['reset_votes_check'] . '
148 151
 					</fieldset>';
152
+	}
149 153
 	echo '
150 154
 					<input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
151 155
 				</div>
Please login to merge, or discard this patch.
Themes/default/GenericControls.template.php 1 patch
Braces   +76 added lines, -58 removed lines patch added patch discarded remove patch
@@ -53,14 +53,15 @@  discard block
 block discarded – undo
53 53
 			foreach ($context['smileys'] as $location => $smileyRows)
54 54
 			{
55 55
 				$countLocations--;
56
-				if ($location == 'postform')
57
-					echo '
56
+				if ($location == 'postform') {
57
+									echo '
58 58
 						dropdown:
59 59
 						{';
60
-				elseif ($location == 'popup')
61
-					echo '
60
+				} elseif ($location == 'popup') {
61
+									echo '
62 62
 						popup:
63 63
 						{';
64
+				}
64 65
 
65 66
 				$numRows = count($smileyRows);
66 67
 				// This is needed because otherwise the editor will remove all the duplicate (empty) keys and leave only 1 additional line
@@ -72,21 +73,22 @@  discard block
 block discarded – undo
72 73
 						echo '
73 74
 								', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : '';
74 75
 					}
75
-					if (empty($smileyRow['isLast']) && $numRows != 1)
76
-						echo ',
76
+					if (empty($smileyRow['isLast']) && $numRows != 1) {
77
+											echo ',
77 78
 						\'-', $emptyPlaceholder++, '\': \'\',';
79
+					}
78 80
 				}
79 81
 				echo '
80 82
 						}', $countLocations != 0 ? ',' : '';
81 83
 			}
82 84
 			echo '
83 85
 					}';
84
-		}
85
-		else
86
-			echo ',
86
+		} else {
87
+					echo ',
87 88
 					emoticons:
88 89
 					{},
89 90
 					emoticonsEnabled:false';
91
+		}
90 92
 
91 93
 		if ($context['show_bbc'] && $bbcContainer !== null)
92 94
 		{
@@ -97,15 +99,16 @@  discard block
 block discarded – undo
97 99
 			{
98 100
 				echo implode('|', $buttonRow);
99 101
 				$count_tags--;
100
-				if (!empty($count_tags))
101
-					echo '||';
102
+				if (!empty($count_tags)) {
103
+									echo '||';
104
+				}
102 105
 			}
103 106
 
104 107
 			echo '",';
105
-		}
106
-		else
107
-			echo ',
108
+		} else {
109
+					echo ',
108 110
 					toolbar: "",';
111
+		}
109 112
 
110 113
 		echo '
111 114
 				});
@@ -146,43 +149,48 @@  discard block
 block discarded – undo
146 149
 		</span>';
147 150
 
148 151
 	$tempTab = $context['tabindex'];
149
-	if (!empty($context['drafts_pm_save']))
150
-		$tempTab++;
151
-	elseif (!empty($context['drafts_save']))
152
-		$tempTab++;
153
-	elseif ($editor_context['preview_type'])
154
-		$tempTab++;
155
-	elseif ($context['show_spellchecking'])
156
-		$tempTab++;
152
+	if (!empty($context['drafts_pm_save'])) {
153
+			$tempTab++;
154
+	} elseif (!empty($context['drafts_save'])) {
155
+			$tempTab++;
156
+	} elseif ($editor_context['preview_type']) {
157
+			$tempTab++;
158
+	} elseif ($context['show_spellchecking']) {
159
+			$tempTab++;
160
+	}
157 161
 
158 162
 	$tempTab++;
159 163
 	$context['tabindex'] = $tempTab;
160 164
 
161
-	if (!empty($context['drafts_pm_save']))
162
-		echo '
165
+	if (!empty($context['drafts_pm_save'])) {
166
+			echo '
163 167
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button">
164 168
 		<input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">';
169
+	}
165 170
 
166
-	if (!empty($context['drafts_save']))
167
-		echo '
171
+	if (!empty($context['drafts_save'])) {
172
+			echo '
168 173
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button">
169 174
 		<input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">';
175
+	}
170 176
 
171
-	if ($context['show_spellchecking'])
172
-		echo '
177
+	if ($context['show_spellchecking']) {
178
+			echo '
173 179
 		<input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button">';
180
+	}
174 181
 
175
-	if ($editor_context['preview_type'])
176
-		echo '
182
+	if ($editor_context['preview_type']) {
183
+			echo '
177 184
 		<input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button">';
185
+	}
178 186
 
179 187
 
180 188
 	echo '
181 189
 		<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">';
182 190
 
183 191
 	// Load in the PM autosaver if it's enabled
184
-	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave']))
185
-		echo '
192
+	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) {
193
+			echo '
186 194
 		<span class="righttext padding" style="display: block">
187 195
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon">&nbsp;</span>
188 196
 			<span id="draft_lastautosave" ></span>
@@ -200,10 +208,11 @@  discard block
 block discarded – undo
200 208
 				iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), '
201 209
 			});
202 210
 		</script>';
211
+	}
203 212
 
204 213
 	// Start an instance of the auto saver if its enabled
205
-	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave']))
206
-		echo '
214
+	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) {
215
+			echo '
207 216
 		<span class="righttext padding" style="display: block">
208 217
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon">&nbsp;</span>
209 218
 			<span id="draft_lastautosave" ></span>
@@ -220,7 +229,8 @@  discard block
 block discarded – undo
220 229
 				iFreq: ', $context['drafts_autosave_frequency'], '
221 230
 			});
222 231
 		</script>';
223
-}
232
+	}
233
+	}
224 234
 
225 235
 /**
226 236
  * This template displays a verification form
@@ -237,51 +247,57 @@  discard block
 block discarded – undo
237 247
 	$verify_context = &$context['controls']['verification'][$verify_id];
238 248
 
239 249
 	// Keep track of where we are.
240
-	if (empty($verify_context['tracking']) || $reset)
241
-		$verify_context['tracking'] = 0;
250
+	if (empty($verify_context['tracking']) || $reset) {
251
+			$verify_context['tracking'] = 0;
252
+	}
242 253
 
243 254
 	// How many items are there to display in total.
244 255
 	$total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0);
245 256
 
246 257
 	// If we've gone too far, stop.
247
-	if ($verify_context['tracking'] > $total_items)
248
-		return false;
258
+	if ($verify_context['tracking'] > $total_items) {
259
+			return false;
260
+	}
249 261
 
250 262
 	// Loop through each item to show them.
251 263
 	for ($i = 0; $i < $total_items; $i++)
252 264
 	{
253 265
 		// If we're after a single item only show it if we're in the right place.
254
-		if ($display_type == 'single' && $verify_context['tracking'] != $i)
255
-			continue;
266
+		if ($display_type == 'single' && $verify_context['tracking'] != $i) {
267
+					continue;
268
+		}
256 269
 
257
-		if ($display_type != 'single')
258
-			echo '
270
+		if ($display_type != 'single') {
271
+					echo '
259 272
 			<div id="verification_control_', $i, '" class="verification_control">';
273
+		}
260 274
 
261 275
 		// Display empty field, but only if we have one, and it's the first time.
262
-		if ($verify_context['empty_field'] && empty($i))
263
-			echo '
276
+		if ($verify_context['empty_field'] && empty($i)) {
277
+					echo '
264 278
 				<div class="smalltext vv_special">
265 279
 					', $txt['visual_verification_hidden'], ':
266 280
 					<input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value="">
267 281
 				</div>';
282
+		}
268 283
 
269 284
 		// Do the actual stuff
270 285
 		if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha']))
271 286
 		{
272 287
 			if ($verify_context['show_visual'])
273 288
 			{
274
-				if ($context['use_graphic_library'])
275
-					echo '
289
+				if ($context['use_graphic_library']) {
290
+									echo '
276 291
 				<img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">';
277
-				else
278
-					echo '
292
+				} else {
293
+									echo '
279 294
 				<img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1">
280 295
 				<img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2">
281 296
 				<img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3">
282 297
 				<img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4">
283 298
 				<img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5">
284 299
 				<img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">';
300
+				}
285 301
 
286 302
 				echo '
287 303
 				<div class="smalltext" style="margin: 4px 0 8px 0;">
@@ -297,8 +313,7 @@  discard block
 block discarded – undo
297 313
 				<div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div><br>
298 314
 				<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>';
299 315
 			}
300
-		}
301
-		else
316
+		} else
302 317
 		{
303 318
 			// Where in the question array is this question?
304 319
 			$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;
@@ -310,21 +325,24 @@  discard block
 block discarded – undo
310 325
 				</div>';
311 326
 		}
312 327
 
313
-		if ($display_type != 'single')
314
-			echo '
328
+		if ($display_type != 'single') {
329
+					echo '
315 330
 			</div>';
331
+		}
316 332
 
317 333
 		// If we were displaying just one and we did it, break.
318
-		if ($display_type == 'single' && $verify_context['tracking'] == $i)
319
-			break;
334
+		if ($display_type == 'single' && $verify_context['tracking'] == $i) {
335
+					break;
336
+		}
320 337
 	}
321 338
 
322 339
 	// Assume we found something, always,
323 340
 	$verify_context['tracking']++;
324 341
 
325 342
 	// Tell something displaying piecemeal to keep going.
326
-	if ($display_type == 'single')
327
-		return true;
328
-}
343
+	if ($display_type == 'single') {
344
+			return true;
345
+	}
346
+	}
329 347
 
330 348
 ?>
331 349
\ No newline at end of file
Please login to merge, or discard this patch.