Completed
Branch release-2.1 (e49a83)
by Michael
08:59
created
Themes/default/Reports.template.php 1 patch
Braces   +32 added lines, -24 removed lines patch added patch discarded remove patch
@@ -29,9 +29,10 @@  discard block
 block discarded – undo
29 29
 	// Go through each type of report they can run.
30 30
 	foreach ($context['report_types'] as $type)
31 31
 	{
32
-		if (isset($type['description']))
33
-			echo '
32
+		if (isset($type['description'])) {
33
+					echo '
34 34
 					<dt>', $type['description'], '</dt>';
35
+		}
35 36
 		echo '
36 37
 					<dd>
37 38
 						<input type="radio" id="rt_', $type['id'], '" name="rt" value="', $type['id'], '"', $type['is_first'] ? ' checked' : '', ' class="input_radio">
@@ -61,8 +62,9 @@  discard block
 block discarded – undo
61 62
 		</div>
62 63
 		<div id="report_buttons">';
63 64
 
64
-	if (!empty($context['report_buttons']))
65
-		template_button_strip($context['report_buttons'], 'right');
65
+	if (!empty($context['report_buttons'])) {
66
+			template_button_strip($context['report_buttons'], 'right');
67
+	}
66 68
 
67 69
 	echo '
68 70
 		</div>';
@@ -73,25 +75,27 @@  discard block
 block discarded – undo
73 75
 		echo '
74 76
 		<table class="table_grid report_results">';
75 77
 
76
-		if (!empty($table['title']))
77
-			echo '
78
+		if (!empty($table['title'])) {
79
+					echo '
78 80
 			<thead>
79 81
 				<tr class="title_bar">
80 82
 					<th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th>
81 83
 				</tr>
82 84
 			</thead>
83 85
 			<tbody>';
86
+		}
84 87
 
85 88
 		// Now do each row!
86 89
 		$row_number = 0;
87 90
 		foreach ($table['data'] as $row)
88 91
 		{
89
-			if ($row_number == 0 && !empty($table['shading']['top']))
90
-				echo '
92
+			if ($row_number == 0 && !empty($table['shading']['top'])) {
93
+							echo '
91 94
 				<tr class="windowbg table_caption">';
92
-			else
93
-				echo '
95
+			} else {
96
+							echo '
94 97
 				<tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">';
98
+			}
95 99
 
96 100
 			// Now do each column.
97 101
 			$column_number = 0;
@@ -109,16 +113,17 @@  discard block
 block discarded – undo
109 113
 				}
110 114
 
111 115
 				// Shaded?
112
-				if ($column_number == 0 && !empty($table['shading']['left']))
113
-					echo '
116
+				if ($column_number == 0 && !empty($table['shading']['left'])) {
117
+									echo '
114 118
 					<td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '>
115 119
 						', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), '
116 120
 					</td>';
117
-				else
118
-					echo '
121
+				} else {
122
+									echo '
119 123
 					<td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '>
120 124
 						', $data['v'], '
121 125
 					</td>';
126
+				}
122 127
 
123 128
 				$column_number++;
124 129
 			}
@@ -167,24 +172,26 @@  discard block
 block discarded – undo
167 172
 		<div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '">
168 173
 			<table class="bordercolor">';
169 174
 
170
-		if (!empty($table['title']))
171
-			echo '
175
+		if (!empty($table['title'])) {
176
+					echo '
172 177
 				<tr class="title_bar">
173 178
 					<td colspan="', $table['column_count'], '">
174 179
 						', $table['title'], '
175 180
 					</td>
176 181
 				</tr>';
182
+		}
177 183
 
178 184
 		// Now do each row!
179 185
 		$row_number = 0;
180 186
 		foreach ($table['data'] as $row)
181 187
 		{
182
-			if ($row_number == 0 && !empty($table['shading']['top']))
183
-				echo '
188
+			if ($row_number == 0 && !empty($table['shading']['top'])) {
189
+							echo '
184 190
 				<tr class="titlebg">';
185
-			else
186
-				echo '
191
+			} else {
192
+							echo '
187 193
 				<tr class="windowbg">';
194
+			}
188 195
 
189 196
 			// Now do each column!!
190 197
 			$column_number = 0;
@@ -201,16 +208,17 @@  discard block
 block discarded – undo
201 208
 				}
202 209
 
203 210
 				// Shaded?
204
-				if ($column_number == 0 && !empty($table['shading']['left']))
205
-					echo '
211
+				if ($column_number == 0 && !empty($table['shading']['left'])) {
212
+									echo '
206 213
 					<td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '>
207 214
 						', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), '
208 215
 					</td>';
209
-				else
210
-					echo '
216
+				} else {
217
+									echo '
211 218
 					<td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '>
212 219
 						', $data['v'], '
213 220
 					</td>';
221
+				}
214 222
 
215 223
 				$column_number++;
216 224
 			}
Please login to merge, or discard this patch.
Themes/default/GenericMenu.template.php 1 patch
Braces   +50 added lines, -37 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 		foreach ($section['areas'] as $i => $area)
90 90
 		{
91 91
 			// Not supposed to be printed?
92
-			if (empty($area['label']))
93
-				continue;
92
+			if (empty($area['label'])) {
93
+							continue;
94
+			}
94 95
 
95 96
 			echo '
96 97
 								<li', !empty($area['subsections']) ? ' class="subsections"' : '', '>';
@@ -99,8 +100,9 @@  discard block
 block discarded – undo
99 100
 									<a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>';
100 101
 
101 102
 			// Is this the current area, or just some area?
102
-			if (!empty($area['selected']) && empty($context['tabs']))
103
-					$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
103
+			if (!empty($area['selected']) && empty($context['tabs'])) {
104
+								$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
105
+			}
104 106
 
105 107
 			// Are there any subsections?
106 108
 			if (!empty($area['subsections']))
@@ -110,8 +112,9 @@  discard block
 block discarded – undo
110 112
 
111 113
 				foreach ($area['subsections'] as $sa => $sub)
112 114
 				{
113
-					if (!empty($sub['disabled']))
114
-						continue;
115
+					if (!empty($sub['disabled'])) {
116
+											continue;
117
+					}
115 118
 
116 119
 					$url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
117 120
 
@@ -158,8 +161,9 @@  discard block
 block discarded – undo
158 161
 							<h3 class="catbg">';
159 162
 
160 163
 		// The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available
161
-		if (function_exists('template_admin_quick_search'))
162
-			template_admin_quick_search();
164
+		if (function_exists('template_admin_quick_search')) {
165
+					template_admin_quick_search();
166
+		}
163 167
 
164 168
 		// Exactly how many tabs do we have?
165 169
 		if (!empty($context['tabs']))
@@ -174,30 +178,36 @@  discard block
 block discarded – undo
174 178
 				}
175 179
 
176 180
 				// Did this not even exist - or do we not have a label?
177
-				if (!isset($tab_context['tabs'][$id]))
178
-					$tab_context['tabs'][$id] = array('label' => $tab['label']);
179
-				elseif (!isset($tab_context['tabs'][$id]['label']))
180
-					$tab_context['tabs'][$id]['label'] = $tab['label'];
181
+				if (!isset($tab_context['tabs'][$id])) {
182
+									$tab_context['tabs'][$id] = array('label' => $tab['label']);
183
+				} elseif (!isset($tab_context['tabs'][$id]['label'])) {
184
+									$tab_context['tabs'][$id]['label'] = $tab['label'];
185
+				}
181 186
 
182 187
 				// Has a custom URL defined in the main admin structure?
183
-				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
184
-					$tab_context['tabs'][$id]['url'] = $tab['url'];
188
+				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url'])) {
189
+									$tab_context['tabs'][$id]['url'] = $tab['url'];
190
+				}
185 191
 
186 192
 				// Any additional paramaters for the url?
187
-				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
188
-					$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
193
+				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params'])) {
194
+									$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
195
+				}
189 196
 
190 197
 				// Has it been deemed selected?
191
-				if (!empty($tab['is_selected']))
192
-					$tab_context['tabs'][$id]['is_selected'] = true;
198
+				if (!empty($tab['is_selected'])) {
199
+									$tab_context['tabs'][$id]['is_selected'] = true;
200
+				}
193 201
 
194 202
 				// Does it have its own help?
195
-				if (!empty($tab['help']))
196
-					$tab_context['tabs'][$id]['help'] = $tab['help'];
203
+				if (!empty($tab['help'])) {
204
+									$tab_context['tabs'][$id]['help'] = $tab['help'];
205
+				}
197 206
 
198 207
 				// Is this the last one?
199
-				if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
200
-					$tab_context['tabs'][$id]['is_last'] = true;
208
+				if (!empty($tab['is_last']) && !isset($tab_context['override_last'])) {
209
+									$tab_context['tabs'][$id]['is_last'] = true;
210
+				}
201 211
 			}
202 212
 
203 213
 			// Find the selected tab
@@ -214,17 +224,18 @@  discard block
 block discarded – undo
214 224
 		// Show an icon and/or a help item?
215 225
 		if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
216 226
 		{
217
-			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']))
218
-				echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
219
-			elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
220
-				echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
227
+			if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class'])) {
228
+							echo '<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
229
+			} elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon'])) {
230
+							echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
231
+			}
221 232
 
222
-			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
223
-				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
233
+			if (!empty($selected_tab['help']) || !empty($tab_context['help'])) {
234
+							echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a>';
235
+			}
224 236
 
225 237
 			echo $tab_context['title'];
226
-		}
227
-		else
238
+		} else
228 239
 		{
229 240
 			echo '
230 241
 							', $tab_context['title'];
@@ -237,11 +248,12 @@  discard block
 block discarded – undo
237 248
 	}
238 249
 
239 250
 	// Shall we use the tabs? Yes, it's the only known way!
240
-	if (!empty($selected_tab['description']) || !empty($tab_context['description']))
241
-		echo '
251
+	if (!empty($selected_tab['description']) || !empty($tab_context['description'])) {
252
+			echo '
242 253
 					<p class="information">
243 254
 						', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
244 255
 					</p>';
256
+	}
245 257
 
246 258
 	// Print out all the items in this tab (if any).
247 259
 	if (!empty($context['tabs']))
@@ -253,8 +265,9 @@  discard block
 block discarded – undo
253 265
 
254 266
 		foreach ($tab_context['tabs'] as $sa => $tab)
