Completed
Pull Request — release-2.1 (#4272)
by Mert
08:21
created
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.
Themes/default/ManagePaid.template.php 1 patch
Braces   +61 added lines, -44 removed lines patch added patch discarded remove patch
@@ -24,11 +24,12 @@  discard block
 block discarded – undo
24 24
 				<h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3>
25 25
 			</div>';
26 26
 
27
-	if (!empty($context['disable_groups']))
28
-		echo '
27
+	if (!empty($context['disable_groups'])) {
28
+			echo '
29 29
 			<div class="information">
30 30
 				<span class="alert">', $txt['paid_mod_edit_note'], '</span>
31 31
 			</div>';
32
+	}
32 33
 
33 34
 	echo '
34 35
 			<div class="windowbg2">
@@ -68,9 +69,10 @@  discard block
 block discarded – undo
68 69
 							<option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>';
69 70
 
70 71
 	// Put each group into the box.
71
-	foreach ($context['groups'] as $id => $name)
72
-		echo '
72
+	foreach ($context['groups'] as $id => $name) {
73
+			echo '
73 74
 							<option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>';
75
+	}
74 76
 
75 77
 	echo '
76 78
 						</select>
@@ -81,9 +83,10 @@  discard block
 block discarded – undo
81 83
 					<dd>';
82 84
 
83 85
 	// Put a checkbox in for each group
84
-	foreach ($context['groups'] as $id => $name)
85
-		echo '
86
+	foreach ($context['groups'] as $id => $name) {
87
+			echo '
86 88
 						<label for="addgroup_', $id, '"><input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '>&nbsp;<span class="smalltext">', $name, '</span></label><br>';
89
+	}
87 90
 
88 91
 	echo '
89 92
 					</dd>
@@ -135,8 +138,8 @@  discard block
 block discarded – undo
135 138
 					<fieldset>';
136 139
 
137 140
 	//!! Removed until implemented
138
-	if (!empty($sdflsdhglsdjgs))
139
-		echo '
141
+	if (!empty($sdflsdhglsdjgs)) {
142
+			echo '
140 143
 						<dl class="settings">
141 144
 							<dt>
142 145
 								<label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span>
@@ -145,6 +148,7 @@  discard block
 block discarded – undo
145 148
 								<input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', '>
146 149
 							</dd>
147 150
 						</dl>';
151
+	}
148 152
 
149 153
 	echo '
150 154
 						<div class="information">
@@ -245,8 +249,8 @@  discard block
 block discarded – undo
245 249
 				<dl class="settings">';
246 250
 
247 251
 	// Do we need a username?
248
-	if ($context['action_type'] == 'add')
249
-		echo '
252
+	if ($context['action_type'] == 'add') {
253
+			echo '
250 254
 
251 255
 					<dt>
252 256
 						<strong>', $txt['paid_username'], ':</strong><br>
@@ -255,6 +259,7 @@  discard block
 block discarded – undo
255 259
 					<dd>
256 260
 						<input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30">
257 261
 					</dd>';
262
+	}
258 263
 
259 264
 	echo '
260 265
 					<dt>
@@ -272,9 +277,10 @@  discard block
 block discarded – undo
272 277
 					<select name="year" id="year" onchange="generateDays();">';
273 278
 
274 279
 	// Show a list of all the years we allow...
275
-	for ($year = 2005; $year <= 2030; $year++)
276
-		echo '
280
+	for ($year = 2005; $year <= 2030; $year++) {
281
+			echo '
277 282
 						<option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>';
283
+	}
278 284
 
279 285
 	echo '
280 286
 					</select>&nbsp;
@@ -282,9 +288,10 @@  discard block
 block discarded – undo
282 288
 					<select name="month" id="month" onchange="generateDays();">';
283 289
 
284 290
 	// There are 12 months per year - ensure that they all get listed.
285
-	for ($month = 1; $month <= 12; $month++)
286
-		echo '
291
+	for ($month = 1; $month <= 12; $month++) {
292
+			echo '
287 293
 						<option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
294
+	}
288 295
 
289 296
 	echo '
290 297
 					</select>&nbsp;
@@ -292,9 +299,10 @@  discard block
 block discarded – undo
292 299
 					<select name="day" id="day">';
293 300
 
294 301
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
295
-	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++)
296
-		echo '
302
+	for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) {
303
+			echo '
297 304
 						<option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>';
305
+	}
298 306
 
