Completed
Pull Request — release-2.1 (#4166)
by 01
10:19
created
Sources/tasks/GroupReq-Notify.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 			)
38 38
 		);
39 39
 		$moderators = array();
40
-		while ($row = $smcFunc['db_fetch_assoc']($request))
41
-			$moderators[] = $row['id_member'];
40
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
41
+					$moderators[] = $row['id_member'];
42
+		}
42 43
 		$smcFunc['db_free_result']($request);
43 44
 
44 45
 		require_once($sourcedir . '/Subs-Members.php');
@@ -59,11 +60,13 @@  discard block
 block discarded – undo
59 60
 			{
60 61
 				if (!empty($prefs[$mod]['request_group']))
61 62
 				{
62
-					if ($prefs[$mod]['request_group'] & 0x01)
63
-						$data['alert'][] = $mod;
63
+					if ($prefs[$mod]['request_group'] & 0x01) {
64
+											$data['alert'][] = $mod;
65
+					}
64 66
 
65
-					if ($prefs[$mod]['request_group'] & 0x02)
66
-						$data['email'][] = $mod;
67
+					if ($prefs[$mod]['request_group'] & 0x02) {
68
+											$data['email'][] = $mod;
69
+					}
67 70
 				}
68 71
 			}
69 72
 
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.
other/upgrade-helper.php 1 patch
Braces   +90 added lines, -64 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@  discard block
 block discarded – undo
13 13
  * This file contains helper functions for upgrade.php
14 14
  */
15 15
 
16
-if (!defined('SMF_VERSION'))
16
+if (!defined('SMF_VERSION')) {
17 17
 	die('No direct access!');
18
+}
18 19
 
