@@ -79,8 +79,7 @@ discard block |
||
79 | 79 | // Should we populate the form with data from $form_state or the database? |
80 | 80 | if (!isset($form_state['pm_block_user']['block_actions'])) { |
81 | 81 | $block_actions = variable_get('pm_block_user_actions', array()); |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | $block_actions = $form_state['pm_block_user']['block_actions']; |
85 | 84 | } |
86 | 85 | // Work through each rule, adding it as a new element in |
@@ -160,8 +159,7 @@ discard block |
||
160 | 159 | PM_BLOCK_USER_DISALLOW_SENDING => t('Disallow sending message'), |
161 | 160 | ); |
162 | 161 | $default_value = (isset($details['action']) ? $details['action'] : PM_BLOCK_USER_DISALLOW_BLOCKING); |
163 | - } |
|
164 | - else { |
|
162 | + } else { |
|
165 | 163 | // @todo: add whitelist options/default_value here. |
166 | 164 | } |
167 | 165 | $form['action'] = array( |
@@ -239,8 +237,7 @@ discard block |
||
239 | 237 | // builder. |
240 | 238 | if (isset($form_state['values']['block_actions'])) { |
241 | 239 | variable_set('pm_block_user_actions', _pm_block_user_settings_filter($form_state['values']['block_actions'])); |
242 | - } |
|
243 | - else { |
|
240 | + } else { |
|
244 | 241 | variable_set('pm_block_user_actions', array()); |
245 | 242 | } |
246 | 243 | drupal_set_message(t('The configuration options have been saved.')); |
@@ -272,8 +269,7 @@ discard block |
||
272 | 269 | } |
273 | 270 | if (count($matching) > 0) { |
274 | 271 | return $matching; |
275 | - } |
|
276 | - else { |
|
272 | + } else { |
|
277 | 273 | return array_map('_pm_block_user_settings_filter', $settings); |
278 | 274 | } |
279 | 275 | } |
@@ -463,8 +459,7 @@ discard block |
||
463 | 459 | t('Unblock @author', array('@author' => $author->name)), |
464 | 460 | t('Cancel') |
465 | 461 | ); |
466 | - } |
|
467 | - else { |
|
462 | + } else { |
|
468 | 463 | $form['block_action'] = array( |
469 | 464 | '#type' => 'value', |
470 | 465 | '#value' => 'block_user', |
@@ -564,8 +559,7 @@ discard block |
||
564 | 559 | if ($user->uid <> $author->uid) { |
565 | 560 | if ($vars['message']['is_blocked']) { |
566 | 561 | $vars['message_actions']['unblock_author'] = array('title' => t('Unblock author'), 'href' => 'messages/block/'. $author->uid, 'query' => 'destination=messages/view/' . $thread_id); |
567 | - } |
|
568 | - else { |
|
562 | + } else { |
|
569 | 563 | $vars['message_actions']['block_author'] = array('title' => t('Block author'), 'href' => 'messages/block/'. $author->uid, 'query' => 'destination=messages/view/' . $thread_id); |
570 | 564 | } |
571 | 565 | } |
@@ -42,8 +42,7 @@ |
||
42 | 42 | if (is_array($element)) { |
43 | 43 | show($element); |
44 | 44 | return drupal_render($element); |
45 | - } |
|
46 | - else { |
|
45 | + } else { |
|
47 | 46 | // Safe-guard for inappropriate use of render() on flat variables: return |
48 | 47 | // the variable as-is. |
49 | 48 | return $element; |
@@ -131,8 +131,7 @@ discard block |
||
131 | 131 | if ($comment->uid == 0 || strlen($comment->name) == 0) { |
132 | 132 | // @see user_validate_name(). !'0' === TRUE. |
133 | 133 | $comment_document->ss_name = '0'; |
134 | - } |
|
135 | - else { |
|
134 | + } else { |
|
136 | 135 | $comment_document->ss_name = $comment->name; |
137 | 136 | // We want the name to be searchable for keywords. |
138 | 137 | $comment_document->tos_name = $comment->name; |
@@ -318,8 +317,7 @@ discard block |
||
318 | 317 | $solr->deleteByQuery($query); |
319 | 318 | // Log the query used for deletion. |
320 | 319 | watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); |
321 | - } |
|
322 | - catch (Exception $e) { |
|
320 | + } catch (Exception $e) { |
|
323 | 321 | watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); |
324 | 322 | return FALSE; |
325 | 323 | }// try |
@@ -376,8 +374,7 @@ discard block |
||
376 | 374 | $solr->deleteByQuery($query); |
377 | 375 | // Log the query used for deletion. |
378 | 376 | watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); |
379 | - } |
|
380 | - catch (Exception $e) { |
|
377 | + } catch (Exception $e) { |
|
381 | 378 | watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); |
382 | 379 | return FALSE; |
383 | 380 | }// try |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | $nid = $existing_teams[$boinc_team->id]; |
45 | 45 | $success = boincteam_import($boinc_team, $nid); |
46 | 46 | } |
47 | - } |
|
48 | - else { |
|
47 | + } else { |
|
49 | 48 | // Import new teams created by RPC or ops/team_import.php |
50 | 49 | $success = boincteam_import($boinc_team); |
51 | 50 | } |
@@ -77,8 +76,7 @@ discard block |
||
77 | 76 | $node->body = $boincteam->description; |
78 | 77 | $node->teaser = $teaser; |
79 | 78 | $node->uid = boincuser_lookup_uid($boincteam->userid); |
80 | - } |
|
81 | - else { |
|
79 | + } else { |
|
82 | 80 | // Construct the team as a new node |
83 | 81 | $node = array( |
84 | 82 | 'type' => 'team', |
@@ -144,13 +144,11 @@ discard block |
||
144 | 144 | '@pages' => format_plural($pages_generated, 'page', 'pages'), |
145 | 145 | ) |
146 | 146 | )); |
147 | - } |
|
148 | - else { |
|
147 | + } else { |
|
149 | 148 | if ($option) { |
150 | 149 | drupal_set_message(t('The @specified page already exists.', |
151 | 150 | array('@specified' => $option)), 'warning'); |
152 | - } |
|
153 | - else { |
|
151 | + } else { |
|
154 | 152 | drupal_set_message(t('All pages already exist, so none can be recreated |
155 | 153 | automatically.'), 'warning'); |
156 | 154 | } |
@@ -169,8 +167,7 @@ discard block |
||
169 | 167 | 'help', |
170 | 168 | // 'about', |
171 | 169 | ); |
172 | - } |
|
173 | - elseif (!is_array($pages)) { |
|
170 | + } elseif (!is_array($pages)) { |
|
174 | 171 | $pages = array($pages); |
175 | 172 | } |
176 | 173 | $pages_generated = array(); |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | if (module_exists('pathauto')) { |
58 | 58 | module_load_include('inc', 'pathauto', 'pathauto'); |
59 | 59 | $node['path'] = pathauto_cleanstring($boincteam->name); |
60 | - } |
|
61 | - else { |
|
60 | + } else { |
|
62 | 61 | echo 'Pathauto module is required!'; |
63 | 62 | exit; |
64 | 63 | } |
@@ -77,7 +76,9 @@ discard block |
||
77 | 76 | // Determine team membership |
78 | 77 | db_set_active('boinc'); |
79 | 78 | $boincteam_member_ids = array(); |
80 | - while ($boincuser = db_fetch_object($boincteam_members)) $boincteam_member_ids[] = $boincuser->id; |
|
79 | + while ($boincuser = db_fetch_object($boincteam_members)) { |
|
80 | + $boincteam_member_ids[] = $boincuser->id; |
|
81 | + } |
|
81 | 82 | db_set_active('default'); |
82 | 83 | if ($boincteam_member_ids) { |
83 | 84 | $team_members = db_query('SELECT uid FROM {boincuser} WHERE boinc_id IN(%s)', implode(',', $boincteam_member_ids)); |
@@ -220,8 +220,7 @@ discard block |
||
220 | 220 | if (!$values['boinc_translate_transifex_pass']) { |
221 | 221 | if (!variable_get('boinc_translate_transifex_pass', '')) { |
222 | 222 | form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
223 | - } |
|
224 | - else { |
|
223 | + } else { |
|
225 | 224 | unset($form_state['values']['boinc_translate_transifex_pass']); |
226 | 225 | } |
227 | 226 | } |
@@ -260,8 +259,7 @@ discard block |
||
260 | 259 | 'boinc_translate_transifex_pass', |
261 | 260 | t('Transifex authentication failed.') |
262 | 261 | ); |
263 | - } |
|
264 | - else { |
|
262 | + } else { |
|
265 | 263 | $authenticated = TRUE; |
266 | 264 | } |
267 | 265 | } |
@@ -278,14 +276,12 @@ discard block |
||
278 | 276 | ); |
279 | 277 | if ($project_name AND $project_resources) { |
280 | 278 | $transifex_resources[$project_name] = $project_resources; |
281 | - } |
|
282 | - elseif ($project_name AND !$project_resources) { |
|
279 | + } elseif ($project_name AND !$project_resources) { |
|
283 | 280 | drupal_set_message( |
284 | 281 | t('No project-specific resources were provided'), |
285 | 282 | 'warning' |
286 | 283 | ); |
287 | - } |
|
288 | - elseif ($project_resources AND !$project_name) { |
|
284 | + } elseif ($project_resources AND !$project_name) { |
|
289 | 285 | drupal_set_message( |
290 | 286 | t('No project-specific Transifex project name was provided'), |
291 | 287 | 'warning' |
@@ -71,16 +71,14 @@ discard block |
||
71 | 71 | unset($account->roles[$unrestricted_role]); |
72 | 72 | } |
73 | 73 | user_save($account, array('roles' => $account->roles)); |
74 | - } |
|
75 | - elseif ($account->boincuser_total_credit >= $min_credit_to_post) { |
|
74 | + } elseif ($account->boincuser_total_credit >= $min_credit_to_post) { |
|
76 | 75 | if (!isset($account->roles[$unrestricted_role])) { |
77 | 76 | // This user is now above the credit threshold and is allowed full |
78 | 77 | // privileges |
79 | 78 | $account->roles[$unrestricted_role] = 'verified contributor'; |
80 | 79 | user_save($account, array('roles' => $account->roles)); |
81 | 80 | } |
82 | - } |
|
83 | - else { |
|
81 | + } else { |
|
84 | 82 | drupal_set_message(bts( |
85 | 83 | 'You must earn @count more credits to be able to post comments on this site.', |
86 | 84 | array('@count' => $min_credit_to_post - $account->boincuser_total_credit) |
@@ -164,12 +162,10 @@ discard block |
||
164 | 162 | if ($never_been_picked) { |
165 | 163 | // Allow users who have been previously selected |
166 | 164 | $never_been_picked = FALSE; |
167 | - } |
|
168 | - elseif ($active_users) { |
|
165 | + } elseif ($active_users) { |
|
169 | 166 | // Allow users who are not even active (getting desperate) |
170 | 167 | $active_users = FALSE; |
171 | - } |
|
172 | - else { |
|
168 | + } else { |
|
173 | 169 | // Process failed... |
174 | 170 | return FALSE; |
175 | 171 | } |
@@ -257,8 +253,7 @@ discard block |
||
257 | 253 | $dir = "boinc_{$type}_dir"; |
258 | 254 | if ($include_dir = variable_get("boinc_{$type}_dir", '')) { |
259 | 255 | return $include_dir; |
260 | - } |
|
261 | - else { |
|
256 | + } else { |
|
262 | 257 | // Don't show errors on blacklisted pages |
263 | 258 | $page_blacklist = array( |
264 | 259 | 'admin/boinc/environment' |
@@ -271,8 +266,7 @@ discard block |
||
271 | 266 | drupal_set_message(t('The BOINC environment is not configured. Please |
272 | 267 | !configure_it', array('!configure_it' => l(t('configure it now'), |
273 | 268 | 'admin/boinc/environment'))), 'warning', FALSE); |
274 | - } |
|
275 | - else { |
|
269 | + } else { |
|
276 | 270 | drupal_set_message(t('There is a problem with the site. Please contact |
277 | 271 | the system administrator.'), 'error', FALSE); |
278 | 272 | } |
@@ -287,8 +281,7 @@ discard block |
||
287 | 281 | if (!in_array($_GET['q'], $redirect_blacklist)) { |
288 | 282 | drupal_goto(''); |
289 | 283 | } |
290 | - } |
|
291 | - else { |
|
284 | + } else { |
|
292 | 285 | // Clear the messages on the environment config page |
293 | 286 | drupal_get_messages(); |
294 | 287 | } |
@@ -307,8 +300,7 @@ discard block |
||
307 | 300 | ); |
308 | 301 | if ($url_config = variable_get('boinc_scheduler_urls', '')) { |
309 | 302 | return explode("\r\n", $url_config); |
310 | - } |
|
311 | - elseif (!in_array($_GET['q'], $page_blacklist)) { |
|
303 | + } elseif (!in_array($_GET['q'], $page_blacklist)) { |
|
312 | 304 | watchdog('boincuser', 'The BOINC scheduling server settings are not yet |
313 | 305 | configured. Please !verify for the settings to become effective.', |
314 | 306 | array('!verify' => l(t('verify the default values') . ' <strong>' . |
@@ -157,13 +157,11 @@ discard block |
||
157 | 157 | if (!$values['boinc_root_dir']) { |
158 | 158 | form_set_error('boinc_root_dir', t('BOINC project root directory must be |
159 | 159 | defined!')); |
160 | - } |
|
161 | - elseif (!is_dir($values['boinc_root_dir'])) { |
|
160 | + } elseif (!is_dir($values['boinc_root_dir'])) { |
|
162 | 161 | form_set_error('boinc_root_dir', t('BOINC project root not found at %directory', |
163 | 162 | array('%directory' => $values['boinc_root_dir']) |
164 | 163 | )); |
165 | - } |
|
166 | - else { |
|
164 | + } else { |
|
167 | 165 | // By default, try to automatically set specific directories from the root |
168 | 166 | if (!$values['boinc_config_xml_dir']) { |
169 | 167 | $values['boinc_config_xml_dir'] = $values['boinc_root_dir']; |
@@ -285,8 +283,7 @@ discard block |
||
285 | 283 | if (!$values['boinc_scheduler_urls']) { |
286 | 284 | form_set_error('boinc_scheduler_urls', t('At least one scheduling server |
287 | 285 | URL must be specified.')); |
288 | - } |
|
289 | - else { |
|
286 | + } else { |
|
290 | 287 | $urls = explode("\r\n", $values['boinc_scheduler_urls']); |
291 | 288 | foreach ($urls as $key => $url) { |
292 | 289 | if (!$url) { |