299 307
 	echo '
300 308
 					</select>
@@ -306,9 +314,10 @@  discard block
 block discarded – undo
306 314
 					<select name="yearend" id="yearend" onchange="generateDays(\'end\');">';
307 315
 
308 316
 	// Show a list of all the years we allow...
309
-	for ($year = 2005; $year <= 2030; $year++)
310
-		echo '
317
+	for ($year = 2005; $year <= 2030; $year++) {
318
+			echo '
311 319
 						<option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>';
320
+	}
312 321
 
313 322
 	echo '
314 323
 					</select>&nbsp;
@@ -316,9 +325,10 @@  discard block
 block discarded – undo
316 325
 					<select name="monthend" id="monthend" onchange="generateDays(\'end\');">';
317 326
 
318 327
 	// There are 12 months per year - ensure that they all get listed.
319
-	for ($month = 1; $month <= 12; $month++)
320
-		echo '
328
+	for ($month = 1; $month <= 12; $month++) {
329
+			echo '
321 330
 						<option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
331
+	}
322 332
 
323 333
 	echo '
324 334
 					</select>&nbsp;
@@ -326,9 +336,10 @@  discard block
 block discarded – undo
326 336
 					<select name="dayend" id="dayend">';
327 337
 
328 338
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
329
-	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++)
330
-		echo '
339
+	for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) {
340
+			echo '
331 341
 						<option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>';
342
+	}
332 343
 
333 344
 	echo '
334 345
 					</select>
@@ -410,8 +421,7 @@  discard block
 block discarded – undo
410 421
 			<div class="information">
411 422
 				', $txt['paid_subs_none'], '
412 423
 			</div>';
413
-	}
414
-	else
424
+	} else
415 425
 	{
416 426
 		echo '
417 427
 			<div class="information">
@@ -423,8 +433,9 @@  discard block
 block discarded – undo
423 433
 		{
424 434
 
425 435
 			// Ignore the inactive ones...
426
-			if (empty($subscription['active']))
427
-				continue;
436
+			if (empty($subscription['active'])) {
437
+							continue;
438
+			}
428 439
 
429 440
 			echo '
430 441
 			<div class="cat_bar">
@@ -434,9 +445,10 @@  discard block
 block discarded – undo
434 445
 				<p><strong>', $subscription['name'], '</strong></p>
435 446
 				<p class="smalltext">', $subscription['desc'], '</p>';
436 447
 
437
-			if (!$subscription['flexible'])
438
-				echo '
448
+			if (!$subscription['flexible']) {
449
+							echo '
439 450
 					<div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>';
451
+			}
440 452
 
441 453
 			if ($context['user']['is_owner'])
442 454
 			{
@@ -449,24 +461,25 @@  discard block
 block discarded – undo
449 461
 					<select name="cur[', $subscription['id'], ']">';
450 462
 
451 463
 					// Print out the costs for this one.
452
-					foreach ($subscription['costs'] as $duration => $value)
453
-						echo '
464
+					foreach ($subscription['costs'] as $duration => $value) {
465
+											echo '
454 466
 						<option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>';
467
+					}
455 468
 
456 469
 					echo '
457 470
 					</select>';
458
-				}
459
-				else
460
-					echo '
471
+				} else {
472
+									echo '
461 473
 					', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']);
474
+				}
462 475
 
463 476
 				echo '
464 477
 					<hr>
465 478
 					<input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">';
466
-			}
467
-			else
468
-				echo '
479
+			} else {
480
+							echo '
469 481
 					<a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>';
482
+			}
470 483
 
471 484
 			echo '
472 485
 			</div>';
@@ -493,19 +506,20 @@  discard block
 block discarded – undo
493 506
 			</thead>
494 507
 			<tbody>';
495 508
 
496
-	if (empty($context['current']))
497
-		echo '
509
+	if (empty($context['current'])) {
510
+			echo '
498 511
 				<tr class="windowbg">
499 512
 					<td colspan="4">
500 513
 						', $txt['paid_none_yet'], '
501 514
 					</td>
502 515
 				</tr>';
516
+	}
503 517
 