19 20
 /**
20 21
  * Clean the cache using the SMF 2.1 CacheAPI.
@@ -45,8 +46,9 @@  discard block
 block discarded – undo
45 46
 	global $smcFunc;
46 47
 	static $member_groups = array();
47 48
 
48
-	if (!empty($member_groups))
49
-		return $member_groups;
49
+	if (!empty($member_groups)) {
50
+			return $member_groups;
51
+	}
50 52
 
51 53
 	$request = $smcFunc['db_query']('', '
52 54
 		SELECT group_name, id_group
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
 			)
72 74
 		);
73 75
 	}
74
-	while ($row = $smcFunc['db_fetch_row']($request))
75
-		$member_groups[trim($row[0])] = $row[1];
76
+	while ($row = $smcFunc['db_fetch_row']($request)) {
77
+			$member_groups[trim($row[0])] = $row[1];
78
+	}
76 79
 	$smcFunc['db_free_result']($request);
77 80
 
78 81
 	return $member_groups;
@@ -88,8 +91,9 @@  discard block
 block discarded – undo
88 91
 {
89 92
 	global $upcontext, $boarddir, $sourcedir;
90 93
 
91
-	if (empty($files))
92
-		return true;
94
+	if (empty($files)) {
95
+			return true;
96
+	}
93 97
 
94 98
 	$failure = false;
95 99
 	// On linux, it's easy - just use is_writable!
@@ -104,14 +108,16 @@  discard block
 block discarded – undo
104 108
 				@chmod($file, 0755);
105 109
 
106 110
 				// Well, 755 hopefully worked... if not, try 777.
107
-				if (!is_writable($file) && !@chmod($file, 0777))
108
-					$failure = true;
111
+				if (!is_writable($file) && !@chmod($file, 0777)) {
112
+									$failure = true;
113
+				}
109 114
 				// Otherwise remove it as it's good!
110
-				else
111
-					unset($files[$k]);
115
+				else {
116
+									unset($files[$k]);
117
+				}
118
+			} else {
119
+							unset($files[$k]);
112 120
 			}
113
-			else
114
-				unset($files[$k]);
115 121
 		}
116 122
 	}
117 123
 	// Windows is trickier.  Let's try opening for r+...
@@ -122,30 +128,35 @@  discard block
 block discarded – undo
122 128
 		foreach ($files as $k => $file)
123 129
 		{
124 130
 			// Folders can't be opened for write... but the index.php in them can ;).
125
-			if (is_dir($file))
126
-				$file .= '/index.php';
131
+			if (is_dir($file)) {
132
+							$file .= '/index.php';
133
+			}
127 134
 
128 135
 			// Funny enough, chmod actually does do something on windows - it removes the read only attribute.
129 136
 			@chmod($file, 0777);
130 137
 			$fp = @fopen($file, 'r+');
131 138
 
132 139
 			// Hmm, okay, try just for write in that case...
133
-			if (!$fp)
134
-				$fp = @fopen($file, 'w');
140
+			if (!$fp) {
141
+							$fp = @fopen($file, 'w');
142
+			}
135 143
 
136
-			if (!$fp)
137
-				$failure = true;
138
-			else
139
-				unset($files[$k]);
144
+			if (!$fp) {
145
+							$failure = true;
146
+			} else {
147
+							unset($files[$k]);
148
+			}
140 149
 			@fclose($fp);
141 150
 		}
142 151
 	}
143 152
 
144
-	if (empty($files))
145
-		return true;
153
+	if (empty($files)) {
154
+			return true;
155
+	}
146 156
 
147
-	if (!isset($_SERVER))
148
-		return !$failure;
157
+	if (!isset($_SERVER)) {
158
+			return !$failure;
159
+	}
149 160
 
150 161
 	// What still needs to be done?
151 162
 	$upcontext['chmod']['files'] = $files;
@@ -197,36 +208,40 @@  discard block
 block discarded – undo
197 208
 
198 209
 		if (!isset($ftp) || $ftp->error !== false)
199 210
 		{
200
-			if (!isset($ftp))
201
-				$ftp = new ftp_connection(null);
211
+			if (!isset($ftp)) {
212
+							$ftp = new ftp_connection(null);
213
+			}
202 214
 			// Save the error so we can mess with listing...
203
-			elseif ($ftp->error !== false && !isset($upcontext['chmod']['ftp_error']))
204
-				$upcontext['chmod']['ftp_error'] = $ftp->last_message === null ? '' : $ftp->last_message;
215
+			elseif ($ftp->error !== false && !isset($upcontext['chmod']['ftp_error'])) {
216
+							$upcontext['chmod']['ftp_error'] = $ftp->last_message === null ? '' : $ftp->last_message;
217
+			}
205 218
 
206 219
 			list ($username, $detect_path, $found_path) = $ftp->detect_path(dirname(__FILE__));
207 220
 
208
-			if ($found_path || !isset($upcontext['chmod']['path']))
209
-				$upcontext['chmod']['path'] = $detect_path;
221
+			if ($found_path || !isset($upcontext['chmod']['path'])) {
222
+							$upcontext['chmod']['path'] = $detect_path;
223
+			}
210 224
 
211
-			if (!isset($upcontext['chmod']['username']))
212
-				$upcontext['chmod']['username'] = $username;
225
+			if (!isset($upcontext['chmod']['username'])) {
226
+							$upcontext['chmod']['username'] = $username;
227
+			}
213 228
 
214 229
 			// Don't forget the login token.
215 230
 			$upcontext += createToken('login');
216 231
 
217 232
 			return false;
218
-		}
219
-		else
233
+		} else
220 234
 		{
221 235
 			// We want to do a relative path for FTP.
222 236
 			if (!in_array($upcontext['chmod']['path'], array('', '/')))
223 237
 			{
224 238
 				$ftp_root = strtr($boarddir, array($upcontext['chmod']['path'] => ''));
225
-				if (substr($ftp_root, -1) == '/' && ($upcontext['chmod']['path'] == '' || $upcontext['chmod']['path'][0] === '/'))
226
-					$ftp_root = substr($ftp_root, 0, -1);
239
+				if (substr($ftp_root, -1) == '/' && ($upcontext['chmod']['path'] == '' || $upcontext['chmod']['path'][0] === '/')) {
240
+									$ftp_root = substr($ftp_root, 0, -1);
241
+				}
242
+			} else {
243
+							$ftp_root = $boarddir;
227 244
 			}
228
-			else
229
-				$ftp_root = $boarddir;
230 245
 
231 246
 			// Save the info for next time!
232 247
 			$_SESSION['installer_temp_ftp'] = array(
@@ -240,10 +255,12 @@  discard block
 block discarded – undo
240 255
 
241 256
 			foreach ($files as $k => $file)
242 257
 			{
243
-				if (!is_writable($file))
244
-					$ftp->chmod($file, 0755);
245
-				if (!is_writable($file))
246
-					$ftp->chmod($file, 0777);
258
+				if (!is_writable($file)) {
259
+									$ftp->chmod($file, 0755);
260
+				}
261
+				if (!is_writable($file)) {
262
+									$ftp->chmod($file, 0777);
263
+				}
247 264
 
248 265
 				// Assuming that didn't work calculate the path without the boarddir.
249 266
 				if (!is_writable($file))
@@ -252,19 +269,23 @@  discard block
 block discarded – undo
252 269
 					{
253 270
 						$ftp_file = strtr($file, array($_SESSION['installer_temp_ftp']['root'] => ''));
254 271
 						$ftp->chmod($ftp_file, 0755);
255
-						if (!is_writable($file))
256
-							$ftp->chmod($ftp_file, 0777);
272
+						if (!is_writable($file)) {
273
+													$ftp->chmod($ftp_file, 0777);
274
+						}
257 275
 						// Sometimes an extra slash can help...
258 276
 						$ftp_file = '/' . $ftp_file;
259
-						if (!is_writable($file))
260
-							$ftp->chmod($ftp_file, 0755);
261
-						if (!is_writable($file))
262
-							$ftp->chmod($ftp_file, 0777);
277
+						if (!is_writable($file)) {
278
+													$ftp->chmod($ftp_file, 0755);
279
+						}
280
+						if (!is_writable($file)) {
281
+													$ftp->chmod($ftp_file, 0777);
282
+						}
263 283
 					}
264 284
 				}
265 285
 
266
-				if (is_writable($file))
267
-					unset($files[$k]);
286
+				if (is_writable($file)) {
287
+									unset($files[$k]);
288
+				}
268 289
 			}
269 290
 
270 291
 			$ftp->close();
@@ -274,8 +295,9 @@  discard block
 block discarded – undo
274 295
 	// What remains?
275 296
 	$upcontext['chmod']['files'] = $files;
276 297
 
277
-	if (empty($files))
278
-		return true;
298
+	if (empty($files)) {
299
+			return true;
300
+	}
279 301
 
280 302
 	return false;
281 303
 }
@@ -288,8 +310,9 @@  discard block
 block discarded – undo
288 310
  */
