Completed
Pull Request — master (#1795)
by Christian
11:36
created
drupal/sites/default/boinc/modules/boincuser/includes/boincuser.helpers.inc 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -71,16 +71,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>' . 
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincuser/boincuser.admin.inc 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -157,13 +157,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
drupal/sites/default/boinc/themes/boinc/template.php 1 patch
Braces   +18 added lines, -21 removed lines patch added patch discarded remove patch
@@ -86,9 +86,15 @@  discard block
 block discarded – undo
86 86
   $i = 1;
87 87
   foreach ($links as $key => $link) {
88 88
     $classes = array($key);
89
-    if (strpos($key, 'active-trail')) $classes[] = 'active';
90
-    if ($i == 1) $classes[] = 'first';
91
-    if ($i == $item_count) $classes[] = 'last';
89
+    if (strpos($key, 'active-trail')) {
90
+        $classes[] = 'active';
91
+    }
92
+    if ($i == 1) {
93
+        $classes[] = 'first';
94
+    }
95
+    if ($i == $item_count) {
96
+        $classes[] = 'last';
97
+    }
92 98
     $html .= '<li class="' . implode(' ', $classes) .'">';
93 99
     if ($link['title'] == 'Home') {
94 100
       $link['title'] = bts('Home');
@@ -129,8 +135,7 @@  discard block
 block discarded – undo
129 135
   AND strpos($link, 'Edit Panel')) {
130 136
     // Remove Edit Panel tab
131 137
     return '';
132
-  }
133
-  else {
138
+  } else {
134 139
     return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n";
135 140
   }
136 141
 }
@@ -225,8 +230,7 @@  discard block
 block discarded – undo
225 230
           if ($key == $last_key) {
226 231
               $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>';
227 232
           }
228
-      }
229
-      elseif (strpos($tab, 'li ')) {
233
+      } elseif (strpos($tab, 'li ')) {
230 234
           if ($key == 0) {
231 235
               $tab = str_replace('li ', 'li class="first" ', $tab);
232 236
           }
@@ -364,8 +368,7 @@  discard block
 block discarded – undo
364 368
         $cid = boincuser_get_first_unread_comment_id($topic->nid);
365 369
         if ($cid) {
366 370
           $variables['topics'][$id]->new_url = url("goto/comment/{$cid}");
367
-        }
368
-        else {
371
+        } else {
369 372
           // User hasn't visited this topic before, so all replies are new...
370 373
           $topic->new_replies = NULL;
371 374
         }
@@ -411,8 +414,7 @@  discard block
 block discarded – undo
411 414
   case 'boinc_host_list':
412 415
     if ($vars['display_id'] == 'page_2') {
413 416
      $vars['empty'] = boincwork_views_host_list_empty_text();
414
-    }
415
-    elseif ($vars['display_id'] == 'page_1') {
417
+    } elseif ($vars['display_id'] == 'page_1') {
416 418
       $vars['empty'] = boincwork_views_host_list_empty_text('active');
417 419
     }
418 420
     break;
@@ -458,8 +460,7 @@  discard block
 block discarded – undo
458 460
   if ($user_image) {
459 461
     if (is_array($user_image) AND $user_image['image']['filepath']) {
460 462
       $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false);
461
-    }
462
-    elseif (is_string($user_image)) {
463
+    } elseif (is_string($user_image)) {
463 464
       $author_picture .= '<img src="' . $user_image . '"/>';
464 465
     }
465 466
   }
@@ -523,26 +524,22 @@  discard block
 block discarded – undo
523 524
 
524 525
     if (user_access('access user profiles')) {
525 526
       $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.'))));
526
-    }
527
-    else {
527
+    } else {
528 528
       $output = check_plain($name);
529 529
     }
530
-  }
531
-  else if ($object->name) {
530
+  } else if ($object->name) {
532 531
     // Sometimes modules display content composed by people who are
533 532
     // not registered members of the site (e.g. mailing list or news
534 533
     // aggregator modules). This clause enables modules to display
535 534
     // the true author of the content.
536 535
     if (!empty($object->homepage)) {
537 536
       $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));
538
-    }
539
-    else {
537
+    } else {
540 538
       $output = check_plain($object->name);
541 539
     }
542 540
 
543 541
     $output .= ' (' . bts('not verified') . ')';
544
-  }
545
-  else {
542
+  } else {
546 543
     $output = check_plain(variable_get('anonymous', bts('Anonymous')));
547 544
   }
548 545
 