255 267
 		{
256
-			if (!empty($tab['disabled']))
257
-				continue;
268
+			if (!empty($tab['disabled'])) {
269
+							continue;
270
+			}
258 271
 
259 272
 			if (!empty($tab['is_selected']))
260 273
 			{
@@ -262,12 +275,12 @@  discard block
 block discarded – undo
262 275
 							<li>
263 276
 								<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
264 277
 							</li>';
265
-			}
266
-			else
267
-				echo '
278
+			} else {
279
+							echo '
268 280
 							<li>
269 281
 								<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
270 282
 							</li>';
283
+			}
271 284
 		}
272 285
 
273 286
 		// the end of tabs
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' : '', ' class="input_check">&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', ' class="input_check">
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" class="input_text">
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_submit">';
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_submit">
Please login to merge, or discard this patch.
Themes/default/Themes.template.php 1 patch
Braces   +106 added lines, -78 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
 					<dd>
55 55
 						<div id="known_themes_list">';
56 56
 
57
-	foreach ($context['themes'] as $theme)
58
-		echo '
57
+	foreach ($context['themes'] as $theme) {
58
+			echo '
59 59
 							<label for="options-known_themes_', $theme['id'], '"><input type="checkbox" name="options[known_themes][]" id="options-known_themes_', $theme['id'], '" value="', $theme['id'], '"', $theme['known'] ? ' checked' : '', ' class="input_check"> ', $theme['name'], '</label><br>';
60
+	}
60 61
 
61 62
 		echo '
62 63
 						</div>
@@ -73,9 +74,10 @@  discard block
 block discarded – undo
73 74
 						<select name="options[theme_guests]" id="theme_guests">';
74 75
 
75 76
 	// Put an option for each theme in the select box.
76
-	foreach ($context['themes'] as $theme)
77
-		echo '
77
+	foreach ($context['themes'] as $theme) {
78
+			echo '
78 79
 							<option value="', $theme['id'], '"', $modSettings['theme_guests'] == $theme['id'] ? ' selected' : '', '>', $theme['name'], '</option>';
80
+	}
79 81
 
80 82
 	echo '
81 83
 						</select>
@@ -90,9 +92,10 @@  discard block
 block discarded – undo
90 92
 							<option value="0">', $txt['theme_forum_default'], '</option>';
91 93
 
92 94
 	// Same thing, this time for changing the theme of everyone.
93
-	foreach ($context['themes'] as $theme)
94
-		echo '
95
+	foreach ($context['themes'] as $theme) {
96
+			echo '
95 97
 							<option value="', $theme['id'], '">', $theme['name'], '</option>';
98
+	}
96 99
 
97 100
 	echo '
98 101
 						</select>
@@ -189,11 +192,12 @@  discard block
 block discarded – undo
189 192
 	global $context, $scripturl, $txt;
190 193
 
191 194
 	// Show a nice confirmation message.
192
-	if (isset($_GET['done']))
193
-		echo '
195
+	if (isset($_GET['done'])) {
196
+			echo '
194 197
 	<div class="infobox">
195 198
 		', $txt['theme_confirmed_'. $_GET['done']] ,'
196 199
 	</div>';
200
+	}
197 201
 
198 202
 	echo '
199 203
 	<div id="admincenter">';
@@ -353,22 +357,24 @@  discard block
 block discarded – undo
353 357
 					<dt ', $context['theme_options_reset'] ? 'style="width:50%"' : '', '>';
354 358
 
355 359
 		// Show the change option box ?
356
-		if ($context['theme_options_reset'])
357
-			echo '
360
+		if ($context['theme_options_reset']) {
361
+					echo '
358 362
 						<span class="floatleft"><select name="', !empty($setting['default']) ? 'default_' : '', 'options_master[', $setting['id'], ']" onchange="this.form.options_', $setting['id'], '.disabled = this.selectedIndex != 1;">
359 363
 							<option value="0" selected>', $txt['themeadmin_reset_options_none'], '</option>
360 364
 							<option value="1">', $txt['themeadmin_reset_options_change'], '</option>
361 365
 							<option value="2">', $txt['themeadmin_reset_options_default'], '</option>
362 366
 						</select>&nbsp;</span>';
367
+		}
363 368
 
364 369
 		// display checkbox options
365 370
 		if ($setting['type'] == 'checkbox')