289 311
 function quickFileWritable($file)
290 312
 {
291
-	if (is_writable($file))
292
-		return true;
313
+	if (is_writable($file)) {
314
+			return true;
315
+	}
293 316
 
294 317
 	@chmod($file, 0755);
295 318
 
@@ -299,10 +322,11 @@  discard block
 block discarded – undo
299 322
 	foreach ($chmod_values as $val)
300 323
 	{
301 324
 		// If it's writable, break out of the loop
302
-		if (is_writable($file))
303
-			break;
304
-		else
305
-			@chmod($file, $val);
325
+		if (is_writable($file)) {
326
+					break;
327
+		} else {
328
+					@chmod($file, $val);
329
+		}
306 330
 	}
307 331
 
308 332
 	return is_writable($file);
@@ -329,14 +353,16 @@  discard block
 block discarded – undo
329 353
 {
330 354
 	static $fp = null;
331 355
 
332
-	if ($fp === null)
333
-		$fp = fopen('php://stderr', 'wb');
356
+	if ($fp === null) {
357
+			$fp = fopen('php://stderr', 'wb');
358
+	}
334 359
 
335 360
 	fwrite($fp, $message . "\n");
336 361
 
337
-	if ($fatal)
338
-		exit;
339
-}
362
+	if ($fatal) {
363
+			exit;
364
+	}
365
+	}
340 366
 