504 518
 	foreach ($context['current'] as $sub)
505 519
 	{
506 520
 
507
-		if (!$sub['hide'])
508
-			echo '
521
+		if (!$sub['hide']) {
522
+					echo '
509 523
 				<tr class="windowbg">
510 524
 					<td>
511 525
 						', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), '
@@ -517,6 +531,7 @@  discard block
 block discarded – undo
517 531
 						', $sub['end'], '
518 532
 					</td>
519 533
 				</tr>';
534
+		}
520 535
 	}
521 536
 	echo '
522 537
 			</tbody>
@@ -567,15 +582,17 @@  discard block
 block discarded – undo
567 582
 			', $gateway['desc'], '<br>
568 583
 				<form action="', $gateway['form'], '" method="post">';
569 584
 
570
-		if (!empty($gateway['javascript']))
571
-			echo '
585
+		if (!empty($gateway['javascript'])) {
586
+					echo '
572 587
 					<script>
573 588
 						', $gateway['javascript'], '
574 589
 					</script>';
590
+		}
575 591
 
576
-		foreach ($gateway['hidden'] as $name => $value)
577
-			echo '
592
+		foreach ($gateway['hidden'] as $name => $value) {
593
+					echo '
578 594
 					<input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">';
595
+		}
579 596
 
580 597
 		echo '
581 598
 					<br><input type="submit" value="', $gateway['submit'], '" class="button">
Please login to merge, or discard this patch.
Themes/default/Login.template.php 1 patch
Braces   +35 added lines, -24 removed lines patch added patch discarded remove patch
@@ -28,14 +28,16 @@  discard block
 block discarded – undo
28 28
 				<form class="login" action="', $context['login_url'], '" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '">';
29 29
 
30 30
 	// Did they make a mistake last time?
31
-	if (!empty($context['login_errors']))
32
-		echo '
31
+	if (!empty($context['login_errors'])) {
32
+			echo '
33 33
 					<div class="errorbox">', implode('<br>', $context['login_errors']), '</div><br>';
34
+	}
34 35
 
35 36
 	// Or perhaps there's some special description for this time?
36
-	if (isset($context['description']))
37
-		echo '
37
+	if (isset($context['description'])) {
38
+			echo '
38 39
 					<div class="information">', $context['description'], '</div>';
40
+	}
39 41
 
40 42
 	// Now just get the basic information - username, password, etc.
41 43
 	echo '
@@ -51,10 +53,11 @@  discard block
 block discarded – undo
51 53
 						<dt>', $txt['always_logged_in'], ':</dt>
52 54
 						<dd><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked' : '', ' onclick="this.form.cookielength.disabled = this.checked;"></dd>';
53 55
 	// If they have deleted their account, give them a chance to change their mind.
54
-	if (isset($context['login_show_undelete']))
55
-		echo '
56
+	if (isset($context['login_show_undelete'])) {
57
+			echo '
56 58
 						<dt class="alert">', $txt['undelete_account'], ':</dt>
57 59
 						<dd><input type="checkbox" name="undelete"></dd>';
60
+	}
58 61
 	echo '
59 62
 					</dl>
60 63
 					<p><input type="submit" value="', $txt['login'], '" class="button"></p>
@@ -66,8 +69,8 @@  discard block
 block discarded – undo
66 69
 						setTimeout(function() {
67 70
 							document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus();
68 71
 						}, 150);';
69
-	if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2))
70
-		echo '
72
+	if (!empty($context['from_ajax']) && (empty($modSettings['force_ssl']) || $modSettings['force_ssl'] == 2)) {
73
+			echo '
71 74
 						form = $("#frmLogin");
72 75
 						form.submit(function(e) {
73 76
 							e.preventDefault();
@@ -100,16 +103,18 @@  discard block
 block discarded – undo
100 103
 
101 104
 							return false;
102 105
 						});';
106
+	}
103 107
 
104 108
 	echo '
105 109
 					</script>
106 110
 				</form>';
107 111
 
108 112
 	// It is a long story as to why we have this when we're clearly not going to use it.