366 371
 		{
367 372
 			echo '
368 373
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
369
-			if (isset($setting['description']))
370
-				echo '
374
+			if (isset($setting['description'])) {
375
+							echo '
371 376
 						<br><span class="smalltext">', $setting['description'], '</span>';
377
+			}
372 378
 		echo '
373 379
 					</dt>
374 380
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>
@@ -380,9 +386,10 @@  discard block
 block discarded – undo
380 386
 		{
381 387
 			echo '
382 388
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
383
-			if (isset($setting['description']))
384
-				echo '
389
+			if (isset($setting['description'])) {
390
+							echo '
385 391
 						<br><span class="smalltext">', $setting['description'], '</span>';
392
+			}
386 393
 		echo '
387 394
 					</dt>
388 395
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>
@@ -402,9 +409,10 @@  discard block
 block discarded – undo
402 409
 		{
403 410
 			echo '
404 411
 						<label for="options_', $setting['id'], '">', $setting['label'], '</label>';
405
-			if (isset($setting['description']))
406
-				echo '
412
+			if (isset($setting['description'])) {
413
+							echo '
407 414
 						<br><span class="smalltext">', $setting['description'], '</span>';
415
+			}
408 416
 		echo '
409 417
 					</dt>
410 418
 					<dd ', $context['theme_options_reset'] ? 'style="width:40%"' : '', '>';
@@ -417,8 +425,7 @@  discard block
 block discarded – undo
417 425
 
418 426
 				echo '
419 427
 						<input type="number"', $min . $max . $step;
420
-			}
421
-			else
428
+			} else
422 429
 			{
423 430
 				echo '
424 431
 						<input type="text"';
@@ -462,8 +469,8 @@  discard block
 block discarded – undo
462 469
 			<br>';
463 470
 
464 471
 	// @todo Why can't I edit the default theme popup.
465
-	if ($context['theme_settings']['theme_id'] != 1)
466
-		echo '
472
+	if ($context['theme_settings']['theme_id'] != 1) {
473
+			echo '
467 474
 			<div class="cat_bar">
468 475
 				<h3 class="catbg config_hd">
469 476
 					', $txt['theme_edit'], '
@@ -479,6 +486,7 @@  discard block
 block discarded – undo
479 486
 					</li>
480 487
 				</ul>
481 488
 			</div>';
489
+	}
482 490
 
483 491
 	echo '
484 492
 			<div class="cat_bar">
@@ -532,9 +540,10 @@  discard block
 block discarded – undo
532 540
 					<dd>
533 541
 						<select id="variant" name="options[default_variant]" onchange="changeVariant(this.value)">';
534 542
 
535
-		foreach ($context['theme_variants'] as $key => $variant)
536
-			echo '
543
+		foreach ($context['theme_variants'] as $key => $variant) {
544
+					echo '
537 545
 							<option value="', $key, '"', $context['default_variant'] == $key ? ' selected' : '', '>', $variant['label'], '</option>';
546
+		}
538 547
 
539 548
 		echo '
540 549
 						</select>
@@ -577,9 +586,10 @@  discard block
 block discarded – undo
577 586
 					<dt>
578 587
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
579 588
 
580
-			if (isset($setting['description']))
581
-				echo '<br>
589
+			if (isset($setting['description'])) {
590
+							echo '<br>
582 591
 						<span class="smalltext">', $setting['description'], '</span>';
592
+			}
583 593
 
584 594
 			echo '
585 595
 					</dt>
@@ -595,18 +605,20 @@  discard block
 block discarded – undo
595 605
 					<dt>
596 606
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
597 607
 
598
-			if (isset($setting['description']))
599
-				echo '<br>
608
+			if (isset($setting['description'])) {
609
+							echo '<br>
600 610
 						<span class="smalltext">', $setting['description'], '</span>';
611
+			}
601 612
 
602 613
 			echo '
603 614
 					</dt>
604 615
 					<dd>
605 616
 						<select name="', !empty($setting['default']) ? 'default_' : '', 'options[', $setting['id'], ']" id="', $setting['id'], '">';
606 617
 
607
-			foreach ($setting['options'] as $value => $label)
608
-				echo '
618
+			foreach ($setting['options'] as $value => $label) {
619
+							echo '
609 620
 							<option value="', $value, '"', $value == $setting['value'] ? ' selected' : '', '>', $label, '</option>';
621
+			}
610 622
 
611 623
 			echo '
612 624
 						</select>
@@ -619,9 +631,10 @@  discard block
 block discarded – undo
619 631
 					<dt>
620 632
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
621 633
 
622
-			if (isset($setting['description']))
623
-				echo '<br>
634
+			if (isset($setting['description'])) {
635
+							echo '<br>
624 636
 						<span class="smalltext">', $setting['description'], '</span>';
637
+			}
625 638
 			echo '
626 639
 					</dt>
627 640
 					<dd>
@@ -636,9 +649,10 @@  discard block
 block discarded – undo
636 649
 					<dt>
637 650
 						<label for="', $setting['id'], '">', $setting['label'], '</label>:';
638 651
 
639
-			if (isset($setting['description']))
640
-				echo '<br>
652
+			if (isset($setting['description'])) {
653
+							echo '<br>
641 654
 						<span class="smalltext">', $setting['description'], '</span>';
655
+			}
642 656
 
643 657
 			echo '
644 658
 					</dt>
@@ -652,8 +666,7 @@  discard block
 block discarded – undo
652 666
 
653 667
 				echo '
654 668
 						<input type="number"', $min . $max . $step;
655
-			}
656
-			else
669
+			} else
657 670
 			{
658 671
 				echo '
659 672
 						<input type="text"';
@@ -806,21 +819,23 @@  discard block
 block discarded – undo
806 819
 		<div class="windowbg">';
807 820
 
808 821
 	// Oops! there was an error :(
809
-	if (!empty($context['error_message']))
810
-		echo '
822
+	if (!empty($context['error_message'])) {
823
+			echo '
811 824
 			<p>
812 825
 				', $context['error_message'] ,'
813 826
 			</p>';
827
+	}
814 828
 
815 829
 	// Not much to show except a link back...
816
-	else
817
-		echo '
830
+	else {
831
+			echo '
818 832
 			<p>
819 833
 				<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_'. (isset($context['installed_theme']['updated']) ? 'updated' : 'installed') .'_message'], '
820 834
 			</p>
821 835
 			<p>
822 836
 				<a href="', $scripturl, '?action=admin;area=theme;sa=admin;', $context['session_var'], '=', $context['session_id'], '">', $txt['back'], '</a>
823 837
 			</p>';
838
+	}
824 839
 
825 840
 	echo '
826 841
 		</div>
@@ -887,10 +902,11 @@  discard block
 block discarded – undo
887 902
 					<span class="floatleft">', $template['filename'], $template['already_exists'] ? ' <span class="error">(' . $txt['themeadmin_edit_exists'] . ')</span>' : '', '</span>
888 903
 					<span class="floatright">';
889 904
 
890
-		if ($template['can_copy'])
891
-			echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
892
-		else
893
-			echo $txt['themeadmin_edit_no_copy'];
905
+		if ($template['can_copy']) {
906
+					echo '<a href="', $scripturl, '?action=admin;area=theme;th=', $context['theme_id'], ';', $context['session_var'], '=', $context['session_id'], ';sa=copy;template=', $template['value'], '" data-confirm="', $template['already_exists'] ? $txt['themeadmin_edit_overwrite_confirm'] : $txt['themeadmin_edit_copy_confirm'], '" class="you_sure">', $txt['themeadmin_edit_do_copy'], '</a>';
907
+		} else {
908
+					echo $txt['themeadmin_edit_no_copy'];
909
+		}
894 910
 
895 911
 		echo '
896 912
 					</span>
@@ -913,11 +929,12 @@  discard block
 block discarded – undo
913 929
 	echo '
914 930
 	<div id="admincenter">';
915 931
 
916
-	if (!empty($context['browse_title']))
917
-		echo '
932
+	if (!empty($context['browse_title'])) {
933
+			echo '
918 934
 		<div class="cat_bar">
919 935
 			<h3 class="catbg">', $context['browse_title'], '</h3>
920 936
 		</div>';
937
+	}
921 938
 
922 939
 	echo '
923 940
 		<table class="table_grid tborder">
@@ -937,14 +954,13 @@  discard block
 block discarded – undo
937 954
 			<tr class="windowbg">
938 955
 				<td>';
939 956
 
940
-		if ($file['is_editable'])
941
-			echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
942
-
943
-		elseif ($file['is_directory'])
944
-			echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
945
-
946
-		else
947
-			echo $file['filename'];
957
+		if ($file['is_editable']) {
958
+					echo '<a href="', $file['href'], '"', $file['is_template'] ? ' style="font-weight: bold;"' : '', '>', $file['filename'], '</a>';
959
+		} elseif ($file['is_directory']) {
960
+					echo '<a href="', $file['href'], '" class="is_directory"><span class="generic_icons folder"></span>', $file['filename'], '</a>';
961
+		} else {
962
+					echo $file['filename'];
963
+		}
948 964
 
949 965
 		echo '
950 966
 				</td>
@@ -966,11 +982,12 @@  discard block
 block discarded – undo
966 982
 {
967 983
 	global $context, $settings, $scripturl, $txt;
968 984
 
969
-	if ($context['session_error'])
970
-		echo '
985
+	if ($context['session_error']) {
986
+			echo '
971 987
 	<div class="errorbox">
972 988
 		', $txt['error_session_timeout'], '
973 989
 	</div>';
990
+	}
974 991
 
975 992
 	// From now on no one can complain that editing css is difficult. If you disagree, go to www.w3schools.com.
976 993
 	echo '
@@ -1033,17 +1050,18 @@  discard block
 block discarded – undo
1033 1050
 					try
1034 1051
 					{
1035 1052
 					';
1036
-	if (isBrowser('is_ie'))
1037
-		echo '
1053
+	if (isBrowser('is_ie')) {
1054
+			echo '
1038 1055
 						var sheets = frames["css_preview_box"].document.styleSheets;
1039 1056
 						for (var j = 0; j < sheets.length; j++)
1040 1057
 						{
1041 1058
 							if (sheets[j].id == "css_preview_box")
1042 1059
 								sheets[j].cssText = document.forms.stylesheetForm.entire_file.value;
1043 1060
 						}';
1044
-	else
1045
-		echo '
1061
+	} else {
1062
+			echo '
1046 1063
 						setInnerHTML(frames["css_preview_box"].document.getElementById("css_preview_sheet"), document.forms.stylesheetForm.entire_file.value);';
1064
+	}
1047 1065
 	echo '
1048 1066
 					}
1049 1067
 					catch (e)
@@ -1095,9 +1113,10 @@  discard block
 block discarded – undo
1095 1113
 			</div>
1096 1114
 			<div class="windowbg">';
1097 1115
 
1098
-	if (!$context['allow_save'])
1099
-		echo '
1116
+	if (!$context['allow_save']) {
1117
+			echo '
1100 1118
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1119
+	}
1101 1120
 
1102 1121
 	echo '
1103 1122
 				<textarea name="entire_file" cols="80" rows="20" style="width: 96%; font-family: monospace; margin-top: 1ex; white-space: pre;" onkeyup="setPreviewTimeout();" onchange="refreshPreview(true);">', $context['entire_file'], '</textarea><br>
@@ -1110,9 +1129,10 @@  discard block
 block discarded – undo
1110 1129
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1111 1130
 
1112 1131
 	// Hopefully it exists.
1113
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1114
-		echo '
1132
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1133
+			echo '
1115 1134
 			<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1135
+	}
1116 1136
 
1117 1137
 	echo '
1118 1138
 		</form>
@@ -1126,18 +1146,20 @@  discard block
 block discarded – undo
1126 1146
 {
1127 1147
 	global $context, $scripturl, $txt;
1128 1148
 
1129
-	if ($context['session_error'])
1130
-		echo '
1149
+	if ($context['session_error']) {
1150
+			echo '
1131 1151
 	<div class="errorbox">
1132 1152
 		', $txt['error_session_timeout'], '
1133 1153
 	</div>';
1154
+	}
1134 1155
 
1135
-	if (isset($context['parse_error']))
1136
-		echo '
1156
+	if (isset($context['parse_error'])) {
1157
+			echo '
1137 1158
 	<div class="errorbox">
1138 1159
 		', $txt['themeadmin_edit_error'], '
1139 1160
 			<div><pre>', $context['parse_error'], '</pre></div>
1140 1161
 	</div>';
1162
+	}
1141 1163
 
1142 1164
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1143 1165
 	echo '
@@ -1148,16 +1170,18 @@  discard block
 block discarded – undo
1148 1170
 			</div>
1149 1171
 			<div class="windowbg">';
1150 1172
 
1151
-	if (!$context['allow_save'])
1152
-		echo '
1173
+	if (!$context['allow_save']) {
1174
+			echo '
1153 1175
 				', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '<br>';
1176
+	}
1154 1177
 
1155
-	foreach ($context['file_parts'] as $part)
1156
-		echo '
1178
+	foreach ($context['file_parts'] as $part) {
1179
+			echo '
1157 1180
 				<label for="on_line', $part['line'], '">', $txt['themeadmin_edit_on_line'], ' ', $part['line'], '</label>:<br>
1158 1181
 				<div class="centertext">
1159 1182
 					<textarea id="on_line', $part['line'] ,'" name="entire_file[]" cols="80" rows="', $part['lines'] > 14 ? '14' : $part['lines'], '" class="edit_file">', $part['data'], '</textarea>
1160 1183
 				</div>';
1184
+	}
1161 1185
 
1162 1186
 	echo '
1163 1187
 				<div class="padding righttext">
@@ -1166,9 +1190,10 @@  discard block
 block discarded – undo
1166 1190
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1167 1191
 
1168 1192
 	// Hopefully it exists.
1169
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1170
-		echo '
1193
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1194
+			echo '
1171 1195
 					<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1196
+	}
1172 1197
 
1173 1198
 	echo '
1174 1199
 				</div>
@@ -1184,18 +1209,20 @@  discard block
 block discarded – undo
1184 1209
 {
1185 1210
 	global $context, $scripturl, $txt;
1186 1211
 
1187
-	if ($context['session_error'])
1188
-		echo '
1212
+	if ($context['session_error']) {
1213
+			echo '
1189 1214
 	<div class="errorbox">
1190 1215
 		', $txt['error_session_timeout'], '
1191 1216
 	</div>';
1217
+	}
1192 1218
 
1193 1219
 	//Is this file writeable?
1194
-	if (!$context['allow_save'])
1195
-		echo '
1220
+	if (!$context['allow_save']) {
1221
+			echo '
1196 1222
 	<div class="errorbox">
1197 1223
 		', $txt['theme_edit_no_save'], ': ', $context['allow_save_filename'], '
1198 1224
 	</div>';
1225
+	}
1199 1226
 
1200 1227
 	// Just show a big box.... gray out the Save button if it's not saveable... (ie. not 777.)
1201 1228
 	echo '
@@ -1211,9 +1238,10 @@  discard block
 block discarded – undo
1211 1238
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">';
1212 1239
 
1213 1240
 	// Hopefully it exists.
1214
-	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token']))
1215
-		echo '
1241
+	if (isset($context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'])) {
1242
+			echo '
1216 1243
 				<input type="hidden" name="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token_var'], '" value="', $context['admin-te-' . md5($context['theme_id'] . '-' . $context['edit_filename']) . '_token'], '">';
1244
+	}
1217 1245
 
1218 1246
 	echo '
1219 1247
 			</div>
Please login to merge, or discard this patch.
Themes/default/Post.template.php 1 patch
Braces   +107 added lines, -73 removed lines patch added patch discarded remove patch
@@ -22,22 +22,24 @@  discard block
 block discarded – undo
22 22
 		<script>';
23 23
 
24 24
 	// When using Go Back due to fatal_error, allow the form to be re-submitted with changes.
25
-	if (isBrowser('is_firefox'))
26
-		echo '
25
+	if (isBrowser('is_firefox')) {
26
+			echo '
27 27
 			window.addEventListener("pageshow", reActivate, false);';
28
+	}
28 29
 
29 30
 	// Start with message icons - and any missing from this theme.
30 31
 	echo '
31 32
 			var icon_urls = {';
32
-	foreach ($context['icons'] as $icon)
33
-		echo '
33
+	foreach ($context['icons'] as $icon) {
34
+			echo '
34 35
 				\'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ',';
36
+	}
35 37
 	echo '
36 38
 			};';
37 39
 
38 40
 	// If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations.
39
-	if ($context['make_poll'])
40
-		echo '
41
+	if ($context['make_poll']) {
42
+			echo '
41 43
 			var pollOptionNum = 0, pollTabIndex;
42 44
 			var pollOptionId = ', $context['last_choice_id'], ';
43 45
 			function addPollOption()
@@ -56,11 +58,13 @@  discard block
 block discarded – undo
56 58
 
57 59
 				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text"></dd><p id="pollMoreOptions"></p>'), ');
58 60
 			}';
61
+	}
59 62
 
60 63
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.
61
-	if ($context['make_event'])
62
-		echo '
64
+	if ($context['make_event']) {
65
+			echo '
63 66
 			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];';
67
+	}
64 68
 
65 69
 	// End of the javascript, start the form and display the link tree.
66 70
 	echo '
@@ -80,9 +84,10 @@  discard block
 block discarded – undo
80 84
 				</div>
81 85
 			</div><br>';
82 86
 
83
-	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board'])))
84
-		echo '
87
+	if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) {
88
+			echo '
85 89
 			<input type="hidden" name="eventid" value="', $context['event']['id'], '">';
90
+	}
86 91
 