341 367
 /**
342 368
  * Throws a graphical error message.
Please login to merge, or discard this patch.
Themes/default/GenericControls.template.php 1 patch
Braces   +76 added lines, -58 removed lines patch added patch discarded remove patch
@@ -53,14 +53,15 @@  discard block
 block discarded – undo
53 53
 			foreach ($context['smileys'] as $location => $smileyRows)
54 54
 			{
55 55
 				$countLocations--;
56
-				if ($location == 'postform')
57
-					echo '
56
+				if ($location == 'postform') {
57
+									echo '
58 58
 						dropdown:
59 59
 						{';
60
-				elseif ($location == 'popup')
61
-					echo '
60
+				} elseif ($location == 'popup') {
61
+									echo '
62 62
 						popup:
63 63
 						{';
64
+				}
64 65
 
65 66
 				$numRows = count($smileyRows);
66 67
 				// This is needed because otherwise the editor will remove all the duplicate (empty) keys and leave only 1 additional line
@@ -72,21 +73,22 @@  discard block
 block discarded – undo
72 73
 						echo '
73 74
 								', JavaScriptEscape($smiley['code']), ': ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), empty($smiley['isLast']) ? ',' : '';
74 75
 					}
75
-					if (empty($smileyRow['isLast']) && $numRows != 1)
76
-						echo ',
76
+					if (empty($smileyRow['isLast']) && $numRows != 1) {
77
+											echo ',
77 78
 						\'-', $emptyPlaceholder++, '\': \'\',';
79
+					}
78 80
 				}
79 81
 				echo '
80 82
 						}', $countLocations != 0 ? ',' : '';
81 83
 			}
82 84
 			echo '
83 85
 					}';
84
-		}
85
-		else
86
-			echo ',
86
+		} else {
87
+					echo ',
87 88
 					emoticons:
88 89
 					{},
89 90
 					emoticonsEnabled:false';
91
+		}
90 92
 
91 93
 		if ($context['show_bbc'] && $bbcContainer !== null)
92 94
 		{
@@ -97,15 +99,16 @@  discard block
 block discarded – undo
97 99
 			{
98 100
 				echo implode('|', $buttonRow);
99 101
 				$count_tags--;
100
-				if (!empty($count_tags))
101
-					echo '||';
102
+				if (!empty($count_tags)) {
103
+									echo '||';
104
+				}
102 105
 			}
103 106
 
104 107
 			echo '",';
105
-		}
106
-		else
107
-			echo ',
108
+		} else {
109
+					echo ',
108 110
 					toolbar: "",';
111
+		}
109 112
 
110 113
 		echo '
111 114
 				});
@@ -146,43 +149,48 @@  discard block
 block discarded – undo
146 149
 		</span>';
147 150
 
148 151
 	$tempTab = $context['tabindex'];
149
-	if (!empty($context['drafts_pm_save']))
150
-		$tempTab++;
151
-	elseif (!empty($context['drafts_save']))
152
-		$tempTab++;
153
-	elseif ($editor_context['preview_type'])
154
-		$tempTab++;
155
-	elseif ($context['show_spellchecking'])
156
-		$tempTab++;
152
+	if (!empty($context['drafts_pm_save'])) {
153
+			$tempTab++;
154
+	} elseif (!empty($context['drafts_save'])) {
155
+			$tempTab++;
156
+	} elseif ($editor_context['preview_type']) {
157
+			$tempTab++;
158
+	} elseif ($context['show_spellchecking']) {
159
+			$tempTab++;
160
+	}
157 161
 
158 162
 	$tempTab++;
159 163
 	$context['tabindex'] = $tempTab;
160 164
 
161
-	if (!empty($context['drafts_pm_save']))
162
-		echo '
165
+	if (!empty($context['drafts_pm_save'])) {
166
+			echo '
163 167
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="submitThisOnce(this);" accesskey="d" class="button_submit">
164 168
 		<input type="hidden" id="id_pm_draft" name="id_pm_draft" value="', empty($context['id_pm_draft']) ? 0 : $context['id_pm_draft'], '">';
169
+	}
165 170
 
166
-	if (!empty($context['drafts_save']))
167
-		echo '
171
+	if (!empty($context['drafts_save'])) {
172
+			echo '
168 173
 		<input type="submit" name="save_draft" value="', $txt['draft_save'], '" tabindex="', --$tempTab, '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" class="button_submit">
169 174
 		<input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '">';
175
+	}
170 176
 
171
-	if ($context['show_spellchecking'])
172
-		echo '
177
+	if ($context['show_spellchecking']) {
178
+			echo '
173 179
 		<input type="button" value="', $txt['spell_check'], '" tabindex="', --$tempTab, '" onclick="oEditorHandle_', $editor_id, '.spellCheckStart();" class="button_submit">';
180
+	}
174 181
 
175
-	if ($editor_context['preview_type'])
176
-		echo '
182
+	if ($editor_context['preview_type']) {
183
+			echo '
177 184
 		<input type="submit" name="preview" value="', isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $txt['preview'], '" tabindex="', --$tempTab, '" onclick="', $editor_context['preview_type'] == 2 ? 'return event.ctrlKey || previewPost();' : 'return submitThisOnce(this);', '" accesskey="p" class="button_submit">';
185
+	}
178 186
 
179 187
 
180 188
 	echo '
181 189
 		<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit">';
182 190
 
183 191
 	// Load in the PM autosaver if it's enabled
184
-	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave']))
185
-		echo '
192
+	if (!empty($context['drafts_pm_save']) && !empty($context['drafts_autosave'])) {
193
+			echo '
186 194
 		<span class="righttext padding" style="display: block">
187 195
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon">&nbsp;</span>
188 196
 			<span id="draft_lastautosave" ></span>
@@ -200,10 +208,11 @@  discard block
 block discarded – undo
200 208
 				iFreq: ', (empty($modSettings['drafts_autosave_frequency']) ? 60000 : $modSettings['drafts_autosave_frequency'] * 1000), '
201 209
 			});
202 210
 		</script>';
211
+	}
203 212
 
204 213
 	// Start an instance of the auto saver if its enabled
205
-	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave']))
206
-		echo '
214
+	if (!empty($context['drafts_save']) && !empty($context['drafts_autosave'])) {
215
+			echo '
207 216
 		<span class="righttext padding" style="display: block">
208 217
 			<span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon">&nbsp;</span>
209 218
 			<span id="draft_lastautosave" ></span>
@@ -220,7 +229,8 @@  discard block
 block discarded – undo
220 229
 				iFreq: ', $context['drafts_autosave_frequency'], '
221 230
 			});
222 231
 		</script>';
223
-}
232
+	}
233
+	}
224 234
 
225 235
 /**
226 236
  * This template displays a verification form
@@ -237,51 +247,57 @@  discard block
 block discarded – undo
237 247
 	$verify_context = &$context['controls']['verification'][$verify_id];
238 248
 
239 249
 	// Keep track of where we are.
240
-	if (empty($verify_context['tracking']) || $reset)
241
-		$verify_context['tracking'] = 0;
250
+	if (empty($verify_context['tracking']) || $reset) {
251
+			$verify_context['tracking'] = 0;
252
+	}
242 253
 
243 254
 	// How many items are there to display in total.
244 255
 	$total_items = count($verify_context['questions']) + ($verify_context['show_visual'] || $verify_context['can_recaptcha'] ? 1 : 0);
245 256
 
246 257
 	// If we've gone too far, stop.
247
-	if ($verify_context['tracking'] > $total_items)
248
-		return false;
258
+	if ($verify_context['tracking'] > $total_items) {
259
+			return false;
260
+	}
249 261
 
250 262
 	// Loop through each item to show them.
251 263
 	for ($i = 0; $i < $total_items; $i++)
252 264
 	{
253 265
 		// If we're after a single item only show it if we're in the right place.
254
-		if ($display_type == 'single' && $verify_context['tracking'] != $i)
255
-			continue;
266
+		if ($display_type == 'single' && $verify_context['tracking'] != $i) {
267
+					continue;
268
+		}
256 269
 
257
-		if ($display_type != 'single')
258
-			echo '
270
+		if ($display_type != 'single') {
271
+					echo '
259 272
 			<div id="verification_control_', $i, '" class="verification_control">';
273
+		}
260 274
 
261 275
 		// Display empty field, but only if we have one, and it's the first time.
262
-		if ($verify_context['empty_field'] && empty($i))
263
-			echo '
276
+		if ($verify_context['empty_field'] && empty($i)) {
277
+					echo '
264 278
 				<div class="smalltext vv_special">
265 279
 					', $txt['visual_verification_hidden'], ':
266 280
 					<input type="text" name="', $_SESSION[$verify_id . '_vv']['empty_field'], '" autocomplete="off" size="30" value="">
267 281
 				</div>';
282
+		}
268 283
 
269 284
 		// Do the actual stuff
270 285
 		if ($i == 0 && ($verify_context['show_visual'] || $verify_context['can_recaptcha']))
271 286
 		{
272 287
 			if ($verify_context['show_visual'])
273 288
 			{
274
-				if ($context['use_graphic_library'])
275
-					echo '
289
+				if ($context['use_graphic_library']) {
290
+									echo '
276 291
 				<img src="', $verify_context['image_href'], '" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '">';
277
-				else
278
-					echo '
292
+				} else {
293
+									echo '
279 294
 				<img src="', $verify_context['image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_1">
280 295
 				<img src="', $verify_context['image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_2">
281 296
 				<img src="', $verify_context['image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_3">
282 297
 				<img src="', $verify_context['image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_4">
283 298
 				<img src="', $verify_context['image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_5">
284 299
 				<img src="', $verify_context['image_href'], ';letter=6" alt="', $txt['visual_verification_description'], '" id="verification_image_', $verify_id, '_6">';
300
+				}
285 301
 
286 302
 				echo '
287 303
 				<div class="smalltext" style="margin: 4px 0 8px 0;">
@@ -297,8 +313,7 @@  discard block
 block discarded – undo
297 313
 				<div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div><br>
298 314
 				<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>';
299 315
 			}
300
-		}
301
-		else
316
+		} else
302 317
 		{
303 318
 			// Where in the question array is this question?
304 319
 			$qIndex = $verify_context['show_visual'] ? $i - 1 : $i;
@@ -310,21 +325,24 @@  discard block
 block discarded – undo
310 325
 				</div>';
311 326
 		}
312 327
 
313
-		if ($display_type != 'single')
314
-			echo '
328
+		if ($display_type != 'single') {
329
+					echo '
315 330
 			</div>';
331
+		}
316 332
 
317 333
 		// If we were displaying just one and we did it, break.
318
-		if ($display_type == 'single' && $verify_context['tracking'] == $i)
319
-			break;
334
+		if ($display_type == 'single' && $verify_context['tracking'] == $i) {
335
+					break;
336
+		}
320 337
 	}
321 338
 
322 339
 	// Assume we found something, always,
323 340
 	$verify_context['tracking']++;
324 341
 
325 342
 	// Tell something displaying piecemeal to keep going.
326
-	if ($display_type == 'single')
327
-		return true;
328
-}
343
+	if ($display_type == 'single') {
344
+			return true;
345
+	}
346
+	}
329 347
 
330 348
 ?>
331 349
\ No newline at end of file
Please login to merge, or discard this patch.
custom_avatar/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
attachments/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
Smileys/fugue/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Smileys/aaron/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Smileys/akyhne/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.