Please login to merge, or discard this patch.
sites/all/features/global_search_solr/global_search_solr.features.inc 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,11 +7,9 @@
 block discarded – undo
7 7
   list($module, $api) = func_get_args();
8 8
   if ($module == "apachesolr" && $api == "apachesolr_environments") {
9 9
     return array("version" => 1);
10
-  }
11
-  elseif ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") {
10
+  } elseif ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") {
12 11
     return array("version" => 3);
13
-  }
14
-  elseif ($module == "facetapi" && $api == "facetapi_defaults") {
12
+  } elseif ($module == "facetapi" && $api == "facetapi_defaults") {
15 13
     return array("version" => 1);
16 14
   }
17 15
 }
Please login to merge, or discard this patch.
drupal/sites/all/features/boinc_standard/boinc_standard.features.inc 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,17 +7,13 @@
 block discarded – undo
7 7
   list($module, $api) = func_get_args();
8 8
   if ($module == "input_formats" && $api == "input_formats") {
9 9
     return array("version" => 1);
10
-  }
11
-  elseif ($module == "page_manager" && $api == "pages_default") {
10
+  } elseif ($module == "page_manager" && $api == "pages_default") {
12 11
     return array("version" => 1);
13
-  }
14
-  elseif ($module == "panels_mini" && $api == "panels_default") {
12
+  } elseif ($module == "panels_mini" && $api == "panels_default") {
15 13
     return array("version" => 1);
16
-  }
17
-  elseif ($module == "strongarm" && $api == "strongarm") {
14
+  } elseif ($module == "strongarm" && $api == "strongarm") {
18 15
     return array("version" => 1);
19
-  }
20
-  elseif ($module == "wysiwyg" && $api == "wysiwyg") {
16
+  } elseif ($module == "wysiwyg" && $api == "wysiwyg") {
21 17
     return array("version" => 2);
22 18
   }
23 19
 }
Please login to merge, or discard this patch.
drupal/sites/all/features/news/news.features.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
   list($module, $api) = func_get_args();
8 8
   if ($module == "context" && $api == "context") {
9 9
     return array("version" => 3);
10
-  }
11
-  elseif ($module == "strongarm" && $api == "strongarm") {
10
+  } elseif ($module == "strongarm" && $api == "strongarm") {
12 11
     return array("version" => 1);
13 12
   }
14 13
 }
Please login to merge, or discard this patch.
drupal/sites/all/features/discussion_forums/discussion_forums.module 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
   
27 27
   if (isset($roles[$rid]) AND $roles[$rid] == $better_name) {
28 28
     // Life is good
29
-  }
30
-  else {
29
+  } else {
31 30
     $better_rid = array_search($better_name, $roles);
32 31
     $old_rid = array_search('Forum Moderator', $roles);
33 32
     if (!$better_rid) {
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
           $better_name, $old_rid);
37 36
         $better_rid = $old_rid;
38 37
         $old_rid = NULL;
39
-      }
40
-      else {
38
+      } else {
41 39
         drupal_set_message(t('The Forum Access module is not set up right. Try disabling the Discussion Forums feature and then manually uninstall the Forum Access module before enabling Discussion Forums again.', 'error'));
42 40
       }
43 41
     }
Please login to merge, or discard this patch.
drupal/sites/all/features/team_forums/team_forums.features.inc 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,11 +7,9 @@
 block discarded – undo
7 7
   list($module, $api) = func_get_args();
8 8
   if ($module == "context" && $api == "context") {
9 9
     return array("version" => 3);
10
-  }
11
-  elseif ($module == "page_manager" && $api == "pages_default") {
10
+  } elseif ($module == "page_manager" && $api == "pages_default") {
12 11
     return array("version" => 1);
13
-  }
14
-  elseif ($module == "strongarm" && $api == "strongarm") {
12
+  } elseif ($module == "strongarm" && $api == "strongarm") {
15 13
     return array("version" => 1);
16 14
   }
17 15
 }
Please login to merge, or discard this patch.
drupal/sites/all/features/teams/teams.features.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
   list($module, $api) = func_get_args();
8 8
   if ($module == "page_manager" && $api == "pages_default") {
9 9
     return array("version" => 1);
10
-  }
11
-  elseif ($module == "strongarm" && $api == "strongarm") {
10
+  } elseif ($module == "strongarm" && $api == "strongarm") {
12 11
     return array("version" => 1);
13 12
   }
14 13
 }
Please login to merge, or discard this patch.