87 92
 	// Start the main table.
88 93
 	echo '
@@ -117,26 +122,28 @@  discard block
 block discarded – undo
117 122
 	}
118 123
 
119 124
 	// If it's locked, show a message to warn the replier.
120
-	if (!empty($context['locked']))
121
-	echo '
125
+	if (!empty($context['locked'])) {
126
+		echo '
122 127
 					<p class="errorbox">
123 128
 						', $txt['topic_locked_no_reply'], '
124 129
 					</p>';
130
+	}
125 131
 
126
-	if (!empty($modSettings['drafts_post_enabled']))
127
-		echo '
132
+	if (!empty($modSettings['drafts_post_enabled'])) {
133
+			echo '
128 134
 					<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
129 135
 						sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
130 136
 						', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
131 137
 					</div>';
138
+	}
132 139
 
133 140
 	// The post header... important stuff
134 141
 	echo '
135 142
 					<dl id="post_header">';
136 143
 
137 144
 	// Custom posting fields.
138
-	if (!empty($context['posting_fields']) && is_array($context['posting_fields']))
139
-		foreach ($context['posting_fields'] as $pf)
145
+	if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) {
146
+			foreach ($context['posting_fields'] as $pf)
140 147
 			echo '
141 148
 						<dt>
142 149
 							', $pf['dt'] ,'
@@ -144,6 +151,7 @@  discard block
 block discarded – undo
144 151
 						<dd>
145 152
 							', $pf['dd'] ,'
146 153
 						</dd>';
154
+	}
147 155
 
148 156
 
149 157
 	// Guests have to put in their name and email...
@@ -157,14 +165,15 @@  discard block
 block discarded – undo
157 165
 							<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text">
158 166
 						</dd>';
159 167
 
160
-		if (empty($modSettings['guest_post_no_email']))
161
-			echo '
168
+		if (empty($modSettings['guest_post_no_email'])) {
169
+					echo '
162 170
 						<dt>
163 171
 							<span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span>
164 172
 						</dt>
165 173
 						<dd>
166 174
 							<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required>
167 175
 						</dd>';
176
+		}
168 177
 	}
169 178
 
170 179
 	// Now show the subject box for this post.
@@ -182,9 +191,10 @@  discard block
 block discarded – undo
182 191
 							<select name="icon" id="icon" onchange="showimage()">';
183 192
 
184 193
 	// Loop through each message icon allowed, adding it to the drop down list.
185
-	foreach ($context['icons'] as $icon)
186
-		echo '
194
+	foreach ($context['icons'] as $icon) {
195
+			echo '
187 196
 								<option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected' : '', '>', $icon['name'], '</option>';
197
+	}
188 198
 
189 199
 	echo '
190 200
 							</select>
@@ -206,9 +216,10 @@  discard block
 block discarded – undo
206 216
 								<select name="year" id="year" tabindex="', $context['tabindex']++, '" onchange="generateDays();">';
207 217
 
208 218
 		// Show a list of all the years we allow...
209
-		for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
210
-			echo '
219
+		for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
220
+					echo '
211 221
 									<option value="', $year, '"', $year == $context['event']['year'] ? ' selected' : '', '>', $year, '&nbsp;</option>';
222
+		}
212 223
 
213 224
 		echo '
214 225
 								</select>
@@ -216,9 +227,10 @@  discard block
 block discarded – undo
216 227
 								<select name="month" id="month" onchange="generateDays();">';
217 228
 
218 229
 		// There are 12 months per year - ensure that they all get listed.
219
-		for ($month = 1; $month <= 12; $month++)
220
-			echo '
230
+		for ($month = 1; $month <= 12; $month++) {
231
+					echo '
221 232
 									<option value="', $month, '"', $month == $context['event']['month'] ? ' selected' : '', '>', $txt['months'][$month], '&nbsp;</option>';
233
+		}
222 234
 
223 235
 		echo '
224 236
 								</select>
@@ -226,9 +238,10 @@  discard block
 block discarded – undo
226 238
 								<select name="day" id="day">';
227 239
 
228 240
 		// This prints out all the days in the current month - this changes dynamically as we switch months.
229
-		for ($day = 1; $day <= $context['event']['last_day']; $day++)
230
-			echo '
241
+		for ($day = 1; $day <= $context['event']['last_day']; $day++) {
242
+					echo '
231 243
 									<option value="', $day, '"', $day == $context['event']['day'] ? ' selected' : '', '>', $day, '&nbsp;</option>';
244
+		}
232 245
 
233 246
 		echo '
234 247
 								</select>
@@ -251,9 +264,10 @@  discard block
 block discarded – undo
251 264
 										', $txt['calendar_numb_days'], '
252 265
 										<select name="span">';
253 266
 
254
-				for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++)
255
-					echo '
267
+				for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) {
268
+									echo '
256 269
 											<option value="', $days, '"', $days == $context['event']['span'] ? ' selected' : '', '>', $days, '&nbsp;</option>';
270
+				}
257 271
 
258 272
 				echo '
259 273
 										</select>
@@ -271,9 +285,10 @@  discard block
 block discarded – undo
271 285
 				{
272 286
 					echo '
273 287
 											<optgroup label="', $category['name'], '">';
274
-					foreach ($category['boards'] as $board)
275
-						echo '
288
+					foreach ($category['boards'] as $board) {
289
+											echo '
276 290
 												<option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '&nbsp;</option>';
291
+					}
277 292
 					echo '
278 293
 											</optgroup>';
279 294
 				}
@@ -344,14 +359,15 @@  discard block
 block discarded – undo
344 359
 									<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check">
345 360
 								</dd>';
346 361
 
347
-		if ($context['poll_options']['guest_vote_enabled'])
348
-			echo '
362
+		if ($context['poll_options']['guest_vote_enabled']) {
363
+					echo '
349 364
 								<dt>
350 365
 									<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
351 366
 								</dt>
352 367
 								<dd>
353 368
 									<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', ' class="input_check">
354 369
 								</dd>';
370
+		}
355 371
 
356 372
 		echo '
357 373
 								<dt>
@@ -372,8 +388,8 @@  discard block
 block discarded – undo
372 388
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
373 389
 
374 390
 	// If we're editing and displaying edit details, show a box where they can say why
375
-	if (isset($context['editing']) && $modSettings['show_modify'])
376
-		echo '
391
+	if (isset($context['editing']) && $modSettings['show_modify']) {
392
+			echo '
377 393
 					<dl>
378 394
 						<dt class="clear">
379 395
 							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
@@ -382,20 +398,23 @@  discard block
 block discarded – undo
382 398
 							<input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text">
383 399
 						</dd>
384 400
 					</dl>';
401
+	}
385 402
 
386 403
 	// If this message has been edited in the past - display when it was.
387
-	if (isset($context['last_modified']))
388
-		echo '
404
+	if (isset($context['last_modified'])) {
405
+			echo '
389 406
 					<div class="padding smalltext">
390 407
 						', $context['last_modified_text'], '
391 408
 					</div>';
409
+	}
392 410
 
393 411
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.
394
-	if (!empty($modSettings['additional_options_collapsable']))
395
-		echo '
412
+	if (!empty($modSettings['additional_options_collapsable'])) {
413
+			echo '
396 414
 					<div id="postAdditionalOptionsHeader">
397 415
 						<strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong>
398 416
 					</div>';
417
+	}
399 418
 
400 419
 	echo '
401 420
 					<div id="postAdditionalOptions">';
@@ -427,19 +446,21 @@  discard block
 block discarded – undo
427 446
 								<input type="hidden" name="attach_del[]" value="0">
428 447
 								', $txt['uncheck_unwatchd_attach'], ':
429 448
 							</dd>';
430
-		foreach ($context['current_attachments'] as $attachment)
431
-			echo '
449
+		foreach ($context['current_attachments'] as $attachment) {
450
+					echo '
432 451
 							<dd class="smalltext">
433 452
 								<label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', ' class="input_check"> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
434 453
 								!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label>
435 454
 							</dd>';
455
+		}
436 456
 
437 457
 		echo '
438 458
 						</dl>';
439 459
 
440
-		if (!empty($context['files_in_session_warning']))
441
-			echo '
460
+		if (!empty($context['files_in_session_warning'])) {
461
+					echo '
442 462
 						<div class="smalltext">', $context['files_in_session_warning'], '</div>';
463
+		}
443 464
 	}
444 465
 
445 466
 	// Is the user allowed to post any additional ones? If so give them the boxes to do it!
@@ -492,8 +513,8 @@  discard block
 block discarded – undo
492 513
 								', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">');
493 514
 
494 515
 		// Show more boxes if they aren't approaching that limit.
495
-		if ($context['num_allowed_attachments'] > 1)
496
-			echo '
516
+		if ($context['num_allowed_attachments'] > 1) {
517
+					echo '
497 518
 										<script>
498 519
 											var allowed_attachments = ', $context['num_allowed_attachments'], ';
499 520
 											var current_attachment = 1;
@@ -514,9 +535,10 @@  discard block
 block discarded – undo
514 535
 									</div>
515 536
 								</div>
516 537
 							</dd>';
517
-		else
518
-			echo '
538
+		} else {
539
+					echo '
519 540
 							</dd>';
541
+		}
520 542
 
521 543
 		// Add any template changes for an alternative upload system here.
522 544
 		call_integration_hook('integrate_upload_template');
@@ -525,21 +547,25 @@  discard block
 block discarded – undo
525 547
 							<dd class="smalltext">';
526 548
 
527 549
 		// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
