Completed
Pull Request — master (#1795)
by Christian
09:22
created
default/boinc/modules/contrib/privatemsg/pm_block_user/pm_block_user.module 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
   }
Please login to merge, or discard this patch.
sites/default/boinc/modules/node_comment_block/node_comment_block.module 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
modules/boinc_solr_search/boinc_solr_comments/boinc_solr_comments.module 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/includes/boincteam.forms.inc 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -135,8 +135,7 @@  discard block
 block discarded – undo
135 135
   
136 136
   if (!$name) {
137 137
     form_set_error('name', bts('Team name is required.'));
138
-  }
139
-  else {
138
+  } else {
140 139
     require_boinc('boinc_db');
141 140
     if (BoincTeam::lookup_name($name)) {
142 141
       form_set_error('name', bts('A team named "@name" already exists.',
@@ -177,8 +176,7 @@  discard block
 block discarded – undo
177 176
   if ($boinc_team) {
178 177
     $boinc_user = BoincUser::lookup_id($account->boincuser_id);
179 178
     user_join_team($boinc_team, $boinc_user);
180
-  }
181
-  else {
179
+  } else {
182 180
     drupal_set_message(t('Teams cannot be created at this time. Please 
183 181
       contact the @project administrators!', array('@project' => PROJECT)));
184 182
     watchdog('BOINC team', 'BOINC teams cannot be created for an unknown
@@ -212,8 +210,7 @@  discard block
 block discarded – undo
212 210
   if (module_exists('pathauto')) {
213 211
     module_load_include('inc', 'pathauto', 'pathauto');
214 212
     $node['path'] = pathauto_cleanstring($values['name']);
215
-  }
216
-  else {
213
+  } else {
217 214
     drupal_set_message(t('Teams cannot be created at this time. Please 
218 215
       contact the @project administrators!', array('@project' => PROJECT)));
219 216
     watchdog('BOINC team', 'BOINC teams require the Pathauto module. Teams
@@ -381,8 +378,7 @@  discard block
 block discarded – undo
381 378
     $form['form control tabs'] = array(
382 379
       '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
383 380
     );
384
-  }
385
-  else {
381
+  } else {
386 382
     $form['description'] = array(
387 383
       '#prefix' => '<div class="form-item"><label>' . bts('Description') . ':</label></div><div class="form-item">',
388 384
       '#value' => $default['description'],
@@ -412,12 +408,10 @@  discard block
 block discarded – undo
412 408
   
413 409
   if ($form_state['storage']['is_boinc_wide']) {
414 410
     form_set_error('none', bts('This team is managed by the BOINC-wide teams system and cannot be updated here.'));
415
-  }
416
-  else {
411
+  } else {
417 412
     if (!$name) {
418 413
       form_set_error('name', bts('Team name is required.'));
419
-    }
420
-    else {
414
+    } else {
421 415
       $team = node_load($form_state['storage']['team_id']);
422 416
       if ($name != $team->title) {
423 417
         // If changing the name ("title" in Drupal terms), check that the new name is available
@@ -558,29 +552,25 @@  discard block
 block discarded – undo
558 552
   
559 553
   if (!$values['email']) {
560 554
     form_set_error('email', bts('Email address is required.'));
561
-  }
562
-  else {
555
+  } else {
563 556
     $account = user_load(array('mail' => $values['email']));
564 557
     if ((!$account) OR ($account->team != $team_id)) {
565 558
       form_set_error('email', bts('There is no user on your team with that email address.'));
566
-    }
567
-    elseif (boincteam_is_founder($team_id, $account->uid)) {
559
+    } elseif (boincteam_is_founder($team_id, $account->uid)) {
568 560
       form_set_error('email', bts('@user is the founder of @team!',
569 561
         array(
570 562
           '@user' => $account->boincuser_name,
571 563
           '@team' => $team->title,
572 564
         )
573 565
       ));
574
-    }
575
-    elseif (boincteam_is_admin($team_id, $account->uid)) {
566
+    } elseif (boincteam_is_admin($team_id, $account->uid)) {
576 567
       form_set_error('email', bts('@user is already an admin of @team.',
577 568
         array(
578 569
           '@user' => $account->boincuser_name,
579 570
           '@team' => $team->title,
580 571
         )
581 572
       ));
582
-    }
583
-    else {
573
+    } else {
584 574
       $form_state['storage']['boincuser_id'] = $account->boincuser_id;
585 575
       $form_state['storage']['boincuser_name'] = $account->boincuser_name;
586 576
     }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/includes/boincteam.helpers.inc 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/boincteam_forum.module 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -387,8 +387,7 @@
 block discarded – undo
387 387
     $team = node_load($nid);
388 388
     $output .= '<p>' . bts('You may create a message board for use by @team',
389 389
       array('@team' => $team->title)) . ':</p>';
390
-  }
391
-  else {
390
+  } else {
392 391
     $output .= '<p>' . bts('This is a team-only message board') . ':</p>';
393 392
   }
394 393
   $output .= '<ul>';
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinccore/boinccore.admin.inc 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -144,13 +144,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincimport/includes/import_team.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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));
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.admin.inc 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -220,8 +220,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.