109
-	if (!empty($context['from_ajax']))
110
-		echo '
113
+	if (!empty($context['from_ajax'])) {
114
+			echo '
111 115
 					<br>
112 116
 					<a href="javascript:self.close();"></a>';
117
+	}
113 118
 	echo '
114 119
 			</div>
115 120
 		</div>';
@@ -130,9 +135,10 @@  discard block
 block discarded – undo
130 135
 				</h3>
131 136
 			</div>
132 137
 			<div class="roundframe noup">';
133
-	if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error']))
134
-		echo '
138
+	if (!empty($context['tfa_error']) || !empty($context['tfa_backup_error'])) {
139
+			echo '
135 140
 				<div class="error">', $txt['tfa_' . (!empty($context['tfa_error']) ? 'code_' : 'backup_') . 'invalid'], '</div>';
141
+	}
136 142
 	echo '
137 143
 				<form action="', $context['tfa_url'], '" method="post" id="frmTfa">
138 144
 					<div id="tfaCode">
@@ -155,8 +161,8 @@  discard block
 block discarded – undo
155 161
 				</form>
156 162
 				<script>
157 163
 						form = $("#frmTfa");';
158
-	if (!empty($context['from_ajax']))
159
-		echo '
164
+	if (!empty($context['from_ajax'])) {
165
+			echo '
160 166
 						form.submit(function(e) {
161 167
 							// If we are submitting backup code, let normal workflow follow since it redirects a couple times into a different page
162 168
 							if (form.find("input[name=tfa_backup]:first").val().length > 0)
@@ -175,6 +181,7 @@  discard block
 block discarded – undo
175 181
 
176 182
 							return false;
177 183
 						});';
184
+	}
178 185
 	echo '
179 186
 						form.find("input[name=backup]").click(function(e) {
180 187
 							$("#tfaBackup").show();
@@ -206,10 +213,11 @@  discard block
 block discarded – undo
206 213
 				', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br>';
207 214
 
208 215
 
209
-	if ($context['can_register'])
210
-		echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
211
-	else
212
-		echo $txt['login_below'];
216
+	if ($context['can_register']) {
217
+			echo sprintf($txt['login_below_or_register'], $scripturl . '?action=signup', $context['forum_name_html_safe']);
218
+	} else {
219
+			echo $txt['login_below'];
220
+	}
213 221
 
214 222
 	// And now the login information.
215 223
 	echo '
@@ -305,9 +313,10 @@  discard block
 block discarded – undo
305 313
 		</div>
306 314
 		<div class="roundframe centertext noup">';
307 315
 
308
-	if (!empty($context['incorrect_password']))
309
-		echo '
316
+	if (!empty($context['incorrect_password'])) {
317
+			echo '
310 318
 			<div class="error">', $txt['admin_incorrect_password'], '</div>';
319
+	}
311 320
 
312 321
 	echo '
313 322
 			<strong>', $txt['password'], ':</strong>
@@ -347,11 +356,12 @@  discard block
 block discarded – undo
347 356
 			<div class="roundframe">';
348 357
 
349 358
 	// You didn't even have an ID?
350
-	if (empty($context['member_id']))
351
-		echo '
359
+	if (empty($context['member_id'])) {
360
+			echo '
352 361
 				<dl>
353 362
 					<dt>', $txt['invalid_activation_username'], ':</dt>
354 363
 					<dd><input type="text" name="user" size="30"></dd>';
364
+	}
355 365
 
356 366
 	echo '
357 367
 					<dt>', $txt['invalid_activation_retry'], ':</dt>
@@ -388,13 +398,14 @@  discard block
 block discarded – undo
388 398
 					<dd><input type="password" name="passwd" size="30"></dd>
389 399
 				</dl>';
390 400
 
391
-	if ($context['can_activate'])
392
-		echo '
401
+	if ($context['can_activate']) {
402
+			echo '
393 403
 				<p>', $txt['invalid_activation_known'], '</p>
394 404
 				<dl>
395 405
 					<dt>', $txt['invalid_activation_retry'], ':</dt>
396 406
 					<dd><input type="text" name="code" size="30"></dd>
397 407
 				</dl>';
408
+	}
398 409
 
399 410
 	echo '
400 411
 				<p><input type="submit" value="', $txt['invalid_activation_resend'], '" class="button"></p>
Please login to merge, or discard this patch.