528
-		if (!empty($modSettings['attachmentCheckExtensions']))
529
-			echo '
550
+		if (!empty($modSettings['attachmentCheckExtensions'])) {
551
+					echo '
530 552
 								', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>';
553
+		}
531 554
 
532
-		if (!empty($context['attachment_restrictions']))
533
-			echo '
555
+		if (!empty($context['attachment_restrictions'])) {
556
+					echo '
534 557
 								', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>';
558
+		}
535 559
 
536
-		if ($context['num_allowed_attachments'] == 0)
537
-			echo '
560
+		if ($context['num_allowed_attachments'] == 0) {
561
+					echo '
538 562
 								', $txt['attach_limit_nag'], '<br>';
563
+		}
539 564
 
540
-		if (!$context['can_post_attachment_unapproved'])
541
-			echo '
565
+		if (!$context['can_post_attachment_unapproved']) {
566
+					echo '
542 567
 								<span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>';
568
+		}
543 569
 
544 570
 		echo '
545 571
 							</dd>
@@ -562,10 +588,11 @@  discard block
 block discarded – undo
562 588
 							<dt><strong>', $txt['subject'], '</strong></dt>
563 589
 							<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
564 590
 
565
-		foreach ($context['drafts'] as $draft)
566
-			echo '
591
+		foreach ($context['drafts'] as $draft) {
592
+					echo '
567 593
 							<dt>', $draft['link'], '</dt>
568 594
 							<dd>', $draft['poster_time'], '</dd>';
595
+		}
569 596
 		echo '
570 597
 						</dl>
571 598
 					</div>';
@@ -590,9 +617,10 @@  discard block
 block discarded – undo
590 617
 						', template_control_richedit_buttons($context['post_box_name']);
591 618
 
592 619
 	// Option to delete an event if user is editing one.
593
-	if ($context['make_event'] && !$context['event']['new'])
594
-		echo '
620
+	if ($context['make_event'] && !$context['event']['new']) {
621
+			echo '
595 622
 						<input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">';
623
+	}
596 624
 
597 625
 	echo '
598 626
 					</span>
@@ -601,9 +629,10 @@  discard block
 block discarded – undo
601 629
 			<br class="clear">';
602 630
 
603 631
 	// Assuming this isn't a new topic pass across the last message id.
604
-	if (isset($context['topic_last_message']))
605
-		echo '
632
+	if (isset($context['topic_last_message'])) {
633
+			echo '
606 634
 			<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">';
635
+	}
607 636
 
608 637
 	echo '
609 638
 			<input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '">
@@ -745,9 +774,10 @@  discard block
 block discarded – undo
745 774
 
746 775
 						newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \'&nbsp;&#187;</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';';
747 776
 
748
-	if ($context['can_quote'])
749
-		echo '
777
+	if ($context['can_quote']) {
778
+			echo '
750 779
 						newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';';
780
+	}
751 781
 
752 782
 	echo '
753 783
 						newPostsHTML += \'<br class="clear">\';
@@ -790,8 +820,8 @@  discard block
 block discarded – undo
790 820
 			}';
791 821
 
792 822
 	// Code for showing and hiding additional options.
793
-	if (!empty($modSettings['additional_options_collapsable']))
794
-		echo '
823
+	if (!empty($modSettings['additional_options_collapsable'])) {
824
+			echo '
795 825
 			var oSwapAdditionalOptions = new smc_Toggle({
796 826
 				bToggleEnabled: true,
797 827
 				bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ',
@@ -819,10 +849,11 @@  discard block
 block discarded – undo
819 849
 					}
820 850
 				]
821 851
 			});';
852
+	}
822 853
 
823 854
 	// Code for showing and hiding drafts
824
-	if (!empty($context['drafts']))
825
-		echo '
855
+	if (!empty($context['drafts'])) {
856
+			echo '
826 857
 			var oSwapDraftOptions = new smc_Toggle({
827 858
 				bToggleEnabled: true,
828 859
 				bCurrentlyCollapsed: true,
@@ -844,6 +875,7 @@  discard block
 block discarded – undo
844 875
 					}
845 876
 				]
846 877
 			});';
878
+	}
847 879
 
848 880
 	echo '
849 881
 			var oEditorID = "', $context['post_box_name'] ,'";
@@ -864,8 +896,9 @@  discard block
 block discarded – undo
864 896
 		foreach ($context['previous_posts'] as $post)
865 897
 		{
866 898
 			$ignoring = false;
867
-			if (!empty($post['is_ignored']))
868
-				$ignored_posts[] = $ignoring = $post['id'];
899
+			if (!empty($post['is_ignored'])) {
900
+							$ignored_posts[] = $ignoring = $post['id'];
901
+			}
869 902
 
870 903
 			echo '
871 904
 			<div class="windowbg">
@@ -1048,10 +1081,10 @@  discard block
 block discarded – undo
1048 1081
 		<div id="temporary_posting_area" style="display: none;"></div>
1049 1082
 		<script>';
1050 1083
 
1051
-	if ($context['close_window'])
1052
-		echo '
1084
+	if ($context['close_window']) {
1085
+			echo '
1053 1086
 			window.close();';
1054
-	else
1087
+	} else
1055 1088
 	{
1056 1089
 		// Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;).
1057 1090
 		echo '
@@ -1105,11 +1138,12 @@  discard block
 block discarded – undo
1105 1138
 				</p>
1106 1139
 				<ul>';
1107 1140
 
1108
-	foreach ($context['groups'] as $group)
1109
-		echo '
1141
+	foreach ($context['groups'] as $group) {
1142
+			echo '
1110 1143
 					<li>
1111 1144
 						<label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em>
1112 1145
 					</li>';
1146
+	}
1113 1147
 
1114 1148
 	echo '
1115 1149
 					<li>
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,20 +73,21 @@  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
 					{}';
90
+		}
89 91
 
90 92
 		if ($context['show_bbc'] && $bbcContainer !== null)
91 93
 		{
@@ -96,15 +98,16 @@  discard block
 block discarded – undo
96 98
 			{
97 99
 				echo implode('|', $buttonRow);
98 100
 				$count_tags--;
99
-				if (!empty($count_tags))
100
-					echo '||';
101
+				if (!empty($count_tags)) {
102
+									echo '||';
103
+				}
101 104
 			}
102 105
 
103 106
 			echo '",';
104
-		}
105
-		else
106
-			echo ',
107
+		} else {
108
+					echo ',
107 109
 					toolbar: "",';
110
+		}
108 111
 
109 112
 		echo '
110 113
 				});
@@ -145,43 +148,48 @@  discard block
 block discarded – undo
145 148
 		</span>';
146 149
 
147 150
 	$tempTab = $context['tabindex'];
148
-	if (!empty($context['drafts_pm_save']))
149
-		$tempTab++;
150
-	elseif (!empty($context['drafts_save']))
151
-		$tempTab++;
152
-	elseif ($editor_context['preview_type'])
153
-		$tempTab++;
154
-	elseif ($context['show_spellchecking'])
155
-		$tempTab++;
151
+	if (!empty($context['drafts_pm_save'])) {
152
+			$tempTab++;
153
+	} elseif (!empty($context['drafts_save'])) {
154
+			$tempTab++;
155
+	} elseif ($editor_context['preview_type']) {
156
+			$tempTab++;
157
+	} elseif ($context['show_spellchecking']) {
158
+			$tempTab++;
159
+	}
156 160
 
157 161
 	$tempTab++;
158 162
 	$context['tabindex'] = $tempTab;
159 163
 
160
-	if (!empty($context['drafts_pm_save']))
161
-		echo '
164
+	if (!empty($context['drafts_pm_save'])) {
165
+			echo '
162 166
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="',  --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button_submit">
163 167
 		<input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">';
168
+	}
164 169
 
165
-	if (!empty($context['drafts_save']))
166
-		echo '
170
+	if (!empty($context['drafts_save'])) {
171
+			echo '
167 172
 		<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_submit">
168 173
 		<input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">';
174
+	}
169 175
 
170
-	if ($context['show_spellchecking'])
171
-		echo '
176
+	if ($context['show_spellchecking']) {
177
+			echo '
172 178
 		<input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button_submit">';
179
+	}
173 180
 
174
-	if ($editor_context['preview_type'])
175
-		echo '
181
+	if ($editor_context['preview_type']) {
182
+			echo '
176 183
 		<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_submit">';
184
+	}
177 185
 
178 186
 
179 187
 	echo '
180 188
 		<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_submit">';
181 189
 
182 190
 	// Load in the PM autosaver if it's enabled
183
-	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave']))
184
-		echo '
191
+	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) {
192
+			echo '
185 193
 		<span class="righttext padding" style="display: block">
186 194
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon">&nbsp;</span>
187 195
 			<span id="draft_lastautosave" ></span>
@@ -199,10 +207,11 @@  discard block
 block discarded – undo
199 207
 				iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), '
200 208
 			});
201 209
 		</script>';
210
+	}
202 211
 
203 212
 	// Start an instance of the auto saver if its enabled
204
-	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave']))
205
-		echo '
213
+	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) {
214
+			echo '
206 215
 		<span class="righttext padding" style="display: block">
207 216
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon">&nbsp;</span>
208 217
 			<span id="draft_lastautosave" ></span>
@@ -219,7 +228,8 @@  discard block
 block discarded – undo
219 228
 				iFreq: ', $context['drafts_autosave_frequency'], '
220 229
 			});
221 230
 		</script>';
222
-}
231
+	}
232
+	}
223 233
 
224 234
 /**
225 235
  * This template displays a verification form
@@ -236,50 +246,56 @@  discard block
 block discarded – undo
236 246
 	$verify_context = &$context['controls']['verification'][$verify_id];
237 247
 
238 248
 	// Keep track of where we are.
239
-	if (empty($verify_context['tracking']) || $reset)
240
-		$verify_context['tracking'] = 0;
249
+	if (empty($verify_context['tracking']) || $reset) {
250
+			$verify_context['tracking'] = 0;
251
+	}
241 252
 
242 253
 	// How many items are there to display in total.
243 254
 	$total_items = count($verify_context['questions']) + ($verify_context['show_visual'] ? 1 : 0);
244 255
 
245 256
 	// If we've gone too far, stop.
246
-	if ($verify_context['tracking'] > $total_items)
247
-		return false;
257
+	if ($verify_context['tracking'] > $total_items) {
258
+			return false;
259
+	}
248 260
 
249 261
 	// Loop through each item to show them.
250 262
 	for ($i = 0; $i < $total_items; $i++)
251 263
 	{
252 264
 		// If we're after a single item only show it if we're in the right place.
253
-		if ($display_type == 'single' && $verify_context['tracking'] != $i)
254
-			continue;
265
+		if ($display_type == 'single' && $verify_context['tracking'] != $i) {
266
+					continue;
267
+		}
255 268
 
256
-		if ($display_type != 'single')
257
-			echo '
269
+		if ($display_type != 'single') {
270
+					echo '
258 271
 			<div id="verification_control_', $i, '" class="verification_control">';
272
+		}
259 273
 
260 274
 		// Display empty field, but only if we have one, and it's the first time.
261
-		if ($verify_context['empty_field'] && empty($i))
262
-			echo '
275
+		if ($verify_context['empty_field'] && empty($i)) {
276
+					echo '
263 277
 				<div class="smalltext vv_special">
264 278
 					', $txt['visual_verification_hidden'], ':
265 279
 					<input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value="">
266 280
 				</div>
267 281
 				<br>';
282
+		}
268 283
 
269 284
 		// Do the actual stuff - image first?
270 285
 		if ($i == 0 && $verify_context['show_visual'])
271 286
 		{
272
-			if ($context['use_graphic_library'])
273
-				echo '
287
+			if ($context['use_graphic_library']) {
288
+							echo '
274 289
 				<img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">';
275
-			else
276
-				echo '
290
+			} else {
291
+							echo '
277 292
 				<img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1">
278 293
 				<img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2">
279 294
 				<img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3">
280 295
 				<img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4">
281 296
 				<img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5">
282 297
 				<img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">';
298
+			}
283 299
 
284 300
 			echo '
285 301
 				<div class="smalltext" style="margin: 4px 0 8px 0;">
@@ -287,8 +303,7 @@  discard block
 block discarded – undo
287 303
 					', $txt['visual_verification_description'], ':', $display_type != 'quick_reply' ? '<br>' : '', '
288 304
 					<input type="text" name="', $verify_id, '_vv[code]" value="', !empty($verify_context['text_value']) ? $verify_context['text_value'] : '', '" size="30" tabindex="', $context['tabindex']++, '" class="input_text" required>
289 305
 				</div>';
290
-		}
291
-		else
306
+		} else
292 307
 		{
293 308
 			// Where in the question array is this question?
294 309
 			$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;
@@ -300,21 +315,24 @@  discard block
 block discarded – undo
300 315
 				</div>';
301 316
 		}
302 317
 
303
-		if ($display_type != 'single')
304
-			echo '
318
+		if ($display_type != 'single') {
319
+					echo '
305 320
 			</div>';
321
+		}
306 322
 
307 323
 		// If we were displaying just one and we did it, break.
308
-		if ($display_type == 'single' && $verify_context['tracking'] == $i)
309
-			break;
324
+		if ($display_type == 'single' && $verify_context['tracking'] == $i) {
325
+					break;
326
+		}
310 327
 	}
311 328
 
312 329
 	// Assume we found something, always,
313 330
 	$verify_context['tracking']++;
314 331
 
315 332
 	// Tell something displaying piecemeal to keep going.
316
-	if ($display_type == 'single')
317
-		return true;
318
-}
333
+	if ($display_type == 'single') {
334
+			return true;
335
+	}
336
+	}
319 337
 
320 338
 ?>
321 339
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/MessageIndex.template.php 1 patch
Braces   +94 added lines, -65 removed lines patch added patch discarded remove patch
@@ -48,17 +48,19 @@  discard block
 block discarded – undo
48 48
 						</a>';
49 49
 
50 50
 			// Has it outstanding posts for approval?
51
-			if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
52
-				echo '
51
+			if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
52
+							echo '
53 53
 						<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
54
+			}
54 55
 
55 56
 			echo '
56 57
 						<p class="board_description">', $board['description'] , '</p>';
57 58
 
58 59
 			// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
59
-			if (!empty($board['moderators']) || !empty($board['moderator_groups']))
60
-				echo '
60
+			if (!empty($board['moderators']) || !empty($board['moderator_groups'])) {
61
+							echo '
61 62
 						<p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
63
+			}
62 64
 
63 65
 			// Show some basic information about the number of posts, etc.
64 66
 			echo '
@@ -70,9 +72,10 @@  discard block
 block discarded – undo
70 72
 					</div>
71 73
 					<div class="lastpost lpr_border">';
72 74
 
73
-			if (!empty($board['last_post']['id']))
74
-				echo '
75
+			if (!empty($board['last_post']['id'])) {
76
+							echo '
75 77
 						<p>', $board['last_post']['last_post_message'], '</p>';
78
+			}
76 79
 			echo '
77 80
 					</div>';
78 81
 
@@ -85,14 +88,16 @@  discard block
 block discarded – undo
85 88
 						id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
86 89
 				foreach ($board['children'] as $child)
87 90
 				{
88
-					if (!$child['is_redirect'])
89
-						$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a  ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
90
-					else
91
-						$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
91
+					if (!$child['is_redirect']) {
92
+											$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a  ' . ($child['new'] ? 'class="new_posts" ' : '') . 'href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
93
+					} else {
94
+											$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
95
+					}
92 96
 
93 97
 					// Has it posts awaiting approval?
94
-					if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
95
-						$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
98
+					if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics'])) {
99
+											$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
100
+					}
96 101
 
97 102
 					$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
98 103
 				}
@@ -111,8 +116,9 @@  discard block
 block discarded – undo
111 116
 	}
112 117
 
113 118
 	// They can only mark read if they are logged in and it's enabled!
114
-	if (!$context['user']['is_logged'])
115
-		unset($context['normal_buttons']['markread']);
119
+	if (!$context['user']['is_logged']) {
120
+			unset($context['normal_buttons']['markread']);
121
+	}
116 122
 
117 123
 	if (!$context['no_topic_listing'])
118 124
 	{
@@ -135,13 +141,15 @@  discard block
 block discarded – undo
135 141
 	<div id="description_board" class="generic_list_wrapper">
136 142
 		<h3>', $context['name'], '</h3>
137 143
 		<p>';
138
-	if ($context['description'] != '')
139
-	echo '
144
+	if ($context['description'] != '') {
145
+		echo '
140 146
 		', $context['description'], '&nbsp;';
147
+	}
141 148
 
142
-	if (!empty($context['moderators']))
143
-	echo '
149
+	if (!empty($context['moderators'])) {
150
+		echo '
144 151
 		', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.';
152
+	}
145 153
 
146 154
 	echo '
147 155
 		</p>
@@ -149,9 +157,10 @@  discard block
 block discarded – undo
149 157
 		}
150 158
 
151 159
 		// If Quick Moderation is enabled start the form.
152
-		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
153
-			echo '
160
+		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
161
+					echo '
154 162
 	<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
163
+		}
155 164
 
156 165
 		echo '
157 166
 		<div id="messageindex">';
@@ -159,10 +168,11 @@  discard block
 block discarded – undo
159 168
 		{
160 169
 		echo '
161 170
 			<div class="information">';
162
-			if ($settings['display_who_viewing'] == 1)
163
-				echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
164
-		else
165
-				echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
171
+			if ($settings['display_who_viewing'] == 1) {
172
+							echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
173
+			} else {
174
+						echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
175
+		}
166 176
 			echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'];
167 177
 
168 178
 		echo '
@@ -181,19 +191,22 @@  discard block
 block discarded – undo
181 191
 					<div class="lastpost">', $context['topics_headers']['last_post'], '</div>';
182 192
 
183 193
 			// Show a "select all" box for quick moderation?
184
-			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
185
-				echo '
194
+			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) {
195
+							echo '
186 196
 					<div class="moderation"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check"></div>';
197
+			}
187 198
 
188 199
 			// If it's on in "image" mode, don't show anything but the column.
189
-			elseif (!empty($context['can_quick_mod']))
190
-				echo '
200
+			elseif (!empty($context['can_quick_mod'])) {
201
+							echo '
191 202
 					<div class="moderation">&nbsp;</div>';
203
+			}
192 204
 		}
193 205
 		// No topics.... just say, "sorry bub".
194
-		else
195
-			echo '
206
+		else {
207
+					echo '
196 208
 					<h3 class="titlebg">', $txt['topic_alert_none'], '</h3>';
209
+		}
197 210
 
198 211
 		echo '
199 212
 		</div>';
@@ -225,21 +238,26 @@  discard block
 block discarded – undo
225 238
 			// Now we handle the icons
226 239
 			echo '
227 240
 							<div class="icons floatright">';
228
-			if ($topic['is_watched'])
229
-				echo '
241
+			if ($topic['is_watched']) {
242
+							echo '
230 243
 								<span class="generic_icons watch" title="', $txt['watching_this_topic'], '"></span>';
231
-			if ($topic['is_locked'])
232
-				echo '
244
+			}
245
+			if ($topic['is_locked']) {
246
+							echo '
233 247
 								<span class="generic_icons lock"></span>';
234
-			if ($topic['is_sticky'])
235
-				echo '
248
+			}
249
+			if ($topic['is_sticky']) {
250
+							echo '
236 251
 								<span class="generic_icons sticky"></span>';
237
-			if ($topic['is_redirect'])
238
-				echo '
252
+			}
253
+			if ($topic['is_redirect']) {
254
+							echo '
239 255
 								<span class="generic_icons move"></span>';
240
-			if ($topic['is_poll'])
241
-				echo '
256
+			}
257
+			if ($topic['is_poll']) {
258
+							echo '
242 259
 								<span class="generic_icons poll"></span>';
260
+			}
243 261
 			echo '
244 262
 							</div>';
245 263
 
@@ -265,26 +283,31 @@  discard block
 block discarded – undo
265 283
 			{
266 284
 				echo '
267 285
 					<div class="moderation">';
268
-				if ($options['display_quick_mod'] == 1)
269
-					echo '
286
+				if ($options['display_quick_mod'] == 1) {
287
+									echo '
270 288
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">';
271
-				else
289
+				} else
272 290
 				{
273 291
 					// Check permissions on each and show only the ones they are allowed to use.
274
-					if ($topic['quick_mod']['remove'])
275
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>';
292
+					if ($topic['quick_mod']['remove']) {
293
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>';
294
+					}
276 295
 
277
-					if ($topic['quick_mod']['lock'])
278
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>';
296
+					if ($topic['quick_mod']['lock']) {
297
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>';
298
+					}
279 299
 
280
-					if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
281
-						echo '<br>';
300
+					if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
301
+											echo '<br>';
302
+					}
282 303
 
283
-					if ($topic['quick_mod']['sticky'])
284
-						echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>';
304
+					if ($topic['quick_mod']['sticky']) {
305
+											echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';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>';
306
+					}
285 307
 
286
-					if ($topic['quick_mod']['move'])
287
-						echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
308
+					if ($topic['quick_mod']['move']) {
309
+											echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
310
+					}
288 311
 				}
289 312
 				echo '
290 313
 					</div>';
@@ -302,18 +325,20 @@  discard block
 block discarded – undo
302 325
 					<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
303 326
 						<option value="">--------</option>';
304 327
 
305
-			foreach ($context['qmod_actions'] as $qmod_action)
306
-				if ($context['can_' . $qmod_action])
328
+			foreach ($context['qmod_actions'] as $qmod_action) {
329
+							if ($context['can_' . $qmod_action])
307 330
 					echo '
308 331
 						<option value="' . $qmod_action . '">' . $txt['quick_mod_'  . $qmod_action] . '</option>';
332
+			}
309 333
 
310 334
 			echo '
311 335
 					</select>';
312 336
 
313 337
 			// Show a list of boards they can move the topic to.
314
-			if ($context['can_move'])
315
-				echo '
338
+			if ($context['can_move']) {
339
+							echo '
316 340
 			<span id="quick_mod_jump_to">&nbsp;</span>';
341
+			}
317 342
 
318 343
 			echo '
319 344
 					<input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction">
@@ -324,10 +349,11 @@  discard block
 block discarded – undo
324 349
 	</div>';
325 350
 
326 351
 		// Finish off the form - again.
327
-		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
328
-			echo '
352
+		if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) {
353
+					echo '
329 354
 	<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
330 355
 	</form>';
356
+		}
331 357
 
332 358
 	// Mobile action buttons (bottom)
333 359
 	echo '
@@ -346,8 +372,8 @@  discard block
 block discarded – undo
346 372
 	// Show breadcrumbs at the bottom too.
347 373
 	theme_linktree();
348 374
 
349
-	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
350
-		echo '
375
+	if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
376
+			echo '
351 377
 			<script>
352 378
 				if (typeof(window.XMLHttpRequest) != "undefined")
353 379
 					aJumpTo[aJumpTo.length] = new JumpTo({
@@ -366,6 +392,7 @@  discard block
 block discarded – undo
366 392
 						sCustomName: "move_to"
367 393
 					});
368 394
 			</script>';
395
+	}
369 396
 
370 397
 	// Javascript for inline editing.
371 398
 	echo '
@@ -401,8 +428,8 @@  discard block
 block discarded – undo
401 428
 		<div class="information">
402 429
 			<p class="floatright" id="message_index_jump_to">&nbsp;</p>';
403 430
 
404
-	if (empty($context['no_topic_listing']))
405
-		echo '
431
+	if (empty($context['no_topic_listing'])) {
432
+			echo '
406 433
 			<p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
407 434
 				<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="" class="centericon"> ' . $txt['participation_caption'] . '<br>' : '', '
408 435
 				'. ($modSettings['pollMode'] == '1' ? '<span class="generic_icons poll centericon"></span> ' . $txt['poll'] : '') . '<br>
@@ -412,9 +439,10 @@  discard block
 block discarded – undo
412 439
 				<span class="generic_icons lock centericon"></span> ' . $txt['locked_topic'] . '<br>
413 440
 				<span class="generic_icons sticky centericon"></span> ' . $txt['sticky_topic'] . '<br>
414 441
 			</p>';
442
+	}
415 443
 
416
-	if (!empty($context['jump_to']))
417
-		echo '
444
+	if (!empty($context['jump_to'])) {
445
+			echo '
418 446
 			<script>
419 447
 				if (typeof(window.XMLHttpRequest) != "undefined")
420 448
 					aJumpTo[aJumpTo.length] = new JumpTo({
@@ -430,6 +458,7 @@  discard block
 block discarded – undo
430 458
 						sGoButtonLabel: "', $txt['quick_mod_go'], '"
431 459
 					});
432 460
 			</script>';
461
+	}
433 462
 
434 463
 	echo '
435 464
 			<br class="clear">
Please login to merge, or discard this patch.
Themes/default/Search.template.php 1 patch
Braces   +85 added lines, -60 removed lines patch added patch discarded remove patch
@@ -25,13 +25,15 @@  discard block
 block discarded – undo
25 25
 			</h3>
26 26
 		</div>';
27 27
 
28
-	if (!empty($context['search_errors']))
29
-		echo '
28
+	if (!empty($context['search_errors'])) {
29
+			echo '
30 30
 		<div class="errorbox">', implode('<br>', $context['search_errors']['messages']), '</div>';
31
+	}
31 32
 
32
-	if (!empty($context['search_ignored']))
33
-		echo '
33
+	if (!empty($context['search_ignored'])) {
34
+			echo '
34 35
 		<p class="noticebox">', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
36
+	}
35 37
 
36 38
 	echo '
37 39
 		<fieldset id="advanced_search">
@@ -43,9 +45,10 @@  discard block
 block discarded – undo
43 45
 					<dd>
44 46
 						<input type="search" name="search" id="searchfor" ', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' maxlength="', $context['search_string_limit'], '" size="40" class="input_text">';
45 47
 
46
-	if (empty($modSettings['search_simple_fulltext']))
47
-		echo '
48
+	if (empty($modSettings['search_simple_fulltext'])) {
49
+			echo '
48 50
 						<em class="smalltext">', $txt['search_example'], '</em>';
51
+	}
49 52
 
50 53
 	echo '
51 54
 					</dd>
@@ -112,11 +115,12 @@  discard block
 block discarded – undo
112 115
 	}
113 116
 
114 117
 	// If $context['search_params']['topic'] is set, that means we're searching just one topic.
115
-	if (!empty($context['search_params']['topic']))
116
-		echo '
118
+	if (!empty($context['search_params']['topic'])) {
119
+			echo '
117 120
 				<p>', $txt['search_specific_topic'], ' &quot;', $context['search_topic']['link'], '&quot;.</p>
118 121
 				<input type="hidden" name="topic" value="', $context['search_topic']['id'], '">
119 122
 				<input type="submit" name="b_search" value="', $txt['search'], '" class="button_submit">';
123
+	}
120 124
 
121 125
 	echo '
122 126
 			</div>
@@ -147,14 +151,15 @@  discard block
 block discarded – undo
147 151
 
148 152
 			foreach ($category['boards'] as $board)
149 153
 			{
150
-				if ($i == $limit)
151
-					echo '
154
+				if ($i == $limit) {
155
+									echo '
152 156
 							</ul>
153 157
 						</li>
154 158
 					</ul>
155 159
 					<ul class="ignoreboards floatright">
156 160
 						<li class="category">
157 161
 							<ul>';
162
+				}
158 163
 
159 164
 				echo '
160 165
 								<li class="board">
@@ -242,13 +247,15 @@  discard block
 block discarded – undo
242 247
 		<div class="roundframe">';
243 248
 
244 249
 		// Did they make any typos or mistakes, perhaps?
245
-		if (isset($context['did_you_mean']))
246
-			echo '
250
+		if (isset($context['did_you_mean'])) {
251
+					echo '
247 252
 			<p>', $txt['search_did_you_mean'], ' <a href="', $scripturl, '?action=search2;params=', $context['did_you_mean_params'], '">', $context['did_you_mean'], '</a>.</p>';
253
+		}
248 254
 
249
-		if (!empty($context['search_ignored']))
250
-			echo '
255
+		if (!empty($context['search_ignored'])) {
256
+					echo '
251 257
 			<p>', $txt['search_warning_ignored_word' . (count($context['search_ignored']) == 1 ? '' : 's')], ': ', implode(', ', $context['search_ignored']), '</p>';
258
+		}
252 259
 
253 260
 		echo '
254 261
 			<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
@@ -270,10 +277,11 @@  discard block
 block discarded – undo
270 277
 					<input type="hidden" name="maxage" value="', !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999', '">
271 278
 					<input type="hidden" name="sort" value="', !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance', '">
272 279
 				</div>';
273
-		if (!empty($context['search_params']['brd']))
274
-			foreach ($context['search_params']['brd'] as $board_id)
280
+		if (!empty($context['search_params']['brd'])) {
281
+					foreach ($context['search_params']['brd'] as $board_id)
275 282
 				echo '
276 283
 				<input type="hidden" name="brd[', $board_id, ']" value="', $board_id, '">';
284
+		}
277 285
 
278 286
 		echo '
279 287
 			</form>
@@ -284,17 +292,19 @@  discard block
 block discarded – undo
284 292
 	if ($context['compact'])
285 293
 	{
286 294
 		// Quick moderation set to checkboxes? Oh, how fun :/.
287
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
288
-			echo '
295
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
296
+					echo '
289 297
 	<form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="topicForm">';
298
+		}
290 299
 
291 300
 	echo '
292 301
 		<div class="cat_bar">
293 302
 			<h3 class="catbg">
294 303
 				<span class="floatright">';
295
-					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
296
-					echo '
304
+					if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
305
+										echo '
297 306
 							<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check">';
307
+					}
298 308
 				echo '
299 309
 				</span>
300 310
 				<span class="generic_icons filter"></span>&nbsp;', $txt['mlist_search_results'],':&nbsp;',$context['search_params']['search'],'
@@ -302,14 +312,15 @@  discard block
 block discarded – undo
302 312
 		</div>';
303 313
 
304 314
 		// was anything even found?
305
-		if (!empty($context['topics']))
306
-		echo'
315
+		if (!empty($context['topics'])) {
316
+				echo'
307 317
 		<div class="pagesection">
308 318
 			<span>', $context['page_index'], '</span>
309 319
 		</div>';
310
-		else
311
-			echo '
320
+		} else {
321
+					echo '
312 322
 			<div class="roundframe">', $txt['find_no_results'], '</div>';
323
+		}
313 324
 
314 325
 		// while we have results to show ...
315 326
 		while ($topic = $context['get_topics']())
@@ -337,38 +348,43 @@  discard block
 block discarded – undo
337 348
 					{
338 349
 						echo '
339 350
 						<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check">';
340
-					}
341
-					else
351
+					} else
342 352
 					{
343
-						if ($topic['quick_mod']['remove'])
344
-							echo '
353
+						if ($topic['quick_mod']['remove']) {
354
+													echo '
345 355
 						<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>';
356
+						}
346 357
 
347
-						if ($topic['quick_mod']['lock'])
348
-							echo '
358
+						if ($topic['quick_mod']['lock']) {
359
+													echo '
349 360
 						<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>';
361
+						}
350 362
 
351
-						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
352
-							echo '
363
+						if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
364
+													echo '
353 365
 						<br>';
366
+						}
354 367
 
355
-						if ($topic['quick_mod']['sticky'])
356
-							echo '
368
+						if ($topic['quick_mod']['sticky']) {
369
+													echo '
357 370
 						<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>';
371
+						}
358 372
 
359
-						if ($topic['quick_mod']['move'])
360
-							echo '
373
+						if ($topic['quick_mod']['move']) {
374
+													echo '
361 375
 						<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><span class="generic_icons move" title="', $txt['move_topic'], '"></span></a>';
376
+						}
362 377
 					}
363 378
 
364 379
 					echo '
365 380
 					</div>';
366 381
 				}
367 382
 
368
-				if ($message['body_highlighted'] != '')
369
-					echo '
383
+				if ($message['body_highlighted'] != '') {
384
+									echo '
370 385
 					<br class="clear">
371 386
 					<div class="list_posts double_height">', $message['body_highlighted'], '</div>';
387
+				}
372 388
 			}
373 389
 
374 390
 			echo '
@@ -376,11 +392,12 @@  discard block
 block discarded – undo
376 392
 			</div>';
377 393
 
378 394
 		}
379
-		if (!empty($context['topics']))
380
-		echo '
395
+		if (!empty($context['topics'])) {
396
+				echo '
381 397
 		<div class="pagesection">
382 398
 			<span>', $context['page_index'], '</span>
383 399
 		</div>';
400
+		}
384 401
 
385 402
 		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
386 403
 		{
@@ -390,17 +407,19 @@  discard block
 block discarded – undo
390 407
 					<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
391 408
 						<option value="">--------</option>';
392 409
 
393
-			foreach ($context['qmod_actions'] as $qmod_action)
394
-				if ($context['can_' . $qmod_action])
410
+			foreach ($context['qmod_actions'] as $qmod_action) {
411
+							if ($context['can_' . $qmod_action])
395 412
 					echo '
396 413
 							<option value="' . $qmod_action . '">' . $txt['quick_mod_'  . $qmod_action] . '</option>';
414
+			}
397 415
 
398 416
 			echo '
399 417
 					</select>';
400 418
 
401
-			if ($context['can_move'])
402
-				echo '
419
+			if ($context['can_move']) {
420
+							echo '
403 421
 				<span id="quick_mod_jump_to">&nbsp;</span>';
422
+			}
404 423
 
405 424
 			echo '
406 425
 					<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search2;params=' . $context['params'], '">
@@ -410,13 +429,13 @@  discard block
 block discarded – undo
410 429
 		}
411 430
 
412 431
 
413
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
414
-			echo '
432
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) {
433
+					echo '
415 434
 			<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
416 435
 		</form>';
436
+		}
417 437
 
418
-	}
419
-	else
438
+	} else
420 439
 	{
421 440
 		echo '
422 441
 		<div class="cat_bar">
@@ -428,9 +447,10 @@  discard block
 block discarded – undo
428 447
 			<span>', $context['page_index'], '</span>
429 448
 		</div>';
430 449
 
431
-		if (empty($context['topics']))
432
-			echo '
450
+		if (empty($context['topics'])) {
451
+					echo '
433 452
 		<div class="information">(', $txt['search_no_results'], ')</div>';
453
+		}
434 454
 
435 455
 		while ($topic = $context['get_topics']())
436 456
 		{
@@ -445,23 +465,27 @@  discard block
 block discarded – undo
445 465
 					</div>
446 466
 					<div class="list_posts">', $message['body_highlighted'], '</div>';
447 467
 
448
-			if ($topic['can_reply'])
449
-				echo '
468
+			if ($topic['can_reply']) {
469
+							echo '
450 470
 						<ul class="quickbuttons">';
471
+			}
451 472
 
452 473
 				// If they *can* reply?
453
-			if ($topic['can_reply'])
454
-				echo '
474
+			if ($topic['can_reply']) {
475
+							echo '
455 476
 							<li><a href="', $scripturl . '?action=post;topic=' . $topic['id'] . '.' . $message['start'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>';
477
+			}
456 478
 
457 479
 				// If they *can* quote?
458
-			if ($topic['can_quote'])
459
-				echo '
480
+			if ($topic['can_quote']) {
481
+							echo '
460 482
 							<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>';
483
+			}
461 484
 
462
-			if ($topic['can_reply'])
463
-				echo '
485
+			if ($topic['can_reply']) {
486
+							echo '
464 487
 						</ul>';
488
+			}
465 489
 			echo '
466 490
 					<br class="clear">
467 491
 				</div>';
@@ -480,8 +504,8 @@  discard block
 block discarded – undo
480 504
 		<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
481 505
 		<script>';
482 506
 
483
-	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move'])
484
-		echo '
507
+	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
508
+			echo '
485 509
 				if (typeof(window.XMLHttpRequest) != "undefined")
486 510
 					aJumpTo[aJumpTo.length] = new JumpTo({
487 511
 						sContainerId: "quick_mod_jump_to",
@@ -496,6 +520,7 @@  discard block
 block discarded – undo
496 520
 						bDisabled: true,
497 521
 						sCustomName: "move_to"
498 522
 					});';
523
+	}
499 524
 
500 525
 	echo '
501 526
 			if (typeof(window.XMLHttpRequest) != "undefined")
Please login to merge, or discard this patch.
Themes/default/ManageBans.template.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,9 +26,10 @@  discard block
 block discarded – undo
26 26
 				</h3>
27 27
 			</div>';
28 28
 
29
-	if ($context['ban']['is_new'])
30
-		echo '
29
+	if ($context['ban']['is_new']) {
30
+			echo '
31 31
 			<div class="information noup">', $txt['ban_add_notes'], '</div>';
32
+	}
32 33
 
33 34
 	// If there were errors creating the ban, show them.
34 35
 	if (!empty($context['error_messages']))
@@ -38,9 +39,10 @@  discard block
 block discarded – undo
38 39
 				<strong>', $txt['ban_errors_detected'], '</strong>
39 40
 				<ul>';
40 41
 
41
-		foreach ($context['error_messages'] as $error)
42
-			echo '
42
+		foreach ($context['error_messages'] as $error) {
43
+					echo '
43 44
 					<li class="error">', $error, '</li>';
45
+		}
44 46
 
45 47
 		echo '
46 48
 				</ul>
@@ -57,8 +59,8 @@  discard block
 block discarded – undo
57 59
 					<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60" class="input_text">
58 60
 				</dd>';
59 61
 
60
-	if (isset($context['ban']['reason']))
61
-		echo '
62
+	if (isset($context['ban']['reason'])) {
63
+			echo '
62 64
 				<dt>
63 65
 					<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br>
64 66
 					<span class="smalltext">', $txt['ban_reason_desc'], '</span>
@@ -66,9 +68,10 @@  discard block
 block discarded – undo
66 68
 				<dd>
67 69
 					<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
68 70
 				</dd>';
71
+	}
69 72
 
70
-	if (isset($context['ban']['notes']))
71
-		echo '
73
+	if (isset($context['ban']['notes'])) {
74
+			echo '
72 75
 				<dt>
73 76
 					<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br>
74 77
 					<span class="smalltext">', $txt['ban_notes_desc'], '</span>
@@ -76,6 +79,7 @@  discard block
 block discarded – undo
76 79
 				<dd>
77 80
 					<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
78 81
 				</dd>';
82
+	}
79 83
 
80 84
 	echo '
81 85
 				</dl>
@@ -115,8 +119,8 @@  discard block
 block discarded – undo
115 119
 							<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text">
116 120
 						</dd>';
117 121
 
118
-		if (empty($modSettings['disableHostnameLookup']))
119
-			echo '
122
+		if (empty($modSettings['disableHostnameLookup'])) {
123
+					echo '
120 124
 						<dt>
121 125
 							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '>
122 126
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -124,6 +128,7 @@  discard block
 block discarded – undo
124 128
 						<dd>
125 129
 							<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text">
126 130
 						</dd>';
131
+		}
127 132
 
128 133
 		echo '
129 134
 						<dt>
@@ -153,14 +158,15 @@  discard block
 block discarded – undo
153 158
 					<dl class="settings">';
154 159
 
155 160
 					$count = 0;
156
-					foreach ($ban_ips as $ip)
157
-						echo '
161
+					foreach ($ban_ips as $ip) {
162
+											echo '
158 163
 						<dt>
159 164
 							<input type="checkbox" id="suggestions_', $key ,'_', $count, '" name="ban_suggestions[', $key ,'][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '" class="input_check">
160 165
 						</dt>
161 166
 						<dd>
162 167
 							<label for="suggestions_', $key ,'_', $count++, '">', $ip, '</label>
163 168
 						</dd>';
169
+					}
164 170
 
165 171
 					echo '
166 172
 					</dl>';
@@ -202,8 +208,8 @@  discard block
 block discarded – undo
202 208
 		addLoadEvent(fUpdateStatus);';
203 209
 
204 210
 	// Auto suggest only needed for adding new bans, not editing
205
-	if ($context['ban']['is_new'] && empty($_REQUEST['u']))
206
-		echo '
211
+	if ($context['ban']['is_new'] && empty($_REQUEST['u'])) {
212
+			echo '
207 213
 			var oAddMemberSuggest = new smc_AutoSuggest({
208 214
 			sSelf: \'oAddMemberSuggest\',
209 215
 			sSessionId: smf_session_id,
@@ -221,6 +227,7 @@  discard block
 block discarded – undo
221 227
 			return true;
222 228
 		}
223 229
 		oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');';
230
+	}
224 231
 
225 232
 	echo '
226 233
 		function confirmBan(aForm)
@@ -268,8 +275,8 @@  discard block
 block discarded – undo
268 275
 							<input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text">
269 276
 						</dd>';
270 277
 
271
-				if (empty($modSettings['disableHostnameLookup']))
272
-					echo '
278
+				if (empty($modSettings['disableHostnameLookup'])) {
279
+									echo '
273 280
 							<dt>
274 281
 								<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '>
275 282
 								<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
@@ -277,6 +284,7 @@  discard block
 block discarded – undo
277 284
 							<dd>
278 285
 								<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text">
279 286
 							</dd>';
287
+				}
280 288
 
281 289
 				echo '
282 290
 						<dt>
Please login to merge, or discard this patch.