Passed
Pull Request — master (#5476)
by Vitalii
09:07
created
drupal/sites/default/boinc/modules/boincteam/boincteam.module 4 patches
Indentation   +574 added lines, -574 removed lines patch added patch discarded remove patch
@@ -26,82 +26,82 @@  discard block
 block discarded – undo
26 26
  * Implementation of hook_menu()
27 27
  */
28 28
 function boincteam_menu() {
29
-  $items = array();
30
-  $items['community/teams/%/assume-foundership'] = array(
29
+    $items = array();
30
+    $items['community/teams/%/assume-foundership'] = array(
31 31
     'page callback' => 'boincteam_assume_foundership',
32 32
     'page arguments' => array(2),
33 33
     'access callback' => 'boincteam_is_member',
34 34
     'access arguments' => array(2),
35 35
     'type' => MENU_CALLBACK
36
-  );
37
-  $items['community/teams/%/join'] = array(
36
+    );
37
+    $items['community/teams/%/join'] = array(
38 38
     'page callback' => 'boincteam_join',
39 39
     'page arguments' => array(2),
40 40
     'access arguments' => array('join boincteam'),
41 41
     'type' => MENU_CALLBACK
42
-  );
43
-  $items['community/teams/%/leave'] = array(
42
+    );
43
+    $items['community/teams/%/leave'] = array(
44 44
     'page callback' => 'boincteam_leave',
45 45
     'page arguments' => array(2),
46 46
     'access arguments' => array('join boincteam'),
47 47
     'type' => MENU_CALLBACK
48
-  );
49
-  $items['community/teams/%/delete'] = array(
48
+    );
49
+    $items['community/teams/%/delete'] = array(
50 50
     'page callback' => 'boincteam_delete',
51 51
     'page arguments' => array(2),
52 52
     'access callback' => 'boincteam_is_founder',
53 53
     'access arguments' => array(2),
54 54
     'type' => MENU_CALLBACK
55
-  );
56
-  $items['community/teams/%/deny-foundership-request'] = array(
55
+    );
56
+    $items['community/teams/%/deny-foundership-request'] = array(
57 57
     'page callback' => 'boincteam_deny_foundership_request',
58 58
     'page arguments' => array(2),
59 59
     'access callback' => 'boincteam_is_founder',
60 60
     'access arguments' => array(2),
61 61
     'type' => MENU_CALLBACK
62
-  );
63
-  $items['community/teams/%/edit/admins/remove/%'] = array(
62
+    );
63
+    $items['community/teams/%/edit/admins/remove/%'] = array(
64 64
     'page callback' => 'boincteam_remove_admin',
65 65
     'page arguments' => array(2,6),
66 66
     'access callback' => 'boincteam_is_founder',
67 67
     'access arguments' => array(2),
68 68
     'type' => MENU_CALLBACK
69
-  );
70
-  $items['community/teams/%/edit/founder/set/%'] = array(
69
+    );
70
+    $items['community/teams/%/edit/founder/set/%'] = array(
71 71
     'page callback' => 'boincteam_set_founder',
72 72
     'page arguments' => array(2,6),
73 73
     'access callback' => 'boincteam_is_founder',
74 74
     'access arguments' => array(2),
75 75
     'type' => MENU_CALLBACK
76
-  );
77
-  $items['community/teams/%/edit/members/remove/%'] = array(
76
+    );
77
+    $items['community/teams/%/edit/members/remove/%'] = array(
78 78
     'page callback' => 'boincteam_remove_member',
79 79
     'page arguments' => array(2,6),
80 80
     'access callback' => 'boincteam_is_founder',
81 81
     'access arguments' => array(2),
82 82
     'type' => MENU_CALLBACK
83
-  );
84
-  $items['community/teams/%/history/xml'] = array(
83
+    );
84
+    $items['community/teams/%/history/xml'] = array(
85 85
     'page callback' => 'boincteam_history_xml',
86 86
     'page arguments' => array(2),
87 87
     'access callback' => 'boincteam_is_admin',
88 88
     'access arguments' => array(2),
89 89
     'type' => MENU_CALLBACK
90
-  );
91
-  $items['community/teams/%/request-foundership'] = array(
90
+    );
91
+    $items['community/teams/%/request-foundership'] = array(
92 92
     'page callback' => 'boincteam_request_foundership',
93 93
     'page arguments' => array(2),
94 94
     'access callback' => 'boincteam_is_member',
95 95
     'access arguments' => array(2),
96 96
     'type' => MENU_CALLBACK
97
-  );
98
-  $items['community/teams/%/user-name-autocomplete'] = array(
97
+    );
98
+    $items['community/teams/%/user-name-autocomplete'] = array(
99 99
     'page callback' => '_boincuser_user_name_autocomplete',
100 100
     'access callback' => 'boincteam_is_founder',
101 101
     'access arguments' => array(2),
102 102
     'type' => MENU_CALLBACK,
103
-  );
104
-  $items['community/teams/%/message-all-members'] = array(
103
+    );
104
+    $items['community/teams/%/message-all-members'] = array(
105 105
     'title' => bts('Send Message to Team', array(), NULL, 'boinc:team-manage'),
106 106
     'description' => bts('Send Message to Team', array(), NULL, 'boinc:team-manage'),
107 107
     'page callback' => 'drupal_get_form',
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
     'access callback' => 'boincteam_is_admin',
110 110
     'access arguments' => array(2),
111 111
     'type' => MENU_CALLBACK,
112
-  );
113
-  $items['admin/boinc/utility-team-delete'] = array(
112
+    );
113
+    $items['admin/boinc/utility-team-delete'] = array(
114 114
     'title' => 'Utility: Delete SPAM Teams',
115 115
     'description' => 'Utililities to help delete BOINC teams created by SPAMMERs.',
116 116
     'page callback' => 'drupal_get_form',
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
     'access arguments' => array('administer site configuration'),
119 119
     'type' => MENU_NORMAL_ITEM,
120 120
     'file' => 'boincteam.admin.inc',
121
-  );
121
+    );
122 122
 
123
-  return $items;
123
+    return $items;
124 124
 }
125 125
 
126 126
 /**
@@ -137,41 +137,41 @@  discard block
 block discarded – undo
137 137
 
138 138
   See https://www.drupal.org/node/945102
139 139
 */
140
-  return array(
140
+    return array(
141 141
     'boincteam_utility_team_table' => array(
142
-      'arguments' => array('form' => NULL),
143
-      'file' => 'boincteam.admin.inc',
142
+        'arguments' => array('form' => NULL),
143
+        'file' => 'boincteam.admin.inc',
144 144
     ),
145
-  );
145
+    );
146 146
 }
147 147
 
148 148
 /**
149 149
 * Implementation of hook_views_api().
150 150
 */
151 151
 function boincteam_views_api() {
152
-  return array(
152
+    return array(
153 153
     'api' => 2.0,
154 154
     'path' => drupal_get_path('module', 'boincteam')
155
-  );
155
+    );
156 156
 }
157 157
 
158 158
 /**
159 159
  * Implementation of hook_perm()
160 160
  */
161 161
 function boincteam_perm() {
162
-  return array('join boincteam', 'create boincteam', 'manage boincteam');
162
+    return array('join boincteam', 'create boincteam', 'manage boincteam');
163 163
 }
164 164
 
165 165
 /**
166 166
  * Implementation of hook_cron()
167 167
  */
168 168
 function boincteam_cron() {
169
-  // Sync teams from BOINC DB every day to catch BOINC-wide team updates
170
-  $last_sync = variable_get('boincteam_last_sync', 0);
171
-  if ($last_sync < time() - 24*60*60) {
169
+    // Sync teams from BOINC DB every day to catch BOINC-wide team updates
170
+    $last_sync = variable_get('boincteam_last_sync', 0);
171
+    if ($last_sync < time() - 24*60*60) {
172 172
     boincteam_sync();
173 173
     variable_set('boincteam_last_sync', time());
174
-  }
174
+    }
175 175
 }
176 176
 
177 177
 /**
@@ -185,41 +185,41 @@  discard block
 block discarded – undo
185 185
 * Implementation of hook_views_pre_execute().
186 186
 */
187 187
 function boincteam_views_pre_execute(&$view) {
188
-  /* Specific boinc_teams sub-views use the boinc readonly replica
188
+    /* Specific boinc_teams sub-views use the boinc readonly replica
189 189
    * DB. These sub-views defined below by their title. If additional
190 190
    * sub-views need to be added, add their title to the list of cases
191 191
    * below. If a sub-view needs to be reverted to use the master DB,
192 192
    * then remove it from the list of cases.
193 193
    */
194
-  if ($view->name == 'boinc_teams') {
194
+    if ($view->name == 'boinc_teams') {
195 195
     switch ($view->display[$view->current_display]->display_title) {
196 196
     case 'Top teams overview pane':
197 197
     case 'Top teams pane':
198 198
     case 'Page':
199 199
       $view->base_database = 'boinc_ro';
200 200
     }
201
-  }
201
+    }
202 202
 }
203 203
 
204 204
 /**
205 205
  * Implementation of hook_cron_queue_info()
206 206
  */
207 207
 function boincteam_cron_queue_info() {
208
-  $queues = array();
209
-  $queues['queue_teamdelete'] = array(
208
+    $queues = array();
209
+    $queues['queue_teamdelete'] = array(
210 210
     'worker callback' => 'boincteam_delete',
211 211
     'time' => 60,
212
-  );
212
+    );
213 213
 }
214 214
 
215 215
 /**
216 216
  * Implementation of hook_mail_alter()
217 217
  */
218 218
 function boincteam_mail_alter(&$message) {
219
-  if (isset($message['params']['boincteam_headers'])) {
219
+    if (isset($message['params']['boincteam_headers'])) {
220 220
     $message['headers']['Bcc'] = $message['params']['boincteam_headers']['Bcc'];
221 221
     $message['to'] = '';
222
-  }
222
+    }
223 223
 }
224 224
 
225 225
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -231,49 +231,49 @@  discard block
 block discarded – undo
231 231
  * assume the role of founder
232 232
  */
233 233
 function boincteam_assume_foundership($team_id) {
234
-  global $user;
235
-  $account = user_load($user->uid);
236
-  $team = node_load($team_id);
237
-  $boincteam_id = boincteam_lookup_id($team_id);
238
-  $boincteam = boincteam_load($boincteam_id);
239
-  $boincuser_id = $account->boincuser_id;
240
-
241
-  if (boincteam_foundership_transfer_ok($boincteam)) {
234
+    global $user;
235
+    $account = user_load($user->uid);
236
+    $team = node_load($team_id);
237
+    $boincteam_id = boincteam_lookup_id($team_id);
238
+    $boincteam = boincteam_load($boincteam_id);
239
+    $boincuser_id = $account->boincuser_id;
240
+
241
+    if (boincteam_foundership_transfer_ok($boincteam)) {
242 242
     if ($boincuser_id == $boincteam->ping_user) {
243
-      db_set_active('boinc_rw');
244
-      db_query("
243
+        db_set_active('boinc_rw');
244
+        db_query("
245 245
         UPDATE {team}
246 246
         SET userid = '%d', ping_user = '0', ping_time = '0'
247 247
         WHERE id = '%d'",
248 248
         $boincuser_id, $boincteam_id
249
-      );
250
-      db_set_active('default');
251
-      drupal_set_message(t('You are now the founder of @team', array(
249
+        );
250
+        db_set_active('default');
251
+        drupal_set_message(t('You are now the founder of @team', array(
252 252
         '@team' => $team->title
253
-      )));
254
-      watchdog('boincteam', 'User @user assumed foundership of team @nid',
253
+        )));
254
+        watchdog('boincteam', 'User @user assumed foundership of team @nid',
255 255
         array(
256
-          '@current_user' => $account->uid,
257
-          '@nid' => $team_id
256
+            '@current_user' => $account->uid,
257
+            '@nid' => $team_id
258 258
         ), WATCHDOG_NOTICE
259
-      );
259
+        );
260 260
     }
261
-  }
262
-  else {
261
+    }
262
+    else {
263 263
     drupal_set_message(t('You are not allowed to assume foundership of this
264 264
       team.'
265 265
     ));
266
-  }
267
-  drupal_goto("community/teams/{$team_id}");
266
+    }
267
+    drupal_goto("community/teams/{$team_id}");
268 268
 }
269 269
 
270 270
 /**
271 271
  * Delete the team, if empty
272 272
  */
273 273
 function boincteam_delete($team_id) {
274
-  $team = node_load($team_id);
275
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
276
-  if ($boincteam->nusers == 1) {
274
+    $team = node_load($team_id);
275
+    $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
276
+    if ($boincteam->nusers == 1) {
277 277
     require_boinc('team');
278 278
     $boincuser = boincuser_load();
279 279
     user_quit_team($boincuser);
@@ -282,35 +282,35 @@  discard block
 block discarded – undo
282 282
     $team->uid = 0;
283 283
     node_save($team);
284 284
     drupal_set_message(t('@team has been removed.',
285
-      array('@team' => $boincteam->name)));
285
+        array('@team' => $boincteam->name)));
286 286
     drupal_goto('community/teams');
287
-  }
288
-  else {
287
+    }
288
+    else {
289 289
     drupal_set_message(t('All members must be removed from @team before the
290 290
       team can be deleted.', array('@team' => $boincteam->name)), 'error');
291 291
     drupal_goto(strstr($_GET['q'], '/delete', TRUE));
292
-  }
292
+    }
293 293
 }
294 294
 
295 295
 /**
296 296
  * Deny a foundership transfer request
297 297
  */
298 298
 function boincteam_deny_foundership_request($team_id) {
299
-  $boincteam_id = boincteam_lookup_id($team_id);
300
-  // Remove the request from the BOINC database
301
-  db_set_active('boinc_rw');
302
-  db_query("
299
+    $boincteam_id = boincteam_lookup_id($team_id);
300
+    // Remove the request from the BOINC database
301
+    db_set_active('boinc_rw');
302
+    db_query("
303 303
     UPDATE {team}
304 304
     SET ping_user=0
305 305
     WHERE id = '%d'",
306 306
     $boincteam_id
307
-  );
308
-  db_set_active('default');
307
+    );
308
+    db_set_active('default');
309 309
 
310
-  drupal_set_message(t('The transfer request has been denied. No additional
310
+    drupal_set_message(t('The transfer request has been denied. No additional
311 311
     requests will be allowed until 90 days have passed since this request was
312 312
     made.'));
313
-  drupal_goto("community/teams/{$team_id}/edit/founder");
313
+    drupal_goto("community/teams/{$team_id}/edit/founder");
314 314
 }
315 315
 
316 316
 
@@ -318,62 +318,62 @@  discard block
 block discarded – undo
318 318
  * Get the join date of a user
319 319
  */
320 320
 function boincteam_get_member_join_date($boincteam_id, $boincuser_id = NULL) {
321
-  if (!$boincuser_id) {
321
+    if (!$boincuser_id) {
322 322
     global $user;
323 323
     $account = user_load($user->uid);
324 324
     $boincuser_id = $account->boincuser_id;
325
-  }
326
-  db_set_active('boinc_rw');
327
-  $timestamp = db_result(db_query("
325
+    }
326
+    db_set_active('boinc_rw');
327
+    $timestamp = db_result(db_query("
328 328
     SELECT timestamp FROM {team_delta} WHERE
329 329
     userid = %d AND teamid = %d AND joining = 1
330 330
     ORDER BY timestamp DESC LIMIT 1",
331 331
     $boincuser_id, $boincteam_id
332
-  ));
333
-  db_set_active('default');
334
-  return $timestamp;
332
+    ));
333
+    db_set_active('default');
334
+    return $timestamp;
335 335
 }
336 336
 
337 337
 /**
338 338
  * Get the team type for display
339 339
  */
340 340
 function boincteam_get_type($team_id) {
341
-  //$vid = boincteam_get_vocabulary_by_name('Teams'); $team->vid = $vid;
342
-  $team = node_load($team_id);
343
-  $terms = taxonomy_node_get_terms($team);
344
-  if ($terms) {
341
+    //$vid = boincteam_get_vocabulary_by_name('Teams'); $team->vid = $vid;
342
+    $team = node_load($team_id);
343
+    $terms = taxonomy_node_get_terms($team);
344
+    if ($terms) {
345 345
     $term = reset($terms);
346 346
     return $term->name;
347
-  } else {
347
+    } else {
348 348
     return null;
349
-  }
349
+    }
350 350
 }
351 351
 
352 352
 /**
353 353
  * Access a vocabulary of terms by name
354 354
  */
355 355
 function boincteam_get_vocabulary_by_name($name) {
356
-  $vocabs = taxonomy_get_vocabularies('team');
357
-  foreach ($vocabs as $vocab) {
356
+    $vocabs = taxonomy_get_vocabularies('team');
357
+    foreach ($vocabs as $vocab) {
358 358
     if ($vocab->name == $name) return $vocab->vid;
359
-  }
360
-  return null;
359
+    }
360
+    return null;
361 361
 }
362 362
 
363 363
 /**
364 364
  * Output the XML of the team history
365 365
  */
366 366
 function boincteam_history_xml($team_id) {
367
-  $team = node_load($team_id);
368
-  $boincteam_id = boincteam_lookup_id($team_id);
369
-  $team_history = array(
367
+    $team = node_load($team_id);
368
+    $boincteam_id = boincteam_lookup_id($team_id);
369
+    $team_history = array(
370 370
     'actions' => array(
371
-      'action' => array(),
371
+        'action' => array(),
372 372
     ),
373
-  );
373
+    );
374 374
 
375
-  db_set_active('boinc_rw');
376
-  $result = db_query("
375
+    db_set_active('boinc_rw');
376
+    $result = db_query("
377 377
     SELECT
378 378
       td.userid AS id,
379 379
       u.name,
@@ -385,40 +385,40 @@  discard block
 block discarded – undo
385 385
     WHERE td.teamid = %d
386 386
     ORDER BY timestamp ASC",
387 387
     $boincteam_id
388
-  );
389
-  db_set_active('default');
388
+    );
389
+    db_set_active('default');
390 390
 
391
-  while ($record = db_fetch_array($result)) {
391
+    while ($record = db_fetch_array($result)) {
392 392
     $team_history['actions']['action'][] = $record;
393
-  }
393
+    }
394 394
 
395
-  header('Content-type: text/xml');
396
-  echo xml_to_text(array_to_xml($team_history));
395
+    header('Content-type: text/xml');
396
+    echo xml_to_text(array_to_xml($team_history));
397 397
 }
398 398
 
399 399
 /**
400 400
  * Convert a BOINC team ID to a Drupal team ID
401 401
  */
402 402
 function boincteam_lookup_nid($boinc_id) {
403
-  $drupal_id = db_result(db_query("SELECT nid FROM {boincteam} WHERE team_id='%d'", $boinc_id));
404
-  return $drupal_id;
403
+    $drupal_id = db_result(db_query("SELECT nid FROM {boincteam} WHERE team_id='%d'", $boinc_id));
404
+    return $drupal_id;
405 405
 }
406 406
 
407 407
 /**
408 408
  * Convert a Drupal team ID to a BOINC team ID
409 409
  */
410 410
 function boincteam_lookup_id($nid) {
411
-  $boinc_id = db_result(db_query("SELECT team_id FROM {boincteam} WHERE nid = '%d'", $nid));
412
-  return $boinc_id;
411
+    $boinc_id = db_result(db_query("SELECT team_id FROM {boincteam} WHERE nid = '%d'", $nid));
412
+    return $boinc_id;
413 413
 }
414 414
 
415 415
 /**
416 416
  * Get a BOINC team object
417 417
  */
418 418
 function boincteam_load($boincteam_id, $full_object = FALSE) {
419
-  require_boinc(array('team'));
420
-  $team = BoincTeam::lookup_id($boincteam_id);
421
-  if ($team AND $full_object) {
419
+    require_boinc(array('team'));
420
+    $team = BoincTeam::lookup_id($boincteam_id);
421
+    if ($team AND $full_object) {
422 422
     $team->nusers = BoincUser::count("teamid={$team->id}");
423 423
     $team->nusers_worked = BoincUser::count("teamid={$team->id} and total_credit>0");
424 424
     $team->nusers_active = BoincUser::count("teamid={$team->id} and expavg_credit>0.1");
@@ -426,314 +426,314 @@  discard block
 block discarded – undo
426 426
     $team->new_members = new_member_list($boincteam_id);
427 427
     $team->admins = admin_list($boincteam_id);
428 428
     $team->founder = BoincUser::lookup_id($team->userid);
429
-  }
430
-  return $team;
429
+    }
430
+    return $team;
431 431
 }
432 432
 
433 433
 /**
434 434
  * Check if a user is the team founder
435 435
  */
436 436
 function boincteam_is_founder($nid, $uid = NULL) {
437
-  if (!$uid) {
437
+    if (!$uid) {
438 438
     global $user;
439 439
     $uid = $user->uid;
440
-  }
441
-  if (!boincteam_is_member($nid, $uid)) {
440
+    }
441
+    if (!boincteam_is_member($nid, $uid)) {
442 442
     return FALSE;
443
-  }
444
-  $team_id = boincteam_lookup_id($nid);
445
-  require_boinc('team');
446
-  return is_team_founder(boincuser_load($uid, TRUE), boincteam_load($team_id));
443
+    }
444
+    $team_id = boincteam_lookup_id($nid);
445
+    require_boinc('team');
446
+    return is_team_founder(boincuser_load($uid, TRUE), boincteam_load($team_id));
447 447
 }
448 448
 
449 449
 /**
450 450
  * Check if a user is a team admin
451 451
  */
452 452
 function boincteam_is_admin($nid, $uid = NULL) {
453
-  if (!$uid) {
453
+    if (!$uid) {
454 454
     global $user;
455 455
     $uid = $user->uid;
456
-  }
457
-  if (!boincteam_is_member($nid, $uid)) {
456
+    }
457
+    if (!boincteam_is_member($nid, $uid)) {
458 458
     return FALSE;
459
-  }
460
-  $team_id = boincteam_lookup_id($nid);
461
-  require_boinc('team');
462
-  return is_team_admin(boincuser_load($uid, TRUE), boincteam_load($team_id));
459
+    }
460
+    $team_id = boincteam_lookup_id($nid);
461
+    require_boinc('team');
462
+    return is_team_admin(boincuser_load($uid, TRUE), boincteam_load($team_id));
463 463
 }
464 464
 
465 465
 /**
466 466
  * Check if a user is a team member
467 467
  */
468 468
 function boincteam_is_member($nid, $uid = NULL) {
469
-  if (!$uid) {
469
+    if (!$uid) {
470 470
     global $user;
471 471
     $uid = $user->uid;
472
-  }
473
-  $account = user_load($uid);
474
-  return ($account->team == $nid);
472
+    }
473
+    $account = user_load($uid);
474
+    return ($account->team == $nid);
475 475
 }
476 476
 
477 477
 /**
478 478
  * Display any persistent team messages
479 479
  */
480 480
 function boincteam_show_messages() {
481
-  global $user;
482
-  $uid = $user->uid;
483
-  $account = user_load($uid);
484
-  if ($account->team) {
481
+    global $user;
482
+    $uid = $user->uid;
483
+    $account = user_load($uid);
484
+    if ($account->team) {
485 485
     if (boincteam_is_founder($account->team, $account->uid)) {
486
-      // Set a notice of any pending foundership requests
487
-      $boincteam_id = boincteam_lookup_id($account->team);
488
-      $boincteam = boincteam_load($boincteam_id);
489
-      if ($boincteam->ping_user > 0) {
486
+        // Set a notice of any pending foundership requests
487
+        $boincteam_id = boincteam_lookup_id($account->team);
488
+        $boincteam = boincteam_load($boincteam_id);
489
+        if ($boincteam->ping_user > 0) {
490 490
         $foundership_url = "community/teams/{$account->team}/edit/founder";
491 491
         if (substr($_GET['q'], 0, strlen($foundership_url)) != $foundership_url) {
492
-          drupal_set_message(
492
+            drupal_set_message(
493 493
             bts(
494
-              'A foundership transfer request has been made for your team. Please !respond.',
495
-              array('!respond' => l(bts('respond to the request', array(), NULL, 'boinc:team-founder-change'), $foundership_url)),
496
-              NULL, 'boinc:team-founder-change'),
494
+                'A foundership transfer request has been made for your team. Please !respond.',
495
+                array('!respond' => l(bts('respond to the request', array(), NULL, 'boinc:team-founder-change'), $foundership_url)),
496
+                NULL, 'boinc:team-founder-change'),
497 497
             'warning', FALSE
498
-          );
498
+            );
499
+        }
499 500
         }
500
-      }
501 501
     }
502
-  }
502
+    }
503 503
 }
504 504
 
505 505
 /**
506 506
  * Add a user to a team
507 507
  */
508 508
 function boincteam_join($team_id) {
509
-  global $user;
510
-  $account = user_load($user->uid);
509
+    global $user;
510
+    $account = user_load($user->uid);
511 511
 
512
-  $boincteam_id = boincteam_lookup_id($team_id);
513
-  $boincteam = boincteam_load($boincteam_id);
514
-  if ($boincteam->joinable AND $account->team != $team_id) {
512
+    $boincteam_id = boincteam_lookup_id($team_id);
513
+    $boincteam = boincteam_load($boincteam_id);
514
+    if ($boincteam->joinable AND $account->team != $team_id) {
515 515
     require_boinc('team');
516 516
     $boincuser = boincuser_load();
517 517
     if (user_join_team($boincteam, $boincuser)) {
518
-      drupal_set_message(t('You are now a member of @team!',
518
+        drupal_set_message(t('You are now a member of @team!',
519 519
         array('@team' => $boincteam->name)));
520
-      watchdog('boincteam', 'added user @uid to team @nid',
520
+        watchdog('boincteam', 'added user @uid to team @nid',
521 521
         array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
522 522
     }
523 523
     else {
524
-      // @todo - consider another rule/error event here
525
-      drupal_set_message(t('There was a problem joining @team, please try again
524
+        // @todo - consider another rule/error event here
525
+        drupal_set_message(t('There was a problem joining @team, please try again
526 526
         later', array('@team' => $boincteam->name)));
527
-      watchdog('boincteam', 'error adding user @uid to team @nid',
527
+        watchdog('boincteam', 'error adding user @uid to team @nid',
528 528
         array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_ERROR);
529 529
     }
530
-  }
531
-  drupal_goto("community/teams/{$team_id}");
530
+    }
531
+    drupal_goto("community/teams/{$team_id}");
532 532
 }
533 533
 
534 534
 /**
535 535
  * Leave a team
536 536
  */
537 537
 function boincteam_leave($team_id) {
538
-  global $user;
539
-  $account = user_load($user->uid);
538
+    global $user;
539
+    $account = user_load($user->uid);
540 540
 
541
-  $boincteam_id = boincteam_lookup_id($team_id);
542
-  $boincteam = boincteam_load($boincteam_id);
543
-  if ($account->team == $team_id) {
541
+    $boincteam_id = boincteam_lookup_id($team_id);
542
+    $boincteam = boincteam_load($boincteam_id);
543
+    if ($account->team == $team_id) {
544 544
     require_boinc('team');
545 545
     $boincuser = boincuser_load();
546 546
     user_quit_team($boincuser);
547 547
     drupal_set_message(t('You are no longer a member of @team.',
548
-      array('@team' => $boincteam->name)));
548
+        array('@team' => $boincteam->name)));
549 549
     watchdog('boincteam', 'removed user @uid from team @nid',
550
-      array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
551
-  }
552
-  else {
553
-      drupal_set_message(t('You are not a member of @team, so you cannot revoke
550
+        array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
551
+    }
552
+    else {
553
+        drupal_set_message(t('You are not a member of @team, so you cannot revoke
554 554
         your membership to it.', array('@team' => $boincteam->name)));
555
-  }
556
-  drupal_goto("community/teams/{$team_id}");
555
+    }
556
+    drupal_goto("community/teams/{$team_id}");
557 557
 }
558 558
 
559 559
 /**
560 560
  * Remove team admin status from a user
561 561
  */
562 562
 function boincteam_remove_admin($team_id, $user_id) {
563
-  global $user;
564
-  $account = user_load($user_id);
565
-  $team = node_load($team_id);
566
-  $boincteam_id = boincteam_lookup_id($team_id);
567
-  $boincuser_id = $account->boincuser_id;
563
+    global $user;
564
+    $account = user_load($user_id);
565
+    $team = node_load($team_id);
566
+    $boincteam_id = boincteam_lookup_id($team_id);
567
+    $boincuser_id = $account->boincuser_id;
568 568
 
569
-  if (boincteam_is_admin($team_id, $account->uid)) {
569
+    if (boincteam_is_admin($team_id, $account->uid)) {
570 570
     // Update the team in the BOINC db
571 571
     db_set_active('boinc_rw');
572 572
     db_query("
573 573
       DELETE FROM {team_admin} WHERE
574 574
         teamid = '%d' AND userid = '%d'",
575
-      $boincteam_id,
576
-      $boincuser_id
575
+        $boincteam_id,
576
+        $boincuser_id
577 577
     );
578 578
     db_set_active('default');
579 579
     drupal_set_message(t('@user is no longer an admin of @team.',
580
-      array(
580
+        array(
581 581
         '@user' => $account->boincuser_name,
582 582
         '@team' => $team->title
583
-      )
583
+        )
584 584
     ));
585 585
     watchdog('boincteam', 'User @current_user removed admin status for user
586 586
       @uid from team @nid',
587
-      array(
587
+        array(
588 588
         '@current_user' => $user->uid,
589 589
         '@uid' => $account->uid,
590 590
         '@nid' => $team_id
591
-      ), WATCHDOG_NOTICE);
592
-  }
593
-  drupal_goto("community/teams/{$team_id}/edit/admins");
591
+        ), WATCHDOG_NOTICE);
592
+    }
593
+    drupal_goto("community/teams/{$team_id}/edit/admins");
594 594
 }
595 595
 
596 596
 /**
597 597
  * Remove a user from a team
598 598
  */
599 599
 function boincteam_remove_member($team_id, $user_id) {
600
-  global $user;
601
-  $account = user_load($user_id);
600
+    global $user;
601
+    $account = user_load($user_id);
602 602
 
603
-  $boincteam_id = boincteam_lookup_id($team_id);
604
-  $boincteam = boincteam_load($boincteam_id);
605
-  if ($account->team == $team_id) {
603
+    $boincteam_id = boincteam_lookup_id($team_id);
604
+    $boincteam = boincteam_load($boincteam_id);
605
+    if ($account->team == $team_id) {
606 606
     require_boinc('team');
607 607
     $boincuser = boincuser_load($user_id, TRUE);
608 608
     user_quit_team($boincuser);
609 609
     drupal_set_message(t('@user has been removed from @team.',
610
-      array(
610
+        array(
611 611
         '@user' => $account->boincuser_name,
612 612
         '@team' => $boincteam->name
613
-      )
613
+        )
614 614
     ));
615 615
     watchdog('boincteam', 'User @current_user removed user @uid from team @nid',
616
-      array(
616
+        array(
617 617
         '@current_user' => $user->uid,
618 618
         '@uid' => $account->uid,
619 619
         '@nid' => $team_id
620
-      ), WATCHDOG_NOTICE);
621
-  }
622
-  else {
623
-      drupal_set_message(t('@user is not a member of @team, so you cannot
620
+        ), WATCHDOG_NOTICE);
621
+    }
622
+    else {
623
+        drupal_set_message(t('@user is not a member of @team, so you cannot
624 624
         revoke the membership.', array(
625
-          '@user' => $account->boincuser_name,
626
-          '@team' => $boincteam->name
625
+            '@user' => $account->boincuser_name,
626
+            '@team' => $boincteam->name
627 627
         )
628
-      ));
629
-  }
630
-  drupal_goto("community/teams/{$team_id}/edit/members");
628
+        ));
629
+    }
630
+    drupal_goto("community/teams/{$team_id}/edit/members");
631 631
 }
632 632
 
633 633
 /**
634 634
  * Request a foundership transfer
635 635
  */
636 636
 function boincteam_request_foundership($team_id) {
637
-  global $user;
638
-  $account = user_load($user->uid);
639
-  $team = node_load($team_id);
640
-  $boincteam_id = boincteam_lookup_id($team_id);
641
-  $boincteam = boincteam_load($boincteam_id);
642
-  $boincuser_id = $account->boincuser_id;
643
-
644
-  if (boincteam_is_founder($team_id, $account->uid)) {
637
+    global $user;
638
+    $account = user_load($user->uid);
639
+    $team = node_load($team_id);
640
+    $boincteam_id = boincteam_lookup_id($team_id);
641
+    $boincteam = boincteam_load($boincteam_id);
642
+    $boincuser_id = $account->boincuser_id;
643
+
644
+    if (boincteam_is_founder($team_id, $account->uid)) {
645 645
     // Shouldn't even be here...
646 646
     drupal_set_message(t('@user is already the team founder.',
647
-      array(
647
+        array(
648 648
         '@user' => $account->boincuser_name
649
-      )
649
+        )
650 650
     ), 'warning');
651
-  }
652
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
651
+    }
652
+    elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
653 653
     // It hasn't been long enough since the last transfer request
654 654
     drupal_set_message(t('A foundership change was requested during the last 90
655 655
       days, so new requests are not allowed. Please try again later.'
656 656
     ), 'warning');
657
-  }
658
-  elseif (boincteam_is_member($team_id, $account->uid)) {
657
+    }
658
+    elseif (boincteam_is_member($team_id, $account->uid)) {
659 659
     // Log the transfer request
660 660
     db_set_active('boinc_rw');
661 661
     db_query("
662 662
       UPDATE {team}
663 663
       SET ping_user = '%d', ping_time='%d'
664 664
       WHERE id = '%d'",
665
-      $boincuser_id, time(), $boincteam_id
665
+        $boincuser_id, time(), $boincteam_id
666 666
     );
667 667
     db_set_active('default');
668 668
     drupal_set_message(t('You have requested foundership of @team. The current
669 669
       founder has 60 days to respond to this request.',
670
-      array(
670
+        array(
671 671
         '@team' => $team->title
672
-      )
672
+        )
673 673
     ));
674 674
     watchdog('boincteam', 'User @user requested foundership of team @nid',
675
-      array(
675
+        array(
676 676
         '@current_user' => $account->uid,
677 677
         '@nid' => $team_id
678
-      ), WATCHDOG_NOTICE);
679
-  }
680
-  drupal_goto("community/teams/{$team_id}");
678
+        ), WATCHDOG_NOTICE);
679
+    }
680
+    drupal_goto("community/teams/{$team_id}");
681 681
 }
682 682
 
683 683
 /**
684 684
  * Transfer foundership to another team member
685 685
  */
686 686
 function boincteam_set_founder($team_id, $user_id) {
687
-  global $user;
688
-  $account = user_load($user_id);
689
-  $team = node_load($team_id);
690
-  $boincteam_id = boincteam_lookup_id($team_id);
691
-  $boincuser_id = $account->boincuser_id;
687
+    global $user;
688
+    $account = user_load($user_id);
689
+    $team = node_load($team_id);
690
+    $boincteam_id = boincteam_lookup_id($team_id);
691
+    $boincuser_id = $account->boincuser_id;
692 692
 
693
-  if (boincteam_is_member($team_id, $account->uid)) {
693
+    if (boincteam_is_member($team_id, $account->uid)) {
694 694
     // Update the team in the BOINC db
695 695
     db_set_active('boinc_rw');
696 696
     db_query("
697 697
       UPDATE {team}
698 698
       SET userid = '%d', ping_user=0
699 699
       WHERE id = '%d'",
700
-      $boincuser_id, $boincteam_id
700
+        $boincuser_id, $boincteam_id
701 701
     );
702 702
     db_set_active('default');
703 703
     drupal_set_message(t('Foundership of @team has been transfered to @user.',
704
-      array(
704
+        array(
705 705
         '@user' => $account->boincuser_name,
706 706
         '@team' => $team->title
707
-      )
707
+        )
708 708
     ));
709 709
     watchdog('boincteam', 'User @current_user transferred foundership of team
710 710
       @nid to user @uid',
711
-      array(
711
+        array(
712 712
         '@current_user' => $user->uid,
713 713
         '@uid' => $account->uid,
714 714
         '@nid' => $team_id
715
-      ), WATCHDOG_NOTICE);
716
-  }
717
-  drupal_goto("community/teams/{$team_id}");
715
+        ), WATCHDOG_NOTICE);
716
+    }
717
+    drupal_goto("community/teams/{$team_id}");
718 718
 }
719 719
 
720 720
 /**
721 721
  * See if a new foundership transfer request is allowed
722 722
  */
723 723
 function boincteam_new_foundership_transfer_request_ok($team_id) {
724
-  $boincteam_id = boincteam_lookup_id($team_id);
725
-  $boincteam = boincteam_load($boincteam_id);
726
-  $now = time();
727
-  if ($boincteam->ping_user <= 0) {
724
+    $boincteam_id = boincteam_lookup_id($team_id);
725
+    $boincteam = boincteam_load($boincteam_id);
726
+    $now = time();
727
+    if ($boincteam->ping_user <= 0) {
728 728
     if ($boincteam->ping_time < $now - 60 * (24*60*60)) {
729
-      return TRUE;
729
+        return TRUE;
730 730
     }
731 731
     return FALSE;
732
-  }
733
-  if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
732
+    }
733
+    if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
734 734
     return TRUE;
735
-  }
736
-  return FALSE;
735
+    }
736
+    return FALSE;
737 737
 }
738 738
 
739 739
 /**
@@ -755,18 +755,18 @@  discard block
 block discarded – undo
755 755
  * Check if a user has an active foundership request with a team
756 756
  */
757 757
 function boincteam_user_requested_foundership($team_id, $user_id = NULL) {
758
-  if (!$user_id) {
758
+    if (!$user_id) {
759 759
     global $user;
760 760
     $user_id = $user->uid;
761
-  }
762
-  $account = user_load($user_id);
763
-  $boincteam_id = boincteam_lookup_id($team_id);
764
-  $boincteam = boincteam_load($boincteam_id);
761
+    }
762
+    $account = user_load($user_id);
763
+    $boincteam_id = boincteam_lookup_id($team_id);
764
+    $boincteam = boincteam_load($boincteam_id);
765 765
 
766
-  if ($boincteam->ping_user == $account->boincuser_id) {
766
+    if ($boincteam->ping_user == $account->boincuser_id) {
767 767
     // Be sure the request is still active
768 768
     return !boincteam_new_foundership_transfer_request_ok($team_id);
769
-  }
769
+    }
770 770
 }
771 771
 
772 772
 
@@ -778,125 +778,125 @@  discard block
 block discarded – undo
778 778
  * General info about team admins
779 779
  */
780 780
 function boincteam_about_admins_panel() {
781
-  $output = '';
782
-  $output .= '<h2 class="pane-title">' . bts('About team admins', array(), NULL, 'boinc:team-admins-panel') . '</h2>';
783
-  $output .= '<div>';
784
-  $output .= '<p>' . bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
785
-  $output .= '<ul>';
786
-  $output .= '  <li>' . bts('Edit team information', array(), NULL, 'boinc:team-admins-panel') . '</li>';
787
-  $output .= '  <li>' . bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel') . '</li>';
788
-  $output .= '  <li>' . bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel') . '</li>';
789
-  $output .= '  <li>' . bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel') . '</li>';
790
-  $output .= '  <li>' . bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
791
-  $output .= '</ul>';
792
-  $output .= '</div>';
793
-  $output .= '<div>';
794
-  $output .= '<p>' . bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
795
-  $output .= '<ul>';
796
-  $output .= '  <li>' . bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel') . '</li>';
797
-  $output .= '  <li>' . bts('Remove members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
798
-  $output .= '  <li>' . bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel') . '</li>';
799
-  $output .= '</ul>';
800
-  $output .= '</div>';
801
-  $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
781
+    $output = '';
782
+    $output .= '<h2 class="pane-title">' . bts('About team admins', array(), NULL, 'boinc:team-admins-panel') . '</h2>';
783
+    $output .= '<div>';
784
+    $output .= '<p>' . bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
785
+    $output .= '<ul>';
786
+    $output .= '  <li>' . bts('Edit team information', array(), NULL, 'boinc:team-admins-panel') . '</li>';
787
+    $output .= '  <li>' . bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel') . '</li>';
788
+    $output .= '  <li>' . bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel') . '</li>';
789
+    $output .= '  <li>' . bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel') . '</li>';
790
+    $output .= '  <li>' . bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
791
+    $output .= '</ul>';
792
+    $output .= '</div>';
793
+    $output .= '<div>';
794
+    $output .= '<p>' . bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
795
+    $output .= '<ul>';
796
+    $output .= '  <li>' . bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel') . '</li>';
797
+    $output .= '  <li>' . bts('Remove members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
798
+    $output .= '  <li>' . bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel') . '</li>';
799
+    $output .= '</ul>';
800
+    $output .= '</div>';
801
+    $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
802 802
     . ' team admin. We recommend only selecting people you know and trust', array(), NULL, 'boinc:team-admins-panel')
803 803
     . '</p>';
804
-  return $output;
804
+    return $output;
805 805
 }
806 806
 
807 807
 /**
808 808
  * General info about changing the team founder
809 809
  */
810 810
 function boincteam_about_founder_panel() {
811
-  $output = '';
812
-  $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel')
811
+    $output = '';
812
+    $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel')
813 813
     . '</h2>';
814
-  $output .= '<div>';
815
-  $output .= '<p>' . bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel') . '</p>';
816
-  $output .= '<ul>';
817
-  $output .= '  <li>' . bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel') . '</li>';
818
-  $output .= '  <li>' . bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel') . '</li>';
819
-  $output .= '</ul>';
820
-  $output .= '</div>';
821
-  $output .= '<div>';
822
-  $output .= '<p>' . bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel')
814
+    $output .= '<div>';
815
+    $output .= '<p>' . bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel') . '</p>';
816
+    $output .= '<ul>';
817
+    $output .= '  <li>' . bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel') . '</li>';
818
+    $output .= '  <li>' . bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel') . '</li>';
819
+    $output .= '</ul>';
820
+    $output .= '</div>';
821
+    $output .= '<div>';
822
+    $output .= '<p>' . bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel')
823 823
     . '</p>';
824
-  $output .= '<ul>';
825
-  $output .= '  <li>' . bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel') . '</li>';
826
-  $output .= '  <li>' . bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel')
824
+    $output .= '<ul>';
825
+    $output .= '  <li>' . bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel') . '</li>';
826
+    $output .= '  <li>' . bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel')
827 827
     . '</li>';
828
-  $output .= '  <li>' . bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel')
828
+    $output .= '  <li>' . bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel')
829 829
     . '</li>';
830
-  $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
830
+    $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
831 831
     . ' request', array(), NULL, 'boinc:team-founder-panel') . '</li>';
832
-  $output .= '</ul>';
833
-  $output .= '</div>';
834
-  return $output;
832
+    $output .= '</ul>';
833
+    $output .= '</div>';
834
+    return $output;
835 835
 }
836 836
 
837 837
 /**
838 838
  * Link to create a new team
839 839
  */
840 840
 function boincteam_create_team_link_panel() {
841
-  global $user;
842
-  $account = user_load($user->uid);
843
-  $unrestricted_role = array_search('verified contributor', user_roles(true));
844
-  $output = '';
845
-  $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
846
-  $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
841
+    global $user;
842
+    $account = user_load($user->uid);
843
+    $unrestricted_role = array_search('verified contributor', user_roles(true));
844
+    $output = '';
845
+    $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
846
+    $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
847 847
     . ' can create a team.', array(), NULL, 'boinc:create-team-panel') . '</p>';
848
-  $output .= '<ul class="tab-list">';
849
-  $output .= '  <li class="first last tab">';
850
-  if (isset($account->roles[$unrestricted_role])) {
848
+    $output .= '<ul class="tab-list">';
849
+    $output .= '  <li class="first last tab">';
850
+    if (isset($account->roles[$unrestricted_role])) {
851 851
     $output .= l(bts('Create new team', array(), NULL, 'boinc:create-team-panel'), 'community/teams/add');
852
-  } elseif ($account->uid <= 0) {
852
+    } elseif ($account->uid <= 0) {
853 853
     $output .= l(
854
-      bts('Login to create a new team', array(), NULL, 'boinc:create-team-panel'),
855
-      'user/login',
856
-      array('query' => drupal_get_destination())
854
+        bts('Login to create a new team', array(), NULL, 'boinc:create-team-panel'),
855
+        'user/login',
856
+        array('query' => drupal_get_destination())
857 857
     );
858
-  } else {
858
+    } else {
859 859
     $min_credit_needed = variable_get('boinc_comment_min_credit', 0);
860 860
     $credit_needed = $min_credit_needed - $account->boincuser_total_credit;
861 861
     $output .= '[';
862 862
     if ($credit_needed == 1) {
863
-      $output .= bts('You must earn 1 more credit!', array(), NULL, 'boinc:create-team-panel');
863
+        $output .= bts('You must earn 1 more credit!', array(), NULL, 'boinc:create-team-panel');
864 864
     }
865 865
     else {
866
-      $output .= bts('You must earn @count more credits!',
866
+        $output .= bts('You must earn @count more credits!',
867 867
         array('@count' => $credit_needed),
868
-	NULL, 'boinc:create-team-panel'
869
-      );
868
+    NULL, 'boinc:create-team-panel'
869
+        );
870 870
     }
871 871
     $output .= ']';
872
-  }
873
-  $output .= '  </li>';
874
-  $output .= '</ul>';
875
-  return $output;
872
+    }
873
+    $output .= '  </li>';
874
+    $output .= '</ul>';
875
+    return $output;
876 876
 }
877 877
 
878 878
 /**
879 879
  * Create team form
880 880
  */
881 881
 function boincteam_create_team_panel() {
882
-  $output = '';
883
-  $output .= '<h2 class="pane-title">' . bts('Create a team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
884
-  $output .= drupal_get_form('boincteam_create_form');
882
+    $output = '';
883
+    $output .= '<h2 class="pane-title">' . bts('Create a team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
884
+    $output .= drupal_get_form('boincteam_create_form');
885 885
 
886
-  return $output;
886
+    return $output;
887 887
 }
888 888
 
889 889
 /**
890 890
  * Link to user's team
891 891
  */
892 892
 function boincteam_dashboard_panel($uid = NULL) {
893
-  global $user;
894
-  if (!$uid) {
893
+    global $user;
894
+    if (!$uid) {
895 895
     $uid = $user->uid;
896
-  }
897
-  $output = '';
898
-  $account = user_load($uid);
899
-  if ($account->team) {
896
+    }
897
+    $output = '';
898
+    $account = user_load($uid);
899
+    if ($account->team) {
900 900
     $team = boincteam_load(boincteam_lookup_id($account->team));
901 901
     $output .= '<h2 class="pane-title">' . bts('Team', array(), NULL, 'boinc:team-dashboard') . '</h2>';
902 902
     $output .= '<div class="stats">';
@@ -915,254 +915,254 @@  discard block
 block discarded – undo
915 915
     $output .= '  <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>';
916 916
     $output .= '  <span>' . number_format($team->total_credit, 0) . '</span>';
917 917
     $output .= '</div>' . "\n";
918
-  }
919
-  else if ($user->uid == $account->uid) {
918
+    }
919
+    else if ($user->uid == $account->uid) {
920 920
     $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>';
921 921
     $output .= '<ul class="tab-list action-list">';
922 922
     $output .= '<li class="tab primary">';
923 923
     $output .= l(bts('Join a Team', array(), NULL, 'boinc:team-dashboard'), 'community/teams');
924 924
     $output .= '</li>';
925 925
     $output .= '</ul>';
926
-  }
927
-  return $output;
926
+    }
927
+    return $output;
928 928
 }
929 929
 
930 930
 /**
931 931
  * Edit team form
932 932
  */
933 933
 function boincteam_edit_team_panel($team_id) {
934
-  $team = node_load($team_id);
935
-  $output = '';
936
-  $output .= '<h2 class="pane-title">' . $team->title . '</h2>';
937
-  $output .= drupal_get_form('boincteam_edit_form', $team_id);
934
+    $team = node_load($team_id);
935
+    $output = '';
936
+    $output .= '<h2 class="pane-title">' . $team->title . '</h2>';
937
+    $output .= drupal_get_form('boincteam_edit_form', $team_id);
938 938
 
939
-  return $output;
939
+    return $output;
940 940
 }
941 941
 
942 942
 /**
943 943
  * Link to join a team
944 944
  */
945 945
 function boincteam_join_team_panel($team_id) {
946
-  $team = node_load($team_id);
947
-  $output = '';
948
-  $output .= '<h2 class="pane-title">' . bts('Join team', array(), NULL, 'boinc:join-team-panel') . '</h2>';
949
-  $output .= '<p>' . bts('Click here to become a member of @this_team',
946
+    $team = node_load($team_id);
947
+    $output = '';
948
+    $output .= '<h2 class="pane-title">' . bts('Join team', array(), NULL, 'boinc:join-team-panel') . '</h2>';
949
+    $output .= '<p>' . bts('Click here to become a member of @this_team',
950 950
     array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel') . '</p>';
951
-  $output .= '<ul class="tab-list">';
952
-  $output .= '  <li class="first last tab">' .
951
+    $output .= '<ul class="tab-list">';
952
+    $output .= '  <li class="first last tab">' .
953 953
     l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join") . '</li>';
954
-  $output .= '</ul>';
955
-  return $output;
954
+    $output .= '</ul>';
955
+    return $output;
956 956
 }
957 957
 
958 958
 /**
959 959
  * Link to leave a team
960 960
  */
961 961
 function boincteam_leave_team_panel($team_id) {
962
-  $team = node_load($team_id);
963
-  $output = '';
964
-  $output .= '<h2 class="pane-title">' . bts('Leave team', array(), NULL, 'boinc:leave-team-panel') . '</h2>';
965
-  $output .= '<p>' . bts('Click here to revoke your membership with'
962
+    $team = node_load($team_id);
963
+    $output = '';
964
+    $output .= '<h2 class="pane-title">' . bts('Leave team', array(), NULL, 'boinc:leave-team-panel') . '</h2>';
965
+    $output .= '<p>' . bts('Click here to revoke your membership with'
966 966
     . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel') . '</p>';
967
-  $output .= '<ul class="tab-list">';
968
-  $output .= '  <li class="first last tab">' .
967
+    $output .= '<ul class="tab-list">';
968
+    $output .= '  <li class="first last tab">' .
969 969
     l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave") . '</li>';
970
-  $output .= '</ul>';
971
-  return $output;
970
+    $output .= '</ul>';
971
+    return $output;
972 972
 }
973 973
 
974 974
 /**
975 975
  * General info about team admins
976 976
  */
977 977
 function boincteam_manage_admins_panel_header($team_id) {
978
-  $output = '';
979
-  $output .= '<h4>' . bts('Add team admin', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
980
-  $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
981
-  $output .= '<div class="clearfix"></div>';
982
-  $output .= '<h4>' . bts('Current team admins', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
978
+    $output = '';
979
+    $output .= '<h4>' . bts('Add team admin', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
980
+    $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
981
+    $output .= '<div class="clearfix"></div>';
982
+    $output .= '<h4>' . bts('Current team admins', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
983 983
 
984
-  return $output;
984
+    return $output;
985 985
 }
986 986
 
987 987
 /**
988 988
  * Team management tools
989 989
  */
990 990
 function boincteam_management_panel($team_id) {
991
-  $is_founder = boincteam_is_founder($team_id);
992
-  $team = node_load($team_id);
991
+    $is_founder = boincteam_is_founder($team_id);
992
+    $team = node_load($team_id);
993 993
 
994
-  $output = '';
995
-  $output .= '<h2 class="pane-title">' . bts('Manage team', array(), NULL, 'boinc:team-manage') . '</h2>';
994
+    $output = '';
995
+    $output .= '<h2 class="pane-title">' . bts('Manage team', array(), NULL, 'boinc:team-manage') . '</h2>';
996 996
 
997
-  // PM all members
998
-  if (module_exists('privatemsg')) {
997
+    // PM all members
998
+    if (module_exists('privatemsg')) {
999 999
     $output .= '<div class="form-item">';
1000 1000
     $output .= '  <ul class="tab-list action-list">';
1001 1001
     $output .= '    <li class="first tab primary">' .
1002
-      l('Send message to team', "community/teams/{$team_id}/message-all-members") . '</li>';
1002
+        l('Send message to team', "community/teams/{$team_id}/message-all-members") . '</li>';
1003 1003
     $output .= '  </ul>';
1004 1004
     $output .= '  <div class="description">';
1005 1005
     $output .=   bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage');
1006 1006
     $output .= '  </div>';
1007 1007
     $output .= '</div>';
1008
-  }
1008
+    }
1009 1009
 
1010
-  // Team forum
1011
-  if (module_exists('boincteam_forum')) {
1010
+    // Team forum
1011
+    if (module_exists('boincteam_forum')) {
1012 1012
     if ($is_founder) {
1013
-      // Determine whether to create a forum or edit the existing forum
1014
-      // (multiple forums per team could be supported in the future)
1015
-      $team_forum_link_path = 'add';
1016
-      $team_forums = boincteam_forum_list();
1017
-      if ($team_forums) {
1013
+        // Determine whether to create a forum or edit the existing forum
1014
+        // (multiple forums per team could be supported in the future)
1015
+        $team_forum_link_path = 'add';
1016
+        $team_forums = boincteam_forum_list();
1017
+        if ($team_forums) {
1018 1018
         $team_forum = reset($team_forums);
1019 1019
         $team_forum_link_path = "{$team_forum->tfid}/edit";
1020
-      }
1021
-      $output .= '<div class="form-item">';
1022
-      $output .= '  <ul class="tab-list action-list">';
1023
-      $output .= '    <li class="first tab primary">' .
1020
+        }
1021
+        $output .= '<div class="form-item">';
1022
+        $output .= '  <ul class="tab-list action-list">';
1023
+        $output .= '    <li class="first tab primary">' .
1024 1024
         l(bts('Manage team message board', array(), NULL, 'boinc:team-manage'),
1025
-          "community/teams/{$team_id}/forum/{$team_forum_link_path}"
1025
+            "community/teams/{$team_id}/forum/{$team_forum_link_path}"
1026 1026
         );
1027
-      $output .= '    </li>';
1028
-      $output .= '  <div class="description">';
1029
-      $output .=   bts('Create or manage message board', array(), NULL, 'boinc:team-manage');
1030
-      $output .= '  </div>';
1031
-      $output .= '</div>';
1027
+        $output .= '    </li>';
1028
+        $output .= '  <div class="description">';
1029
+        $output .=   bts('Create or manage message board', array(), NULL, 'boinc:team-manage');
1030
+        $output .= '  </div>';
1031
+        $output .= '</div>';
1032
+    }
1032 1033
     }
1033
-  }
1034 1034
 
1035
-  // Team history
1036
-  $output .= '<div class="form-item">';
1037
-  $output .= '  <label>' . bts('View change history', array(), NULL, 'boinc:team-manage') . '</label>';
1038
-  $output .= '  <ul class="tab-list">';
1039
-  $output .= '    <li class="first tab primary">' .
1035
+    // Team history
1036
+    $output .= '<div class="form-item">';
1037
+    $output .= '  <label>' . bts('View change history', array(), NULL, 'boinc:team-manage') . '</label>';
1038
+    $output .= '  <ul class="tab-list">';
1039
+    $output .= '    <li class="first tab primary">' .
1040 1040
     l('HTML', "community/teams/{$team_id}/history") . '</li>';
1041
-  $output .= '    <li class="last tab primary">' .
1041
+    $output .= '    <li class="last tab primary">' .
1042 1042
     l('XML', "community/teams/{$team_id}/history/xml") . '</li>';
1043
-  $output .= '  </ul>';
1044
-  $output .= '  <div class="description">';
1045
-  $output .=   bts('See member activity', array(), NULL, 'boinc:team-manage');
1046
-  $output .= '  </div>';
1047
-  $output .= '</div>';
1043
+    $output .= '  </ul>';
1044
+    $output .= '  <div class="description">';
1045
+    $output .=   bts('See member activity', array(), NULL, 'boinc:team-manage');
1046
+    $output .= '  </div>';
1047
+    $output .= '</div>';
1048 1048
 
1049
-  $output .= '<div class="form-item">';
1050
-  $output .= '  <ul class="tab-list action-list">';
1049
+    $output .= '<div class="form-item">';
1050
+    $output .= '  <ul class="tab-list action-list">';
1051 1051
 
1052
-  // Edit team information
1053
-  $output .= '    <li class="first tab primary">' .
1052
+    // Edit team information
1053
+    $output .= '    <li class="first tab primary">' .
1054 1054
     l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info") . '</li>';
1055 1055
 
1056
-  // Member list
1057
-  $output .= '    <li class="tab primary">' .
1056
+    // Member list
1057
+    $output .= '    <li class="tab primary">' .
1058 1058
     l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members") . '</li>';
1059 1059
 
1060
-  // Remove members
1061
-  $output .= '    <li class="tab primary">' .
1060
+    // Remove members
1061
+    $output .= '    <li class="tab primary">' .
1062 1062
     l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members") . '</li>';
1063 1063
 
1064
-  if ($is_founder) {
1064
+    if ($is_founder) {
1065 1065
 
1066 1066
     // Change founder
1067 1067
     $output .= '    <li class="tab primary">' .
1068
-      l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>';
1068
+        l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>';
1069 1069
 
1070
-      // Manage admins
1070
+        // Manage admins
1071 1071
     $output .= '    <li class="tab primary">' .
1072
-      l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>';
1072
+        l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>';
1073 1073
 
1074 1074
     // Delete the team
1075 1075
     $output .= '    <li class="last tab primary">' .
1076
-      l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>';
1077
-  }
1076
+        l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>';
1077
+    }
1078 1078
 
1079
-  $output .= '  </ul>';
1080
-  $output .= '</div>';
1079
+    $output .= '  </ul>';
1080
+    $output .= '</div>';
1081 1081
 
1082
-  return $output;
1082
+    return $output;
1083 1083
 }
1084 1084
 
1085 1085
 /**
1086 1086
  * Link to user's team
1087 1087
  */
1088 1088
 function boincteam_member_link_panel() {
1089
-  global $user;
1090
-  $account = user_load($user->uid);
1091
-  $team = node_load($account->team);
1092
-  $output = '';
1093
-  $output .= '<h2 class="pane-title">' . bts('My team', array(), NULL, 'boinc:account-team-panel') . '</h2>';
1094
-  $output .= '<p>' . bts('You are a member of @team.',
1089
+    global $user;
1090
+    $account = user_load($user->uid);
1091
+    $team = node_load($account->team);
1092
+    $output = '';
1093
+    $output .= '<h2 class="pane-title">' . bts('My team', array(), NULL, 'boinc:account-team-panel') . '</h2>';
1094
+    $output .= '<p>' . bts('You are a member of @team.',
1095 1095
     array('@team' => $team->title), NULL, 'boinc:account-team-panel') . '</p>';
1096
-  $output .= '<ul class="tab-list">';
1097
-  $output .= '  <li class="first last tab">' .
1096
+    $output .= '<ul class="tab-list">';
1097
+    $output .= '  <li class="first last tab">' .
1098 1098
     l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}") . '</li>';
1099
-  $output .= '</ul>';
1100
-  return $output;
1099
+    $output .= '</ul>';
1100
+    return $output;
1101 1101
 }
1102 1102
 
1103 1103
 /**
1104 1104
  * Link to request foundership transfer of a team
1105 1105
  */
1106 1106
 function boincteam_request_foundership_panel($team_id) {
1107
-  global $user;
1108
-  $account = user_load($user->uid);
1109
-  $team = node_load($team_id);
1110
-  $boincteam_id = boincteam_lookup_id($team_id);
1111
-  $boincteam = boincteam_load($boincteam_id);
1112
-  $boincuser_id = $account->boincuser_id;
1113
-  $output = '';
1114
-  $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), NULL, 'boinc:team-request-foundership') . '</h2>';
1107
+    global $user;
1108
+    $account = user_load($user->uid);
1109
+    $team = node_load($team_id);
1110
+    $boincteam_id = boincteam_lookup_id($team_id);
1111
+    $boincteam = boincteam_load($boincteam_id);
1112
+    $boincuser_id = $account->boincuser_id;
1113
+    $output = '';
1114
+    $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), NULL, 'boinc:team-request-foundership') . '</h2>';
1115 1115
 
1116
-  if (boincteam_user_requested_foundership($team_id)) {
1116
+    if (boincteam_user_requested_foundership($team_id)) {
1117 1117
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
1118 1118
     $days_to_deadline = ceil(($deadline - time()) / (24*60*60));
1119 1119
     $request_age = 60 - $days_to_deadline;
1120 1120
     $days_to_respond = 30 + $days_to_deadline;
1121 1121
     if (time() > $deadline) {
1122
-      $output .= '<p>';
1123
-      if ($request_age == 1) {
1122
+        $output .= '<p>';
1123
+        if ($request_age == 1) {
1124 1124
         $output .= bts('1 day has elapsed since your request and'
1125
-          . ' the founder has not responded.', array(), NULL, 'boinc:team-request-foundership');
1126
-      }
1127
-      else {
1125
+            . ' the founder has not responded.', array(), NULL, 'boinc:team-request-foundership');
1126
+        }
1127
+        else {
1128 1128
         $output .= bts('@count days have elapsed since your request and'
1129
-          . ' the founder has not responded.',
1130
-          array('@count' => $request_age),
1131
-          NULL, 'boinc:team-request-foundership');
1132
-      }
1133
-      $output .= ' ';
1134
-      if ($days_to_respond == 1) {
1129
+            . ' the founder has not responded.',
1130
+            array('@count' => $request_age),
1131
+            NULL, 'boinc:team-request-foundership');
1132
+        }
1133
+        $output .= ' ';
1134
+        if ($days_to_respond == 1) {
1135 1135
         $output .= bts('You now have 1 day to assume foundership before'
1136
-          . ' another team member may submit a request.', array(), NULL, 'boinc:team-request-foundership');
1137
-      }
1138
-      else {
1136
+            . ' another team member may submit a request.', array(), NULL, 'boinc:team-request-foundership');
1137
+        }
1138
+        else {
1139 1139
         $output .= bts('You now have @count days to assume foundership before'
1140
-          . ' another team member may submit a request.',
1141
-          array('@count' => $days_to_respond),
1142
-          NULL, 'boinc:team-request-foundership');
1143
-      }
1144
-      $output .= '</p>';
1145
-      $output .= '<ul class="tab-list">';
1146
-      $output .= '  <li class="first last tab">' .
1140
+            . ' another team member may submit a request.',
1141
+            array('@count' => $days_to_respond),
1142
+            NULL, 'boinc:team-request-foundership');
1143
+        }
1144
+        $output .= '</p>';
1145
+        $output .= '<ul class="tab-list">';
1146
+        $output .= '  <li class="first last tab">' .
1147 1147
         l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1148
-      $output .= '</ul>';
1148
+        $output .= '</ul>';
1149 1149
     }
1150 1150
     else {
1151
-      $output .= '<p>';
1152
-      if ($days_to_deadline == 1) {
1151
+        $output .= '<p>';
1152
+        if ($days_to_deadline == 1) {
1153 1153
         $output .= bts('The team founder has 1 day to respond to your'
1154
-          . ' transfer request.',
1155
-          NULL, 'boinc:team-request-foundership');
1156
-      }
1157
-      else {
1154
+            . ' transfer request.',
1155
+            NULL, 'boinc:team-request-foundership');
1156
+        }
1157
+        else {
1158 1158
         $output .= bts('The team founder has @count days to respond to your'
1159
-          . ' transfer request.', array('@count' => $days_to_deadline),
1160
-          NULL, 'boinc:team-request-foundership');
1161
-      }
1162
-      $output .= '</p>';
1159
+            . ' transfer request.', array('@count' => $days_to_deadline),
1160
+            NULL, 'boinc:team-request-foundership');
1161
+        }
1162
+        $output .= '</p>';
1163 1163
     }
1164
-  }
1165
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1164
+    }
1165
+    elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1166 1166
     // If this user does not have a transfer request pending, but new requests
1167 1167
     // are not allowed, set the deadline to 90 days instead of 60 (as the user
1168 1168
     // who made the request has 30 additional days to assume foundership if
@@ -1171,131 +1171,131 @@  discard block
 block discarded – undo
1171 1171
     $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30;
1172 1172
     $output .= '<p>';
1173 1173
     $output .= bts('A team foundership change was already requested recently.'
1174
-      . ' Only one request is allowed within a period of 90 days.',
1175
-      NULL, 'boinc:team-request-foundership');
1174
+        . ' Only one request is allowed within a period of 90 days.',
1175
+        NULL, 'boinc:team-request-foundership');
1176 1176
     if ($days_to_deadline == 1) {
1177
-      $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')';
1177
+        $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')';
1178 1178
     }
1179 1179
     else {
1180
-      $output .= ' (' . bts('@count days remaining',
1180
+        $output .= ' (' . bts('@count days remaining',
1181 1181
         array('@count' => $days_to_deadline),
1182 1182
         NULL, 'boinc:team-request-foundership') . ')';
1183 1183
     }
1184 1184
     $output .= '</p>';
1185
-  }
1186
-  else {
1185
+    }
1186
+    else {
1187 1187
     $output .= '<p>' . bts('If the team founder is not active and you want to'
1188
-      . ' assume the role of founder, click below to request foundership of'
1189
-      . ' @this_team.',
1190
-      array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership') . '</p>';
1188
+        . ' assume the role of founder, click below to request foundership of'
1189
+        . ' @this_team.',
1190
+        array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership') . '</p>';
1191 1191
     $output .= '<ul class="tab-list">';
1192 1192
     $output .= '  <li class="first last tab">' .
1193
-      l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>';
1193
+        l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>';
1194 1194
     $output .= '</ul>';
1195
-  }
1196
-  return $output;
1195
+    }
1196
+    return $output;
1197 1197
 }
1198 1198
 
1199 1199
 /**
1200 1200
  * Respond to foundership transfer requests for a team
1201 1201
  */
1202 1202
 function boincteam_request_foundership_response_panel($team_id) {
1203
-  global $user;
1204
-  $account = user_load($user->uid);
1205
-  $team = node_load($team_id);
1206
-  $boincteam_id = boincteam_lookup_id($team_id);
1207
-  $boincteam = boincteam_load($boincteam_id);
1208
-  $boincuser_id = $account->boincuser_id;
1209
-  $output = '';
1203
+    global $user;
1204
+    $account = user_load($user->uid);
1205
+    $team = node_load($team_id);
1206
+    $boincteam_id = boincteam_lookup_id($team_id);
1207
+    $boincteam = boincteam_load($boincteam_id);
1208
+    $boincuser_id = $account->boincuser_id;
1209
+    $output = '';
1210 1210
 
1211
-  if ($boincteam->ping_user) {
1211
+    if ($boincteam->ping_user) {
1212 1212
     if ($boincteam->ping_user < 0) {
1213
-      $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1214
-      $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1213
+        $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1214
+        $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1215 1215
         . '</h2>';
1216
-      $output .= '<p>' . bts('Team member @name requested team foundership on'
1216
+        $output .= '<p>' . bts('Team member @name requested team foundership on'
1217 1217
         . ' @date, but then left the team. This request is now canceled.',
1218 1218
         array(
1219
-          '@name' => $member->boincuser_name,
1220
-          '@date' => date('j M Y', $boincteam->ping_time),
1219
+            '@name' => $member->boincuser_name,
1220
+            '@date' => date('j M Y', $boincteam->ping_time),
1221 1221
         ),
1222 1222
         NULL, 'boinc:team-request-foundership-response') . '</p>';
1223
-      // Automatically cancel the request
1224
-      db_set_active('boinc_rw');
1225
-      db_query("
1223
+        // Automatically cancel the request
1224
+        db_set_active('boinc_rw');
1225
+        db_query("
1226 1226
         UPDATE {team}
1227 1227
         SET ping_user=0
1228 1228
         WHERE id = '%d'",
1229 1229
         $boincteam_id
1230
-      );
1231
-      db_set_active('default');
1230
+        );
1231
+        db_set_active('default');
1232 1232
     }
1233 1233
     else {
1234
-      $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1235
-      $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1234
+        $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1235
+        $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1236 1236
         . '</h2>';
1237
-      $output .= '<p>' . bts('Team member @name has requested team foundership.'
1237
+        $output .= '<p>' . bts('Team member @name has requested team foundership.'
1238 1238
         . ' This may be because you left the team or have not had contact with'
1239 1239
         . ' the team for a long time.', array(
1240
-          '@name' => $member->boincuser_name,
1240
+            '@name' => $member->boincuser_name,
1241 1241
         )
1242
-      , array(), NULL, 'boinc:team-request-foundership-response') . '</p>';
1243
-      $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1242
+        , array(), NULL, 'boinc:team-request-foundership-response') . '</p>';
1243
+        $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1244 1244
         . ' will have the option of assuming team foundership. (note: To'
1245 1245
         . ' accept the request, assign foundership to @name using the form'
1246 1246
         . ' below)',
1247 1247
         array(
1248
-          '@name' => $member->boincuser_name,
1249
-          '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1248
+            '@name' => $member->boincuser_name,
1249
+            '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1250 1250
         ),
1251 1251
         NULL, 'boinc:team-request-foundership-response') . '</p>';
1252
-      $output .= '<ul class="tab-list">';
1253
-      $output .= '  <li class="first last tab">' .
1252
+        $output .= '<ul class="tab-list">';
1253
+        $output .= '  <li class="first last tab">' .
1254 1254
         l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request") . '</li>';
1255
-      $output .= '</ul>';
1255
+        $output .= '</ul>';
1256 1256
     }
1257
-  }
1258
-  return $output;
1257
+    }
1258
+    return $output;
1259 1259
 }
1260 1260
 
1261 1261
 function boincteam_search_panel() {
1262
-  $output = '';
1263
-  if (module_exists('global_search_teams_solr')) {
1262
+    $output = '';
1263
+    if (module_exists('global_search_teams_solr')) {
1264 1264
     $output .= '<h2 class="pane-title">' . bts('Search teams', array(), NULL, 'boinc:search-team') . '</h2>';
1265 1265
     //$output .= '<p>' . bts('Render a search form here.', array(), NULL, 'boinc:search-team') . '</p>';
1266 1266
     $output .= '<p>' . boincteam_search_view() . '</p>';
1267
-  }
1268
-  return $output;
1267
+    }
1268
+    return $output;
1269 1269
 }
1270 1270
 
1271 1271
 function boincteam_search_view($type = 'team') {
1272
-  // Get the team search form
1273
-  $search_page = apachesolr_search_page_load('team_search');
1274
-  module_load_include('inc', 'apachesolr_search', 'apachesolr_search.pages');
1275
-  return drupal_get_form('apachesolr_search_custom_page_search_form', $search_page);
1272
+    // Get the team search form
1273
+    $search_page = apachesolr_search_page_load('team_search');
1274
+    module_load_include('inc', 'apachesolr_search', 'apachesolr_search.pages');
1275
+    return drupal_get_form('apachesolr_search_custom_page_search_form', $search_page);
1276 1276
 }
1277 1277
 
1278 1278
 /**
1279 1279
  * General info about the concept of teams
1280 1280
  */
1281 1281
 function boincteam_topic_overview_panel() {
1282
-  $site_name =  variable_get('site_name', 'Drupal-BOINC');
1283
-  $output = '';
1284
-  $output .= '<h2 class="pane-title">' . bts('Teams', array(), NULL, 'boinc:team-general-info') . '</h2>';
1285
-  $output .= '<div class="">';
1286
-  $output .= '<p>' . bts('@project participants may form teams. You may belong'
1282
+    $site_name =  variable_get('site_name', 'Drupal-BOINC');
1283
+    $output = '';
1284
+    $output .= '<h2 class="pane-title">' . bts('Teams', array(), NULL, 'boinc:team-general-info') . '</h2>';
1285
+    $output .= '<div class="">';
1286
+    $output .= '<p>' . bts('@project participants may form teams. You may belong'
1287 1287
     . ' to only one team. You can join or quit a team at any time. To join a'
1288 1288
     . ' team, visit its team page and click "Join this team". Each team has a'
1289 1289
     . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info') . '</p>';
1290
-  $output .= '<ul>';
1291
-  $output .= '  <li>' . bts('Private Message all team members', array(), NULL, 'boinc:team-general-info') . '</li>';
1292
-  $output .= '  <li>' . bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info') . '</li>';
1293
-  $output .= '  <li>' . bts('add or remove team admins', array(), NULL, 'boinc:team-general-info') . '</li>';
1294
-  $output .= '  <li>' . bts('remove members from the team', array(), NULL, 'boinc:team-general-info') . '</li>';
1295
-  $output .= '  <li>' . bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info') . '</li>';
1296
-  $output .= '</ul>';
1297
-  $output .= '</div>';
1298
-  return $output;
1290
+    $output .= '<ul>';
1291
+    $output .= '  <li>' . bts('Private Message all team members', array(), NULL, 'boinc:team-general-info') . '</li>';
1292
+    $output .= '  <li>' . bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info') . '</li>';
1293
+    $output .= '  <li>' . bts('add or remove team admins', array(), NULL, 'boinc:team-general-info') . '</li>';
1294
+    $output .= '  <li>' . bts('remove members from the team', array(), NULL, 'boinc:team-general-info') . '</li>';
1295
+    $output .= '  <li>' . bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info') . '</li>';
1296
+    $output .= '</ul>';
1297
+    $output .= '</div>';
1298
+    return $output;
1299 1299
 }
1300 1300
 
1301 1301
 /**
@@ -1323,50 +1323,50 @@  discard block
 block discarded – undo
1323 1323
  * Link to view a team
1324 1324
  */
1325 1325
 function boincteam_view_team_panel($team_id) {
1326
-  $team = node_load($team_id);
1327
-  if ($team->type != "team") {
1326
+    $team = node_load($team_id);
1327
+    if ($team->type != "team") {
1328 1328
     return;
1329
-  }
1330
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
1331
-  $founder = user_load(get_drupal_id($boincteam->userid));
1332
-  $new_members = array();
1333
-  if ($boincteam->new_members) {
1329
+    }
1330
+    $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
1331
+    $founder = user_load(get_drupal_id($boincteam->userid));
1332
+    $new_members = array();
1333
+    if ($boincteam->new_members) {
1334 1334
     foreach ($boincteam->new_members as $member) {
1335
-      $account = user_load(get_drupal_id($member->id));
1336
-      $new_members[] = l($account->boincuser_name, "account/{$account->uid}");
1335
+        $account = user_load(get_drupal_id($member->id));
1336
+        $new_members[] = l($account->boincuser_name, "account/{$account->uid}");
1337 1337
     }
1338
-  }
1339
-  $output = '';
1340
-  $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>';
1341
-  $output .= '<div>';
1342
-  $output .= '<div class="left-column">';
1343
-  $output .= '<ul class="stats">';
1344
-  $output .= '  <li>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>';
1345
-  $output .= '  <li>' . bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1346
-  $output .= '  <li>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>';
1347
-  $output .= '  <li>' . bts('Type', array(), NULL, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>';
1348
-  $output .= '</ul>';
1349
-  $output .= '</div>';
1350
-  $output .= '<div class="right-column">';
1351
-  $output .= '<ul class="stats">';
1352
-  $output .= '  <li>' . bts('Founder', array(), NULL, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1353
-  $output .= '  <li>' . bts('New members in last day', array(), NULL, 'boinc:view-team-info') . ': ' . implode('&middot;', $new_members) . '</li>';
1354
-  $output .= '  <li>' . bts('Total members', array(), NULL, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1355
-  $output .= '  <li>' . bts('Active members', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>';
1356
-  $output .= '  <li>' . bts('Members with credit', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>';
1357
-  $output .= '</ul>';
1358
-  $output .= '</div>';
1359
-  $output .= '</div>';
1360
-  $output .= '<div class="clearfix"></div>';
1361
-  if ($boincteam->url) {
1338
+    }
1339
+    $output = '';
1340
+    $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>';
1341
+    $output .= '<div>';
1342
+    $output .= '<div class="left-column">';
1343
+    $output .= '<ul class="stats">';
1344
+    $output .= '  <li>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>';
1345
+    $output .= '  <li>' . bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1346
+    $output .= '  <li>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>';
1347
+    $output .= '  <li>' . bts('Type', array(), NULL, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>';
1348
+    $output .= '</ul>';
1349
+    $output .= '</div>';
1350
+    $output .= '<div class="right-column">';
1351
+    $output .= '<ul class="stats">';
1352
+    $output .= '  <li>' . bts('Founder', array(), NULL, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1353
+    $output .= '  <li>' . bts('New members in last day', array(), NULL, 'boinc:view-team-info') . ': ' . implode('&middot;', $new_members) . '</li>';
1354
+    $output .= '  <li>' . bts('Total members', array(), NULL, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1355
+    $output .= '  <li>' . bts('Active members', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>';
1356
+    $output .= '  <li>' . bts('Members with credit', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>';
1357
+    $output .= '</ul>';
1358
+    $output .= '</div>';
1359
+    $output .= '</div>';
1360
+    $output .= '<div class="clearfix"></div>';
1361
+    if ($boincteam->url) {
1362 1362
     $output .= '<div class="stats">';
1363 1363
     $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}");
1364 1364
     $output .= '</div>';
1365
-  }
1366
-  if ($team->body) {
1365
+    }
1366
+    if ($team->body) {
1367 1367
     $output .= '<h3>' . bts('Description', array(), NULL, 'boinc:team-description') . '</h3>';
1368 1368
     $output .= check_markup($team->body, $team->format);
1369 1369
     $output .= '</div>';
1370
-  }
1371
-  return $output;
1370
+    }
1371
+    return $output;
1372 1372
 }
Please login to merge, or discard this patch.
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -62,21 +62,21 @@  discard block
 block discarded – undo
62 62
   );
63 63
   $items['community/teams/%/edit/admins/remove/%'] = array(
64 64
     'page callback' => 'boincteam_remove_admin',
65
-    'page arguments' => array(2,6),
65
+    'page arguments' => array(2, 6),
66 66
     'access callback' => 'boincteam_is_founder',
67 67
     'access arguments' => array(2),
68 68
     'type' => MENU_CALLBACK
69 69
   );
70 70
   $items['community/teams/%/edit/founder/set/%'] = array(
71 71
     'page callback' => 'boincteam_set_founder',
72
-    'page arguments' => array(2,6),
72
+    'page arguments' => array(2, 6),
73 73
     'access callback' => 'boincteam_is_founder',
74 74
     'access arguments' => array(2),
75 75
     'type' => MENU_CALLBACK
76 76
   );
77 77
   $items['community/teams/%/edit/members/remove/%'] = array(
78 78
     'page callback' => 'boincteam_remove_member',
79
-    'page arguments' => array(2,6),
79
+    'page arguments' => array(2, 6),
80 80
     'access callback' => 'boincteam_is_founder',
81 81
     'access arguments' => array(2),
82 82
     'type' => MENU_CALLBACK
@@ -725,12 +725,12 @@  discard block
 block discarded – undo
725 725
   $boincteam = boincteam_load($boincteam_id);
726 726
   $now = time();
727 727
   if ($boincteam->ping_user <= 0) {
728
-    if ($boincteam->ping_time < $now - 60 * (24*60*60)) {
728
+    if ($boincteam->ping_time < $now - 60*(24*60*60)) {
729 729
       return TRUE;
730 730
     }
731 731
     return FALSE;
732 732
   }
733
-  if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
733
+  if ($boincteam->ping_time < $now - 90*(24*60*60)) {
734 734
     return TRUE;
735 735
   }
736 736
   return FALSE;
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
  * responded to the request
742 742
  */
743 743
 function boincteam_foundership_transfer_ok_time($boincteam) {
744
-    return $boincteam->ping_time + 60 * (24*60*60);
744
+    return $boincteam->ping_time + 60*(24*60*60);
745 745
 }
746 746
 
747 747
 /**
@@ -779,26 +779,26 @@  discard block
 block discarded – undo
779 779
  */
780 780
 function boincteam_about_admins_panel() {
781 781
   $output = '';
782
-  $output .= '<h2 class="pane-title">' . bts('About team admins', array(), NULL, 'boinc:team-admins-panel') . '</h2>';
782
+  $output .= '<h2 class="pane-title">'.bts('About team admins', array(), NULL, 'boinc:team-admins-panel').'</h2>';
783 783
   $output .= '<div>';
784
-  $output .= '<p>' . bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
784
+  $output .= '<p>'.bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel').'</p>';
785 785
   $output .= '<ul>';
786
-  $output .= '  <li>' . bts('Edit team information', array(), NULL, 'boinc:team-admins-panel') . '</li>';
787
-  $output .= '  <li>' . bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel') . '</li>';
788
-  $output .= '  <li>' . bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel') . '</li>';
789
-  $output .= '  <li>' . bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel') . '</li>';
790
-  $output .= '  <li>' . bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
786
+  $output .= '  <li>'.bts('Edit team information', array(), NULL, 'boinc:team-admins-panel').'</li>';
787
+  $output .= '  <li>'.bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel').'</li>';
788
+  $output .= '  <li>'.bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel').'</li>';
789
+  $output .= '  <li>'.bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel').'</li>';
790
+  $output .= '  <li>'.bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel').'</li>';
791 791
   $output .= '</ul>';
792 792
   $output .= '</div>';
793 793
   $output .= '<div>';
794
-  $output .= '<p>' . bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
794
+  $output .= '<p>'.bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel').'</p>';
795 795
   $output .= '<ul>';
796
-  $output .= '  <li>' . bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel') . '</li>';
797
-  $output .= '  <li>' . bts('Remove members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
798
-  $output .= '  <li>' . bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel') . '</li>';
796
+  $output .= '  <li>'.bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel').'</li>';
797
+  $output .= '  <li>'.bts('Remove members', array(), NULL, 'boinc:team-admins-panel').'</li>';
798
+  $output .= '  <li>'.bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel').'</li>';
799 799
   $output .= '</ul>';
800 800
   $output .= '</div>';
801
-  $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
801
+  $output .= '<p>'.bts('If a team admin quits the team, they cease to be a'
802 802
     . ' team admin. We recommend only selecting people you know and trust', array(), NULL, 'boinc:team-admins-panel')
803 803
     . '</p>';
804 804
   return $output;
@@ -809,26 +809,26 @@  discard block
 block discarded – undo
809 809
  */
810 810
 function boincteam_about_founder_panel() {
811 811
   $output = '';
812
-  $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel')
812
+  $output .= '<h2 class="pane-title">'.bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel')
813 813
     . '</h2>';
814 814
   $output .= '<div>';
815
-  $output .= '<p>' . bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel') . '</p>';
815
+  $output .= '<p>'.bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel').'</p>';
816 816
   $output .= '<ul>';
817
-  $output .= '  <li>' . bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel') . '</li>';
818
-  $output .= '  <li>' . bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel') . '</li>';
817
+  $output .= '  <li>'.bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel').'</li>';
818
+  $output .= '  <li>'.bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel').'</li>';
819 819
   $output .= '</ul>';
820 820
   $output .= '</div>';
821 821
   $output .= '<div>';
822
-  $output .= '<p>' . bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel')
822
+  $output .= '<p>'.bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel')
823 823
     . '</p>';
824 824
   $output .= '<ul>';
825
-  $output .= '  <li>' . bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel') . '</li>';
826
-  $output .= '  <li>' . bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel')
825
+  $output .= '  <li>'.bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel').'</li>';
826
+  $output .= '  <li>'.bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel')
827 827
     . '</li>';
828
-  $output .= '  <li>' . bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel')
828
+  $output .= '  <li>'.bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel')
829 829
     . '</li>';
830
-  $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
831
-    . ' request', array(), NULL, 'boinc:team-founder-panel') . '</li>';
830
+  $output .= '  <li>'.bts('Current founder has 60 days to respond to a'
831
+    . ' request', array(), NULL, 'boinc:team-founder-panel').'</li>';
832 832
   $output .= '</ul>';
833 833
   $output .= '</div>';
834 834
   return $output;
@@ -842,9 +842,9 @@  discard block
 block discarded – undo
842 842
   $account = user_load($user->uid);
843 843
   $unrestricted_role = array_search('verified contributor', user_roles(true));
844 844
   $output = '';
845
-  $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
846
-  $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
847
-    . ' can create a team.', array(), NULL, 'boinc:create-team-panel') . '</p>';
845
+  $output .= '<h2 class="pane-title">'.bts('Create a new team', array(), NULL, 'boinc:create-team-panel').'</h2>';
846
+  $output .= '<p>'.bts('If you cannot find a team that is right for you, you'
847
+    . ' can create a team.', array(), NULL, 'boinc:create-team-panel').'</p>';
848 848
   $output .= '<ul class="tab-list">';
849 849
   $output .= '  <li class="first last tab">';
850 850
   if (isset($account->roles[$unrestricted_role])) {
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
  */
881 881
 function boincteam_create_team_panel() {
882 882
   $output = '';
883
-  $output .= '<h2 class="pane-title">' . bts('Create a team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
883
+  $output .= '<h2 class="pane-title">'.bts('Create a team', array(), NULL, 'boinc:create-team-panel').'</h2>';
884 884
   $output .= drupal_get_form('boincteam_create_form');
885 885
 
886 886
   return $output;
@@ -898,26 +898,26 @@  discard block
 block discarded – undo
898 898
   $account = user_load($uid);
899 899
   if ($account->team) {
900 900
     $team = boincteam_load(boincteam_lookup_id($account->team));
901
-    $output .= '<h2 class="pane-title">' . bts('Team', array(), NULL, 'boinc:team-dashboard') . '</h2>';
901
+    $output .= '<h2 class="pane-title">'.bts('Team', array(), NULL, 'boinc:team-dashboard').'</h2>';
902 902
     $output .= '<div class="stats">';
903
-    $output .= '  <label>' . bts('Name', array(), NULL, 'boinc:user-or-team-name') . ': </label>';
904
-    $output .= '  <span>' . l($team->name, "community/teams/{$account->team}") . '</span>';
905
-    $output .= '</div>' . "\n";
903
+    $output .= '  <label>'.bts('Name', array(), NULL, 'boinc:user-or-team-name').': </label>';
904
+    $output .= '  <span>'.l($team->name, "community/teams/{$account->team}").'</span>';
905
+    $output .= '</div>'."\n";
906 906
     $output .= '<div class="stats">';
907
-    $output .= '  <label>' . bts('Member since', array(), NULL, 'boinc:user-info') . ': </label>';
908
-    $output .= '  <span>' . date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)) . '</span>';
909
-    $output .= '</div>' . "\n";
907
+    $output .= '  <label>'.bts('Member since', array(), NULL, 'boinc:user-info').': </label>';
908
+    $output .= '  <span>'.date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)).'</span>';
909
+    $output .= '</div>'."\n";
910 910
     $output .= '<div class="stats">';
911
-    $output .= '  <label>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': </label>';
912
-    $output .= '  <span>' . $team->country . '</span>';
913
-    $output .= '</div>' . "\n";
911
+    $output .= '  <label>'.bts('Country', array(), NULL, 'boinc:country-of-origin').': </label>';
912
+    $output .= '  <span>'.$team->country.'</span>';
913
+    $output .= '</div>'."\n";
914 914
     $output .= '<div class="stats">';
915
-    $output .= '  <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>';
916
-    $output .= '  <span>' . number_format($team->total_credit, 0) . '</span>';
917
-    $output .= '</div>' . "\n";
915
+    $output .= '  <label>'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').': </label>';
916
+    $output .= '  <span>'.number_format($team->total_credit, 0).'</span>';
917
+    $output .= '</div>'."\n";
918 918
   }
919 919
   else if ($user->uid == $account->uid) {
920
-    $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>';
920
+    $output .= '<h2 class="pane-title">'.bts('Team (None)', array(), NULL, 'boinc:team-dashboard').'</h2>';
921 921
     $output .= '<ul class="tab-list action-list">';
922 922
     $output .= '<li class="tab primary">';
923 923
     $output .= l(bts('Join a Team', array(), NULL, 'boinc:team-dashboard'), 'community/teams');
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 function boincteam_edit_team_panel($team_id) {
934 934
   $team = node_load($team_id);
935 935
   $output = '';
936
-  $output .= '<h2 class="pane-title">' . $team->title . '</h2>';
936
+  $output .= '<h2 class="pane-title">'.$team->title.'</h2>';
937 937
   $output .= drupal_get_form('boincteam_edit_form', $team_id);
938 938
 
939 939
   return $output;
@@ -945,12 +945,12 @@  discard block
 block discarded – undo
945 945
 function boincteam_join_team_panel($team_id) {
946 946
   $team = node_load($team_id);
947 947
   $output = '';
948
-  $output .= '<h2 class="pane-title">' . bts('Join team', array(), NULL, 'boinc:join-team-panel') . '</h2>';
949
-  $output .= '<p>' . bts('Click here to become a member of @this_team',
950
-    array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel') . '</p>';
948
+  $output .= '<h2 class="pane-title">'.bts('Join team', array(), NULL, 'boinc:join-team-panel').'</h2>';
949
+  $output .= '<p>'.bts('Click here to become a member of @this_team',
950
+    array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel').'</p>';
951 951
   $output .= '<ul class="tab-list">';
952
-  $output .= '  <li class="first last tab">' .
953
-    l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join") . '</li>';
952
+  $output .= '  <li class="first last tab">'.
953
+    l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join").'</li>';
954 954
   $output .= '</ul>';
955 955
   return $output;
956 956
 }
@@ -961,12 +961,12 @@  discard block
 block discarded – undo
961 961
 function boincteam_leave_team_panel($team_id) {
962 962
   $team = node_load($team_id);
963 963
   $output = '';
964
-  $output .= '<h2 class="pane-title">' . bts('Leave team', array(), NULL, 'boinc:leave-team-panel') . '</h2>';
965
-  $output .= '<p>' . bts('Click here to revoke your membership with'
966
-    . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel') . '</p>';
964
+  $output .= '<h2 class="pane-title">'.bts('Leave team', array(), NULL, 'boinc:leave-team-panel').'</h2>';
965
+  $output .= '<p>'.bts('Click here to revoke your membership with'
966
+    . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel').'</p>';
967 967
   $output .= '<ul class="tab-list">';
968
-  $output .= '  <li class="first last tab">' .
969
-    l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave") . '</li>';
968
+  $output .= '  <li class="first last tab">'.
969
+    l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave").'</li>';
970 970
   $output .= '</ul>';
971 971
   return $output;
972 972
 }
@@ -976,10 +976,10 @@  discard block
 block discarded – undo
976 976
  */
977 977
 function boincteam_manage_admins_panel_header($team_id) {
978 978
   $output = '';
979
-  $output .= '<h4>' . bts('Add team admin', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
979
+  $output .= '<h4>'.bts('Add team admin', array(), NULL, 'boinc:team-manage-admins').'</h4>';
980 980
   $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
981 981
   $output .= '<div class="clearfix"></div>';
982
-  $output .= '<h4>' . bts('Current team admins', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
982
+  $output .= '<h4>'.bts('Current team admins', array(), NULL, 'boinc:team-manage-admins').'</h4>';
983 983
 
984 984
   return $output;
985 985
 }
@@ -992,17 +992,17 @@  discard block
 block discarded – undo
992 992
   $team = node_load($team_id);
993 993
 
994 994
   $output = '';
995
-  $output .= '<h2 class="pane-title">' . bts('Manage team', array(), NULL, 'boinc:team-manage') . '</h2>';
995
+  $output .= '<h2 class="pane-title">'.bts('Manage team', array(), NULL, 'boinc:team-manage').'</h2>';
996 996
 
997 997
   // PM all members
998 998
   if (module_exists('privatemsg')) {
999 999
     $output .= '<div class="form-item">';
1000 1000
     $output .= '  <ul class="tab-list action-list">';
1001
-    $output .= '    <li class="first tab primary">' .
1002
-      l('Send message to team', "community/teams/{$team_id}/message-all-members") . '</li>';
1001
+    $output .= '    <li class="first tab primary">'.
1002
+      l('Send message to team', "community/teams/{$team_id}/message-all-members").'</li>';
1003 1003
     $output .= '  </ul>';
1004 1004
     $output .= '  <div class="description">';
1005
-    $output .=   bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage');
1005
+    $output .= bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage');
1006 1006
     $output .= '  </div>';
1007 1007
     $output .= '</div>';
1008 1008
   }
@@ -1020,13 +1020,13 @@  discard block
 block discarded – undo
1020 1020
       }
1021 1021
       $output .= '<div class="form-item">';
1022 1022
       $output .= '  <ul class="tab-list action-list">';
1023
-      $output .= '    <li class="first tab primary">' .
1023
+      $output .= '    <li class="first tab primary">'.
1024 1024
         l(bts('Manage team message board', array(), NULL, 'boinc:team-manage'),
1025 1025
           "community/teams/{$team_id}/forum/{$team_forum_link_path}"
1026 1026
         );
1027 1027
       $output .= '    </li>';
1028 1028
       $output .= '  <div class="description">';
1029
-      $output .=   bts('Create or manage message board', array(), NULL, 'boinc:team-manage');
1029
+      $output .= bts('Create or manage message board', array(), NULL, 'boinc:team-manage');
1030 1030
       $output .= '  </div>';
1031 1031
       $output .= '</div>';
1032 1032
     }
@@ -1034,15 +1034,15 @@  discard block
 block discarded – undo
1034 1034
 
1035 1035
   // Team history
1036 1036
   $output .= '<div class="form-item">';
1037
-  $output .= '  <label>' . bts('View change history', array(), NULL, 'boinc:team-manage') . '</label>';
1037
+  $output .= '  <label>'.bts('View change history', array(), NULL, 'boinc:team-manage').'</label>';
1038 1038
   $output .= '  <ul class="tab-list">';
1039
-  $output .= '    <li class="first tab primary">' .
1040
-    l('HTML', "community/teams/{$team_id}/history") . '</li>';
1041
-  $output .= '    <li class="last tab primary">' .
1042
-    l('XML', "community/teams/{$team_id}/history/xml") . '</li>';
1039
+  $output .= '    <li class="first tab primary">'.
1040
+    l('HTML', "community/teams/{$team_id}/history").'</li>';
1041
+  $output .= '    <li class="last tab primary">'.
1042
+    l('XML', "community/teams/{$team_id}/history/xml").'</li>';
1043 1043
   $output .= '  </ul>';
1044 1044
   $output .= '  <div class="description">';
1045
-  $output .=   bts('See member activity', array(), NULL, 'boinc:team-manage');
1045
+  $output .= bts('See member activity', array(), NULL, 'boinc:team-manage');
1046 1046
   $output .= '  </div>';
1047 1047
   $output .= '</div>';
1048 1048
 
@@ -1050,30 +1050,30 @@  discard block
 block discarded – undo
1050 1050
   $output .= '  <ul class="tab-list action-list">';
1051 1051
 
1052 1052
   // Edit team information
1053
-  $output .= '    <li class="first tab primary">' .
1054
-    l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info") . '</li>';
1053
+  $output .= '    <li class="first tab primary">'.
1054
+    l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info").'</li>';
1055 1055
 
1056 1056
   // Member list
1057
-  $output .= '    <li class="tab primary">' .
1058
-    l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members") . '</li>';
1057
+  $output .= '    <li class="tab primary">'.
1058
+    l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members").'</li>';
1059 1059
 
1060 1060
   // Remove members
1061
-  $output .= '    <li class="tab primary">' .
1062
-    l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members") . '</li>';
1061
+  $output .= '    <li class="tab primary">'.
1062
+    l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members").'</li>';
1063 1063
 
1064 1064
   if ($is_founder) {
1065 1065
 
1066 1066
     // Change founder
1067
-    $output .= '    <li class="tab primary">' .
1068
-      l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>';
1067
+    $output .= '    <li class="tab primary">'.
1068
+      l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder").'</li>';
1069 1069
 
1070 1070
       // Manage admins
1071
-    $output .= '    <li class="tab primary">' .
1072
-      l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>';
1071
+    $output .= '    <li class="tab primary">'.
1072
+      l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins").'</li>';
1073 1073
 
1074 1074
     // Delete the team
1075
-    $output .= '    <li class="last tab primary">' .
1076
-      l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>';
1075
+    $output .= '    <li class="last tab primary">'.
1076
+      l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete").'</li>';
1077 1077
   }
1078 1078
 
1079 1079
   $output .= '  </ul>';
@@ -1090,12 +1090,12 @@  discard block
 block discarded – undo
1090 1090
   $account = user_load($user->uid);
1091 1091
   $team = node_load($account->team);
1092 1092
   $output = '';
1093
-  $output .= '<h2 class="pane-title">' . bts('My team', array(), NULL, 'boinc:account-team-panel') . '</h2>';
1094
-  $output .= '<p>' . bts('You are a member of @team.',
1095
-    array('@team' => $team->title), NULL, 'boinc:account-team-panel') . '</p>';
1093
+  $output .= '<h2 class="pane-title">'.bts('My team', array(), NULL, 'boinc:account-team-panel').'</h2>';
1094
+  $output .= '<p>'.bts('You are a member of @team.',
1095
+    array('@team' => $team->title), NULL, 'boinc:account-team-panel').'</p>';
1096 1096
   $output .= '<ul class="tab-list">';
1097
-  $output .= '  <li class="first last tab">' .
1098
-    l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}") . '</li>';
1097
+  $output .= '  <li class="first last tab">'.
1098
+    l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}").'</li>';
1099 1099
   $output .= '</ul>';
1100 1100
   return $output;
1101 1101
 }
@@ -1111,11 +1111,11 @@  discard block
 block discarded – undo
1111 1111
   $boincteam = boincteam_load($boincteam_id);
1112 1112
   $boincuser_id = $account->boincuser_id;
1113 1113
   $output = '';
1114
-  $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), NULL, 'boinc:team-request-foundership') . '</h2>';
1114
+  $output .= '<h2 class="pane-title">'.bts('Request foundership', array(), NULL, 'boinc:team-request-foundership').'</h2>';
1115 1115
 
1116 1116
   if (boincteam_user_requested_foundership($team_id)) {
1117 1117
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
1118
-    $days_to_deadline = ceil(($deadline - time()) / (24*60*60));
1118
+    $days_to_deadline = ceil(($deadline - time())/(24*60*60));
1119 1119
     $request_age = 60 - $days_to_deadline;
1120 1120
     $days_to_respond = 30 + $days_to_deadline;
1121 1121
     if (time() > $deadline) {
@@ -1143,8 +1143,8 @@  discard block
 block discarded – undo
1143 1143
       }
1144 1144
       $output .= '</p>';
1145 1145
       $output .= '<ul class="tab-list">';
1146
-      $output .= '  <li class="first last tab">' .
1147
-        l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1146
+      $output .= '  <li class="first last tab">'.
1147
+        l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership").'</li>';
1148 1148
       $output .= '</ul>';
1149 1149
     }
1150 1150
     else {
@@ -1168,29 +1168,29 @@  discard block
 block discarded – undo
1168 1168
     // who made the request has 30 additional days to assume foundership if
1169 1169
     // there is no response to the request)
1170 1170
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
1171
-    $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30;
1171
+    $days_to_deadline = ceil(($deadline - time())/(24*60*60)) + 30;
1172 1172
     $output .= '<p>';
1173 1173
     $output .= bts('A team foundership change was already requested recently.'
1174 1174
       . ' Only one request is allowed within a period of 90 days.',
1175 1175
       NULL, 'boinc:team-request-foundership');
1176 1176
     if ($days_to_deadline == 1) {
1177
-      $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')';
1177
+      $output .= ' ('.bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership').')';
1178 1178
     }
1179 1179
     else {
1180
-      $output .= ' (' . bts('@count days remaining',
1180
+      $output .= ' ('.bts('@count days remaining',
1181 1181
         array('@count' => $days_to_deadline),
1182
-        NULL, 'boinc:team-request-foundership') . ')';
1182
+        NULL, 'boinc:team-request-foundership').')';
1183 1183
     }
1184 1184
     $output .= '</p>';
1185 1185
   }
1186 1186
   else {
1187
-    $output .= '<p>' . bts('If the team founder is not active and you want to'
1187
+    $output .= '<p>'.bts('If the team founder is not active and you want to'
1188 1188
       . ' assume the role of founder, click below to request foundership of'
1189 1189
       . ' @this_team.',
1190
-      array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership') . '</p>';
1190
+      array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership').'</p>';
1191 1191
     $output .= '<ul class="tab-list">';
1192
-    $output .= '  <li class="first last tab">' .
1193
-      l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>';
1192
+    $output .= '  <li class="first last tab">'.
1193
+      l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership").'</li>';
1194 1194
     $output .= '</ul>';
1195 1195
   }
1196 1196
   return $output;
@@ -1211,15 +1211,15 @@  discard block
 block discarded – undo
1211 1211
   if ($boincteam->ping_user) {
1212 1212
     if ($boincteam->ping_user < 0) {
1213 1213
       $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1214
-      $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1214
+      $output .= '<h2 class="pane-title">'.bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1215 1215
         . '</h2>';
1216
-      $output .= '<p>' . bts('Team member @name requested team foundership on'
1216
+      $output .= '<p>'.bts('Team member @name requested team foundership on'
1217 1217
         . ' @date, but then left the team. This request is now canceled.',
1218 1218
         array(
1219 1219
           '@name' => $member->boincuser_name,
1220 1220
           '@date' => date('j M Y', $boincteam->ping_time),
1221 1221
         ),
1222
-        NULL, 'boinc:team-request-foundership-response') . '</p>';
1222
+        NULL, 'boinc:team-request-foundership-response').'</p>';
1223 1223
       // Automatically cancel the request
1224 1224
       db_set_active('boinc_rw');
1225 1225
       db_query("
@@ -1232,15 +1232,15 @@  discard block
 block discarded – undo
1232 1232
     }
1233 1233
     else {
1234 1234
       $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1235
-      $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1235
+      $output .= '<h2 class="pane-title">'.bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1236 1236
         . '</h2>';
1237
-      $output .= '<p>' . bts('Team member @name has requested team foundership.'
1237
+      $output .= '<p>'.bts('Team member @name has requested team foundership.'
1238 1238
         . ' This may be because you left the team or have not had contact with'
1239 1239
         . ' the team for a long time.', array(
1240 1240
           '@name' => $member->boincuser_name,
1241 1241
         )
1242
-      , array(), NULL, 'boinc:team-request-foundership-response') . '</p>';
1243
-      $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1242
+      , array(), NULL, 'boinc:team-request-foundership-response').'</p>';
1243
+      $output .= '<p>'.bts("If you don't decline the request by @date, @name"
1244 1244
         . ' will have the option of assuming team foundership. (note: To'
1245 1245
         . ' accept the request, assign foundership to @name using the form'
1246 1246
         . ' below)',
@@ -1248,10 +1248,10 @@  discard block
 block discarded – undo
1248 1248
           '@name' => $member->boincuser_name,
1249 1249
           '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1250 1250
         ),
1251
-        NULL, 'boinc:team-request-foundership-response') . '</p>';
1251
+        NULL, 'boinc:team-request-foundership-response').'</p>';
1252 1252
       $output .= '<ul class="tab-list">';
1253
-      $output .= '  <li class="first last tab">' .
1254
-        l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request") . '</li>';
1253
+      $output .= '  <li class="first last tab">'.
1254
+        l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request").'</li>';
1255 1255
       $output .= '</ul>';
1256 1256
     }
1257 1257
   }
@@ -1261,9 +1261,9 @@  discard block
 block discarded – undo
1261 1261
 function boincteam_search_panel() {
1262 1262
   $output = '';
1263 1263
   if (module_exists('global_search_teams_solr')) {
1264
-    $output .= '<h2 class="pane-title">' . bts('Search teams', array(), NULL, 'boinc:search-team') . '</h2>';
1264
+    $output .= '<h2 class="pane-title">'.bts('Search teams', array(), NULL, 'boinc:search-team').'</h2>';
1265 1265
     //$output .= '<p>' . bts('Render a search form here.', array(), NULL, 'boinc:search-team') . '</p>';
1266
-    $output .= '<p>' . boincteam_search_view() . '</p>';
1266
+    $output .= '<p>'.boincteam_search_view().'</p>';
1267 1267
   }
1268 1268
   return $output;
1269 1269
 }
@@ -1279,20 +1279,20 @@  discard block
 block discarded – undo
1279 1279
  * General info about the concept of teams
1280 1280
  */
1281 1281
 function boincteam_topic_overview_panel() {
1282
-  $site_name =  variable_get('site_name', 'Drupal-BOINC');
1282
+  $site_name = variable_get('site_name', 'Drupal-BOINC');
1283 1283
   $output = '';
1284
-  $output .= '<h2 class="pane-title">' . bts('Teams', array(), NULL, 'boinc:team-general-info') . '</h2>';
1284
+  $output .= '<h2 class="pane-title">'.bts('Teams', array(), NULL, 'boinc:team-general-info').'</h2>';
1285 1285
   $output .= '<div class="">';
1286
-  $output .= '<p>' . bts('@project participants may form teams. You may belong'
1286
+  $output .= '<p>'.bts('@project participants may form teams. You may belong'
1287 1287
     . ' to only one team. You can join or quit a team at any time. To join a'
1288 1288
     . ' team, visit its team page and click "Join this team". Each team has a'
1289
-    . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info') . '</p>';
1289
+    . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info').'</p>';
1290 1290
   $output .= '<ul>';
1291
-  $output .= '  <li>' . bts('Private Message all team members', array(), NULL, 'boinc:team-general-info') . '</li>';
1292
-  $output .= '  <li>' . bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info') . '</li>';
1293
-  $output .= '  <li>' . bts('add or remove team admins', array(), NULL, 'boinc:team-general-info') . '</li>';
1294
-  $output .= '  <li>' . bts('remove members from the team', array(), NULL, 'boinc:team-general-info') . '</li>';
1295
-  $output .= '  <li>' . bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info') . '</li>';
1291
+  $output .= '  <li>'.bts('Private Message all team members', array(), NULL, 'boinc:team-general-info').'</li>';
1292
+  $output .= '  <li>'.bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info').'</li>';
1293
+  $output .= '  <li>'.bts('add or remove team admins', array(), NULL, 'boinc:team-general-info').'</li>';
1294
+  $output .= '  <li>'.bts('remove members from the team', array(), NULL, 'boinc:team-general-info').'</li>';
1295
+  $output .= '  <li>'.bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info').'</li>';
1296 1296
   $output .= '</ul>';
1297 1297
   $output .= '</div>';
1298 1298
   return $output;
@@ -1337,34 +1337,34 @@  discard block
 block discarded – undo
1337 1337
     }
1338 1338
   }
1339 1339
   $output = '';
1340
-  $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>';
1340
+  $output .= '<h2 class="pane-title">'.$boincteam->name.'</h2>';
1341 1341
   $output .= '<div>';
1342 1342
   $output .= '<div class="left-column">';
1343 1343
   $output .= '<ul class="stats">';
1344
-  $output .= '  <li>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>';
1345
-  $output .= '  <li>' . bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1346
-  $output .= '  <li>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>';
1347
-  $output .= '  <li>' . bts('Type', array(), NULL, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>';
1344
+  $output .= '  <li>'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').': '.number_format($boincteam->total_credit, 0).'</li>';
1345
+  $output .= '  <li>'.bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC').': '.number_format($boincteam->expavg_credit, 2).'</li>';
1346
+  $output .= '  <li>'.bts('Country', array(), NULL, 'boinc:country-of-origin').': '.$boincteam->country.'</li>';
1347
+  $output .= '  <li>'.bts('Type', array(), NULL, 'boinc:view-team-info').': '.boincteam_get_type($team_id).'</li>';
1348 1348
   $output .= '</ul>';
1349 1349
   $output .= '</div>';
1350 1350
   $output .= '<div class="right-column">';
1351 1351
   $output .= '<ul class="stats">';
1352
-  $output .= '  <li>' . bts('Founder', array(), NULL, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1353
-  $output .= '  <li>' . bts('New members in last day', array(), NULL, 'boinc:view-team-info') . ': ' . implode('&middot;', $new_members) . '</li>';
1354
-  $output .= '  <li>' . bts('Total members', array(), NULL, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1355
-  $output .= '  <li>' . bts('Active members', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>';
1356
-  $output .= '  <li>' . bts('Members with credit', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>';
1352
+  $output .= '  <li>'.bts('Founder', array(), NULL, 'boinc:view-team-info').': '.l($founder->boincuser_name, "account/{$founder->uid}").'</li>';
1353
+  $output .= '  <li>'.bts('New members in last day', array(), NULL, 'boinc:view-team-info').': '.implode('&middot;', $new_members).'</li>';
1354
+  $output .= '  <li>'.bts('Total members', array(), NULL, 'boinc:view-team-info').': '.l($boincteam->nusers, "community/teams/{$team_id}/members").'</li>';
1355
+  $output .= '  <li>'.bts('Active members', array(), NULL, 'boinc:view-team-info').': '.$boincteam->nusers_active.'</li>';
1356
+  $output .= '  <li>'.bts('Members with credit', array(), NULL, 'boinc:view-team-info').': '.$boincteam->nusers_worked.'</li>';
1357 1357
   $output .= '</ul>';
1358 1358
   $output .= '</div>';
1359 1359
   $output .= '</div>';
1360 1360
   $output .= '<div class="clearfix"></div>';
1361 1361
   if ($boincteam->url) {
1362 1362
     $output .= '<div class="stats">';
1363
-    $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}");
1363
+    $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team').': '.l("http://{$boincteam->url}", "http://{$boincteam->url}");
1364 1364
     $output .= '</div>';
1365 1365
   }
1366 1366
   if ($team->body) {
1367
-    $output .= '<h3>' . bts('Description', array(), NULL, 'boinc:team-description') . '</h3>';
1367
+    $output .= '<h3>'.bts('Description', array(), NULL, 'boinc:team-description').'</h3>';
1368 1368
     $output .= check_markup($team->body, $team->format);
1369 1369
     $output .= '</div>';
1370 1370
   }
Please login to merge, or discard this patch.
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -258,8 +258,7 @@  discard block
 block discarded – undo
258 258
         ), WATCHDOG_NOTICE
259 259
       );
260 260
     }
261
-  }
262
-  else {
261
+  } else {
263 262
     drupal_set_message(t('You are not allowed to assume foundership of this
264 263
       team.'
265 264
     ));
@@ -284,8 +283,7 @@  discard block
 block discarded – undo
284 283
     drupal_set_message(t('@team has been removed.',
285 284
       array('@team' => $boincteam->name)));
286 285
     drupal_goto('community/teams');
287
-  }
288
-  else {
286
+  } else {
289 287
     drupal_set_message(t('All members must be removed from @team before the
290 288
       team can be deleted.', array('@team' => $boincteam->name)), 'error');
291 289
     drupal_goto(strstr($_GET['q'], '/delete', TRUE));
@@ -519,8 +517,7 @@  discard block
 block discarded – undo
519 517
         array('@team' => $boincteam->name)));
520 518
       watchdog('boincteam', 'added user @uid to team @nid',
521 519
         array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
522
-    }
523
-    else {
520
+    } else {
524 521
       // @todo - consider another rule/error event here
525 522
       drupal_set_message(t('There was a problem joining @team, please try again
526 523
         later', array('@team' => $boincteam->name)));
@@ -548,8 +545,7 @@  discard block
 block discarded – undo
548 545
       array('@team' => $boincteam->name)));
549 546
     watchdog('boincteam', 'removed user @uid from team @nid',
550 547
       array('@uid' => $user->uid, '@nid' => $team_id), WATCHDOG_NOTICE);
551
-  }
552
-  else {
548
+  } else {
553 549
       drupal_set_message(t('You are not a member of @team, so you cannot revoke
554 550
         your membership to it.', array('@team' => $boincteam->name)));
555 551
   }
@@ -618,8 +614,7 @@  discard block
 block discarded – undo
618 614
         '@uid' => $account->uid,
619 615
         '@nid' => $team_id
620 616
       ), WATCHDOG_NOTICE);
621
-  }
622
-  else {
617
+  } else {
623 618
       drupal_set_message(t('@user is not a member of @team, so you cannot
624 619
         revoke the membership.', array(
625 620
           '@user' => $account->boincuser_name,
@@ -648,14 +643,12 @@  discard block
 block discarded – undo
648 643
         '@user' => $account->boincuser_name
649 644
       )
650 645
     ), 'warning');
651
-  }
652
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
646
+  } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
653 647
     // It hasn't been long enough since the last transfer request
654 648
     drupal_set_message(t('A foundership change was requested during the last 90
655 649
       days, so new requests are not allowed. Please try again later.'
656 650
     ), 'warning');
657
-  }
658
-  elseif (boincteam_is_member($team_id, $account->uid)) {
651
+  } elseif (boincteam_is_member($team_id, $account->uid)) {
659 652
     // Log the transfer request
660 653
     db_set_active('boinc_rw');
661 654
     db_query("
@@ -861,8 +854,7 @@  discard block
 block discarded – undo
861 854
     $output .= '[';
862 855
     if ($credit_needed == 1) {
863 856
       $output .= bts('You must earn 1 more credit!', array(), NULL, 'boinc:create-team-panel');
864
-    }
865
-    else {
857
+    } else {
866 858
       $output .= bts('You must earn @count more credits!',
867 859
         array('@count' => $credit_needed),
868 860
 	NULL, 'boinc:create-team-panel'
@@ -915,8 +907,7 @@  discard block
 block discarded – undo
915 907
     $output .= '  <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>';
916 908
     $output .= '  <span>' . number_format($team->total_credit, 0) . '</span>';
917 909
     $output .= '</div>' . "\n";
918
-  }
919
-  else if ($user->uid == $account->uid) {
910
+  } else if ($user->uid == $account->uid) {
920 911
     $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>';
921 912
     $output .= '<ul class="tab-list action-list">';
922 913
     $output .= '<li class="tab primary">';
@@ -1123,8 +1114,7 @@  discard block
 block discarded – undo
1123 1114
       if ($request_age == 1) {
1124 1115
         $output .= bts('1 day has elapsed since your request and'
1125 1116
           . ' the founder has not responded.', array(), NULL, 'boinc:team-request-foundership');
1126
-      }
1127
-      else {
1117
+      } else {
1128 1118
         $output .= bts('@count days have elapsed since your request and'
1129 1119
           . ' the founder has not responded.',
1130 1120
           array('@count' => $request_age),
@@ -1134,8 +1124,7 @@  discard block
 block discarded – undo
1134 1124
       if ($days_to_respond == 1) {
1135 1125
         $output .= bts('You now have 1 day to assume foundership before'
1136 1126
           . ' another team member may submit a request.', array(), NULL, 'boinc:team-request-foundership');
1137
-      }
1138
-      else {
1127
+      } else {
1139 1128
         $output .= bts('You now have @count days to assume foundership before'
1140 1129
           . ' another team member may submit a request.',
1141 1130
           array('@count' => $days_to_respond),
@@ -1146,23 +1135,20 @@  discard block
 block discarded – undo
1146 1135
       $output .= '  <li class="first last tab">' .
1147 1136
         l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1148 1137
       $output .= '</ul>';
1149
-    }
1150
-    else {
1138
+    } else {
1151 1139
       $output .= '<p>';
1152 1140
       if ($days_to_deadline == 1) {
1153 1141
         $output .= bts('The team founder has 1 day to respond to your'
1154 1142
           . ' transfer request.',
1155 1143
           NULL, 'boinc:team-request-foundership');
1156
-      }
1157
-      else {
1144
+      } else {
1158 1145
         $output .= bts('The team founder has @count days to respond to your'
1159 1146
           . ' transfer request.', array('@count' => $days_to_deadline),
1160 1147
           NULL, 'boinc:team-request-foundership');
1161 1148
       }
1162 1149
       $output .= '</p>';
1163 1150
     }
1164
-  }
1165
-  elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1151
+  } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) {
1166 1152
     // If this user does not have a transfer request pending, but new requests
1167 1153
     // are not allowed, set the deadline to 90 days instead of 60 (as the user
1168 1154
     // who made the request has 30 additional days to assume foundership if
@@ -1175,15 +1161,13 @@  discard block
 block discarded – undo
1175 1161
       NULL, 'boinc:team-request-foundership');
1176 1162
     if ($days_to_deadline == 1) {
1177 1163
       $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')';
1178
-    }
1179
-    else {
1164
+    } else {
1180 1165
       $output .= ' (' . bts('@count days remaining',
1181 1166
         array('@count' => $days_to_deadline),
1182 1167
         NULL, 'boinc:team-request-foundership') . ')';
1183 1168
     }
1184 1169
     $output .= '</p>';
1185
-  }
1186
-  else {
1170
+  } else {
1187 1171
     $output .= '<p>' . bts('If the team founder is not active and you want to'
1188 1172
       . ' assume the role of founder, click below to request foundership of'
1189 1173
       . ' @this_team.',
@@ -1229,8 +1213,7 @@  discard block
 block discarded – undo
1229 1213
         $boincteam_id
1230 1214
       );
1231 1215
       db_set_active('default');
1232
-    }
1233
-    else {
1216
+    } else {
1234 1217
       $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1235 1218
       $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1236 1219
         . '</h2>';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
     'type' => MENU_CALLBACK,
103 103
   );
104 104
   $items['community/teams/%/message-all-members'] = array(
105
-    'title' => bts('Send Message to Team', array(), NULL, 'boinc:team-manage'),
106
-    'description' => bts('Send Message to Team', array(), NULL, 'boinc:team-manage'),
105
+    'title' => bts('Send Message to Team', array(), null, 'boinc:team-manage'),
106
+    'description' => bts('Send Message to Team', array(), null, 'boinc:team-manage'),
107 107
     'page callback' => 'drupal_get_form',
108 108
     'page arguments' => array('boincteam_sendmessagetoteam', 2),
109 109
     'access callback' => 'boincteam_is_admin',
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 */
140 140
   return array(
141 141
     'boincteam_utility_team_table' => array(
142
-      'arguments' => array('form' => NULL),
142
+      'arguments' => array('form' => null),
143 143
       'file' => 'boincteam.admin.inc',
144 144
     ),
145 145
   );
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
  */
273 273
 function boincteam_delete($team_id) {
274 274
   $team = node_load($team_id);
275
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
275
+  $boincteam = boincteam_load(boincteam_lookup_id($team_id), true);
276 276
   if ($boincteam->nusers == 1) {
277 277
     require_boinc('team');
278 278
     $boincuser = boincuser_load();
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
   else {
289 289
     drupal_set_message(t('All members must be removed from @team before the
290 290
       team can be deleted.', array('@team' => $boincteam->name)), 'error');
291
-    drupal_goto(strstr($_GET['q'], '/delete', TRUE));
291
+    drupal_goto(strstr($_GET['q'], '/delete', true));
292 292
   }
293 293
 }
294 294
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 /**
318 318
  * Get the join date of a user
319 319
  */
320
-function boincteam_get_member_join_date($boincteam_id, $boincuser_id = NULL) {
320
+function boincteam_get_member_join_date($boincteam_id, $boincuser_id = null) {
321 321
   if (!$boincuser_id) {
322 322
     global $user;
323 323
     $account = user_load($user->uid);
@@ -415,10 +415,10 @@  discard block
 block discarded – undo
415 415
 /**
416 416
  * Get a BOINC team object
417 417
  */
418
-function boincteam_load($boincteam_id, $full_object = FALSE) {
418
+function boincteam_load($boincteam_id, $full_object = false) {
419 419
   require_boinc(array('team'));
420 420
   $team = BoincTeam::lookup_id($boincteam_id);
421
-  if ($team AND $full_object) {
421
+  if ($team and $full_object) {
422 422
     $team->nusers = BoincUser::count("teamid={$team->id}");
423 423
     $team->nusers_worked = BoincUser::count("teamid={$team->id} and total_credit>0");
424 424
     $team->nusers_active = BoincUser::count("teamid={$team->id} and expavg_credit>0.1");
@@ -433,39 +433,39 @@  discard block
 block discarded – undo
433 433
 /**
434 434
  * Check if a user is the team founder
435 435
  */
436
-function boincteam_is_founder($nid, $uid = NULL) {
436
+function boincteam_is_founder($nid, $uid = null) {
437 437
   if (!$uid) {
438 438
     global $user;
439 439
     $uid = $user->uid;
440 440
   }
441 441
   if (!boincteam_is_member($nid, $uid)) {
442
-    return FALSE;
442
+    return false;
443 443
   }
444 444
   $team_id = boincteam_lookup_id($nid);
445 445
   require_boinc('team');
446
-  return is_team_founder(boincuser_load($uid, TRUE), boincteam_load($team_id));
446
+  return is_team_founder(boincuser_load($uid, true), boincteam_load($team_id));
447 447
 }
448 448
 
449 449
 /**
450 450
  * Check if a user is a team admin
451 451
  */
452
-function boincteam_is_admin($nid, $uid = NULL) {
452
+function boincteam_is_admin($nid, $uid = null) {
453 453
   if (!$uid) {
454 454
     global $user;
455 455
     $uid = $user->uid;
456 456
   }
457 457
   if (!boincteam_is_member($nid, $uid)) {
458
-    return FALSE;
458
+    return false;
459 459
   }
460 460
   $team_id = boincteam_lookup_id($nid);
461 461
   require_boinc('team');
462
-  return is_team_admin(boincuser_load($uid, TRUE), boincteam_load($team_id));
462
+  return is_team_admin(boincuser_load($uid, true), boincteam_load($team_id));
463 463
 }
464 464
 
465 465
 /**
466 466
  * Check if a user is a team member
467 467
  */
468
-function boincteam_is_member($nid, $uid = NULL) {
468
+function boincteam_is_member($nid, $uid = null) {
469 469
   if (!$uid) {
470 470
     global $user;
471 471
     $uid = $user->uid;
@@ -492,9 +492,9 @@  discard block
 block discarded – undo
492 492
           drupal_set_message(
493 493
             bts(
494 494
               'A foundership transfer request has been made for your team. Please !respond.',
495
-              array('!respond' => l(bts('respond to the request', array(), NULL, 'boinc:team-founder-change'), $foundership_url)),
496
-              NULL, 'boinc:team-founder-change'),
497
-            'warning', FALSE
495
+              array('!respond' => l(bts('respond to the request', array(), null, 'boinc:team-founder-change'), $foundership_url)),
496
+              null, 'boinc:team-founder-change'),
497
+            'warning', false
498 498
           );
499 499
         }
500 500
       }
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 
512 512
   $boincteam_id = boincteam_lookup_id($team_id);
513 513
   $boincteam = boincteam_load($boincteam_id);
514
-  if ($boincteam->joinable AND $account->team != $team_id) {
514
+  if ($boincteam->joinable and $account->team != $team_id) {
515 515
     require_boinc('team');
516 516
     $boincuser = boincuser_load();
517 517
     if (user_join_team($boincteam, $boincuser)) {
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
   $boincteam = boincteam_load($boincteam_id);
605 605
   if ($account->team == $team_id) {
606 606
     require_boinc('team');
607
-    $boincuser = boincuser_load($user_id, TRUE);
607
+    $boincuser = boincuser_load($user_id, true);
608 608
     user_quit_team($boincuser);
609 609
     drupal_set_message(t('@user has been removed from @team.',
610 610
       array(
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
   $now = time();
727 727
   if ($boincteam->ping_user <= 0) {
728 728
     if ($boincteam->ping_time < $now - 60 * (24*60*60)) {
729
-      return TRUE;
729
+      return true;
730 730
     }
731
-    return FALSE;
731
+    return false;
732 732
   }
733 733
   if ($boincteam->ping_time < $now - 90 * (24*60*60)) {
734
-    return TRUE;
734
+    return true;
735 735
   }
736
-  return FALSE;
736
+  return false;
737 737
 }
738 738
 
739 739
 /**
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 /**
755 755
  * Check if a user has an active foundership request with a team
756 756
  */
757
-function boincteam_user_requested_foundership($team_id, $user_id = NULL) {
757
+function boincteam_user_requested_foundership($team_id, $user_id = null) {
758 758
   if (!$user_id) {
759 759
     global $user;
760 760
     $user_id = $user->uid;
@@ -779,27 +779,27 @@  discard block
 block discarded – undo
779 779
  */
780 780
 function boincteam_about_admins_panel() {
781 781
   $output = '';
782
-  $output .= '<h2 class="pane-title">' . bts('About team admins', array(), NULL, 'boinc:team-admins-panel') . '</h2>';
782
+  $output .= '<h2 class="pane-title">' . bts('About team admins', array(), null, 'boinc:team-admins-panel') . '</h2>';
783 783
   $output .= '<div>';
784
-  $output .= '<p>' . bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
784
+  $output .= '<p>' . bts('Team admins can:', array(), null, 'boinc:team-admins-panel') . '</p>';
785 785
   $output .= '<ul>';
786
-  $output .= '  <li>' . bts('Edit team information', array(), NULL, 'boinc:team-admins-panel') . '</li>';
787
-  $output .= '  <li>' . bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel') . '</li>';
788
-  $output .= '  <li>' . bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel') . '</li>';
789
-  $output .= '  <li>' . bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel') . '</li>';
790
-  $output .= '  <li>' . bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
786
+  $output .= '  <li>' . bts('Edit team information', array(), null, 'boinc:team-admins-panel') . '</li>';
787
+  $output .= '  <li>' . bts("View the team's join / quit history", array(), null, 'boinc:team-admins-panel') . '</li>';
788
+  $output .= '  <li>' . bts('Moderate the team forum', array(), null, 'boinc:team-admins-panel') . '</li>';
789
+  $output .= '  <li>' . bts('Remove members from the team', array(), null, 'boinc:team-admins-panel') . '</li>';
790
+  $output .= '  <li>' . bts('Disband a team if it has no members', array(), null, 'boinc:team-admins-panel') . '</li>';
791 791
   $output .= '</ul>';
792 792
   $output .= '</div>';
793 793
   $output .= '<div>';
794
-  $output .= '<p>' . bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel') . '</p>';
794
+  $output .= '<p>' . bts('Team admins cannot:', array(), null, 'boinc:team-admins-panel') . '</p>';
795 795
   $output .= '<ul>';
796
-  $output .= '  <li>' . bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel') . '</li>';
797
-  $output .= '  <li>' . bts('Remove members', array(), NULL, 'boinc:team-admins-panel') . '</li>';
798
-  $output .= '  <li>' . bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel') . '</li>';
796
+  $output .= '  <li>' . bts('Change the team founder', array(), null, 'boinc:team-admins-panel') . '</li>';
797
+  $output .= '  <li>' . bts('Remove members', array(), null, 'boinc:team-admins-panel') . '</li>';
798
+  $output .= '  <li>' . bts('Add / Remove team admins', array(), null, 'boinc:team-admins-panel') . '</li>';
799 799
   $output .= '</ul>';
800 800
   $output .= '</div>';
801 801
   $output .= '<p>' . bts('If a team admin quits the team, they cease to be a'
802
-    . ' team admin. We recommend only selecting people you know and trust', array(), NULL, 'boinc:team-admins-panel')
802
+    . ' team admin. We recommend only selecting people you know and trust', array(), null, 'boinc:team-admins-panel')
803 803
     . '</p>';
804 804
   return $output;
805 805
 }
@@ -809,26 +809,26 @@  discard block
 block discarded – undo
809 809
  */
810 810
 function boincteam_about_founder_panel() {
811 811
   $output = '';
812
-  $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel')
812
+  $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), null, 'boinc:team-founder-panel')
813 813
     . '</h2>';
814 814
   $output .= '<div>';
815
-  $output .= '<p>' . bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel') . '</p>';
815
+  $output .= '<p>' . bts('Notes about changes in foundership:', array(), null, 'boinc:team-founder-panel') . '</p>';
816 816
   $output .= '<ul>';
817
-  $output .= '  <li>' . bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel') . '</li>';
818
-  $output .= '  <li>' . bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel') . '</li>';
817
+  $output .= '  <li>' . bts('Any member of the team is eligible', array(), null, 'boinc:team-founder-panel') . '</li>';
818
+  $output .= '  <li>' . bts('Current founder becomes a normal user', array(), null, 'boinc:team-founder-panel') . '</li>';
819 819
   $output .= '</ul>';
820 820
   $output .= '</div>';
821 821
   $output .= '<div>';
822
-  $output .= '<p>' . bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel')
822
+  $output .= '<p>' . bts('Foundership can be requested by team members:', array(), null, 'boinc:team-founder-panel')
823 823
     . '</p>';
824 824
   $output .= '<ul>';
825
-  $output .= '  <li>' . bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel') . '</li>';
826
-  $output .= '  <li>' . bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel')
825
+  $output .= '  <li>' . bts('One request is allowed at a time', array(), null, 'boinc:team-founder-panel') . '</li>';
826
+  $output .= '  <li>' . bts('It must be 60 days since any previous request', array(), null, 'boinc:team-founder-panel')
827 827
     . '</li>';
828
-  $output .= '  <li>' . bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel')
828
+  $output .= '  <li>' . bts('Any active request must be older than 90 days', array(), null, 'boinc:team-founder-panel')
829 829
     . '</li>';
830 830
   $output .= '  <li>' . bts('Current founder has 60 days to respond to a'
831
-    . ' request', array(), NULL, 'boinc:team-founder-panel') . '</li>';
831
+    . ' request', array(), null, 'boinc:team-founder-panel') . '</li>';
832 832
   $output .= '</ul>';
833 833
   $output .= '</div>';
834 834
   return $output;
@@ -842,16 +842,16 @@  discard block
 block discarded – undo
842 842
   $account = user_load($user->uid);
843 843
   $unrestricted_role = array_search('verified contributor', user_roles(true));
844 844
   $output = '';
845
-  $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
845
+  $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), null, 'boinc:create-team-panel') . '</h2>';
846 846
   $output .= '<p>' . bts('If you cannot find a team that is right for you, you'
847
-    . ' can create a team.', array(), NULL, 'boinc:create-team-panel') . '</p>';
847
+    . ' can create a team.', array(), null, 'boinc:create-team-panel') . '</p>';
848 848
   $output .= '<ul class="tab-list">';
849 849
   $output .= '  <li class="first last tab">';
850 850
   if (isset($account->roles[$unrestricted_role])) {
851
-    $output .= l(bts('Create new team', array(), NULL, 'boinc:create-team-panel'), 'community/teams/add');
851
+    $output .= l(bts('Create new team', array(), null, 'boinc:create-team-panel'), 'community/teams/add');
852 852
   } elseif ($account->uid <= 0) {
853 853
     $output .= l(
854
-      bts('Login to create a new team', array(), NULL, 'boinc:create-team-panel'),
854
+      bts('Login to create a new team', array(), null, 'boinc:create-team-panel'),
855 855
       'user/login',
856 856
       array('query' => drupal_get_destination())
857 857
     );
@@ -860,12 +860,12 @@  discard block
 block discarded – undo
860 860
     $credit_needed = $min_credit_needed - $account->boincuser_total_credit;
861 861
     $output .= '[';
862 862
     if ($credit_needed == 1) {
863
-      $output .= bts('You must earn 1 more credit!', array(), NULL, 'boinc:create-team-panel');
863
+      $output .= bts('You must earn 1 more credit!', array(), null, 'boinc:create-team-panel');
864 864
     }
865 865
     else {
866 866
       $output .= bts('You must earn @count more credits!',
867 867
         array('@count' => $credit_needed),
868
-	NULL, 'boinc:create-team-panel'
868
+	null, 'boinc:create-team-panel'
869 869
       );
870 870
     }
871 871
     $output .= ']';
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
  */
881 881
 function boincteam_create_team_panel() {
882 882
   $output = '';
883
-  $output .= '<h2 class="pane-title">' . bts('Create a team', array(), NULL, 'boinc:create-team-panel') . '</h2>';
883
+  $output .= '<h2 class="pane-title">' . bts('Create a team', array(), null, 'boinc:create-team-panel') . '</h2>';
884 884
   $output .= drupal_get_form('boincteam_create_form');
885 885
 
886 886
   return $output;
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 /**
890 890
  * Link to user's team
891 891
  */
892
-function boincteam_dashboard_panel($uid = NULL) {
892
+function boincteam_dashboard_panel($uid = null) {
893 893
   global $user;
894 894
   if (!$uid) {
895 895
     $uid = $user->uid;
@@ -898,29 +898,29 @@  discard block
 block discarded – undo
898 898
   $account = user_load($uid);
899 899
   if ($account->team) {
900 900
     $team = boincteam_load(boincteam_lookup_id($account->team));
901
-    $output .= '<h2 class="pane-title">' . bts('Team', array(), NULL, 'boinc:team-dashboard') . '</h2>';
901
+    $output .= '<h2 class="pane-title">' . bts('Team', array(), null, 'boinc:team-dashboard') . '</h2>';
902 902
     $output .= '<div class="stats">';
903
-    $output .= '  <label>' . bts('Name', array(), NULL, 'boinc:user-or-team-name') . ': </label>';
903
+    $output .= '  <label>' . bts('Name', array(), null, 'boinc:user-or-team-name') . ': </label>';
904 904
     $output .= '  <span>' . l($team->name, "community/teams/{$account->team}") . '</span>';
905 905
     $output .= '</div>' . "\n";
906 906
     $output .= '<div class="stats">';
907
-    $output .= '  <label>' . bts('Member since', array(), NULL, 'boinc:user-info') . ': </label>';
907
+    $output .= '  <label>' . bts('Member since', array(), null, 'boinc:user-info') . ': </label>';
908 908
     $output .= '  <span>' . date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)) . '</span>';
909 909
     $output .= '</div>' . "\n";
910 910
     $output .= '<div class="stats">';
911
-    $output .= '  <label>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': </label>';
911
+    $output .= '  <label>' . bts('Country', array(), null, 'boinc:country-of-origin') . ': </label>';
912 912
     $output .= '  <span>' . $team->country . '</span>';
913 913
     $output .= '</div>' . "\n";
914 914
     $output .= '<div class="stats">';
915
-    $output .= '  <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>';
915
+    $output .= '  <label>' . bts('Total credit', array(), null, 'boinc:user-or-team-total-credits') . ': </label>';
916 916
     $output .= '  <span>' . number_format($team->total_credit, 0) . '</span>';
917 917
     $output .= '</div>' . "\n";
918 918
   }
919 919
   else if ($user->uid == $account->uid) {
920
-    $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>';
920
+    $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), null, 'boinc:team-dashboard') . '</h2>';
921 921
     $output .= '<ul class="tab-list action-list">';
922 922
     $output .= '<li class="tab primary">';
923
-    $output .= l(bts('Join a Team', array(), NULL, 'boinc:team-dashboard'), 'community/teams');
923
+    $output .= l(bts('Join a Team', array(), null, 'boinc:team-dashboard'), 'community/teams');
924 924
     $output .= '</li>';
925 925
     $output .= '</ul>';
926 926
   }
@@ -945,12 +945,12 @@  discard block
 block discarded – undo
945 945
 function boincteam_join_team_panel($team_id) {
946 946
   $team = node_load($team_id);
947 947
   $output = '';
948
-  $output .= '<h2 class="pane-title">' . bts('Join team', array(), NULL, 'boinc:join-team-panel') . '</h2>';
948
+  $output .= '<h2 class="pane-title">' . bts('Join team', array(), null, 'boinc:join-team-panel') . '</h2>';
949 949
   $output .= '<p>' . bts('Click here to become a member of @this_team',
950
-    array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel') . '</p>';
950
+    array('@this_team' =>$team->title), null, 'boinc:join-team-panel') . '</p>';
951 951
   $output .= '<ul class="tab-list">';
952 952
   $output .= '  <li class="first last tab">' .
953
-    l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join") . '</li>';
953
+    l(bts('Join this team', array(), null, 'boinc:join-team-panel'), "community/teams/{$team_id}/join") . '</li>';
954 954
   $output .= '</ul>';
955 955
   return $output;
956 956
 }
@@ -961,12 +961,12 @@  discard block
 block discarded – undo
961 961
 function boincteam_leave_team_panel($team_id) {
962 962
   $team = node_load($team_id);
963 963
   $output = '';
964
-  $output .= '<h2 class="pane-title">' . bts('Leave team', array(), NULL, 'boinc:leave-team-panel') . '</h2>';
964
+  $output .= '<h2 class="pane-title">' . bts('Leave team', array(), null, 'boinc:leave-team-panel') . '</h2>';
965 965
   $output .= '<p>' . bts('Click here to revoke your membership with'
966
-    . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel') . '</p>';
966
+    . ' @this_team', array('@this_team' =>$team->title), null, 'boinc:leave-team-panel') . '</p>';
967 967
   $output .= '<ul class="tab-list">';
968 968
   $output .= '  <li class="first last tab">' .
969
-    l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave") . '</li>';
969
+    l(bts('Leave this team', array(), null, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave") . '</li>';
970 970
   $output .= '</ul>';
971 971
   return $output;
972 972
 }
@@ -976,10 +976,10 @@  discard block
 block discarded – undo
976 976
  */
977 977
 function boincteam_manage_admins_panel_header($team_id) {
978 978
   $output = '';
979
-  $output .= '<h4>' . bts('Add team admin', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
979
+  $output .= '<h4>' . bts('Add team admin', array(), null, 'boinc:team-manage-admins') . '</h4>';
980 980
   $output .= drupal_get_form('boincteam_add_admin_form', $team_id);
981 981
   $output .= '<div class="clearfix"></div>';
982
-  $output .= '<h4>' . bts('Current team admins', array(), NULL, 'boinc:team-manage-admins') . '</h4>';
982
+  $output .= '<h4>' . bts('Current team admins', array(), null, 'boinc:team-manage-admins') . '</h4>';
983 983
 
984 984
   return $output;
985 985
 }
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
   $team = node_load($team_id);
993 993
 
994 994
   $output = '';
995
-  $output .= '<h2 class="pane-title">' . bts('Manage team', array(), NULL, 'boinc:team-manage') . '</h2>';
995
+  $output .= '<h2 class="pane-title">' . bts('Manage team', array(), null, 'boinc:team-manage') . '</h2>';
996 996
 
997 997
   // PM all members
998 998
   if (module_exists('privatemsg')) {
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
       l('Send message to team', "community/teams/{$team_id}/message-all-members") . '</li>';
1003 1003
     $output .= '  </ul>';
1004 1004
     $output .= '  <div class="description">';
1005
-    $output .=   bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage');
1005
+    $output .=   bts('Contact all team members using e-mail.', array(), null, 'boinc:team-manage');
1006 1006
     $output .= '  </div>';
1007 1007
     $output .= '</div>';
1008 1008
   }
@@ -1021,12 +1021,12 @@  discard block
 block discarded – undo
1021 1021
       $output .= '<div class="form-item">';
1022 1022
       $output .= '  <ul class="tab-list action-list">';
1023 1023
       $output .= '    <li class="first tab primary">' .
1024
-        l(bts('Manage team message board', array(), NULL, 'boinc:team-manage'),
1024
+        l(bts('Manage team message board', array(), null, 'boinc:team-manage'),
1025 1025
           "community/teams/{$team_id}/forum/{$team_forum_link_path}"
1026 1026
         );
1027 1027
       $output .= '    </li>';
1028 1028
       $output .= '  <div class="description">';
1029
-      $output .=   bts('Create or manage message board', array(), NULL, 'boinc:team-manage');
1029
+      $output .=   bts('Create or manage message board', array(), null, 'boinc:team-manage');
1030 1030
       $output .= '  </div>';
1031 1031
       $output .= '</div>';
1032 1032
     }
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 
1035 1035
   // Team history
1036 1036
   $output .= '<div class="form-item">';
1037
-  $output .= '  <label>' . bts('View change history', array(), NULL, 'boinc:team-manage') . '</label>';
1037
+  $output .= '  <label>' . bts('View change history', array(), null, 'boinc:team-manage') . '</label>';
1038 1038
   $output .= '  <ul class="tab-list">';
1039 1039
   $output .= '    <li class="first tab primary">' .
1040 1040
     l('HTML', "community/teams/{$team_id}/history") . '</li>';
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
     l('XML', "community/teams/{$team_id}/history/xml") . '</li>';
1043 1043
   $output .= '  </ul>';
1044 1044
   $output .= '  <div class="description">';
1045
-  $output .=   bts('See member activity', array(), NULL, 'boinc:team-manage');
1045
+  $output .=   bts('See member activity', array(), null, 'boinc:team-manage');
1046 1046
   $output .= '  </div>';
1047 1047
   $output .= '</div>';
1048 1048
 
@@ -1051,29 +1051,29 @@  discard block
 block discarded – undo
1051 1051
 
1052 1052
   // Edit team information
1053 1053
   $output .= '    <li class="first tab primary">' .
1054
-    l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info") . '</li>';
1054
+    l(bts('Edit team info', array(), null, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info") . '</li>';
1055 1055
 
1056 1056
   // Member list
1057 1057
   $output .= '    <li class="tab primary">' .
1058
-    l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members") . '</li>';
1058
+    l(bts('View member list', array(), null, 'boinc:team-manage'), "community/teams/{$team_id}/members") . '</li>';
1059 1059
 
1060 1060
   // Remove members
1061 1061
   $output .= '    <li class="tab primary">' .
1062
-    l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members") . '</li>';
1062
+    l(bts('Remove members', array(), null, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members") . '</li>';
1063 1063
 
1064 1064
   if ($is_founder) {
1065 1065
 
1066 1066
     // Change founder
1067 1067
     $output .= '    <li class="tab primary">' .
1068
-      l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>';
1068
+      l(bts('Change founder', array(), null, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>';
1069 1069
 
1070 1070
       // Manage admins
1071 1071
     $output .= '    <li class="tab primary">' .
1072
-      l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>';
1072
+      l(bts('Manage team admins', array(), null, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>';
1073 1073
 
1074 1074
     // Delete the team
1075 1075
     $output .= '    <li class="last tab primary">' .
1076
-      l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>';
1076
+      l(bts('Remove team', array(), null, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>';
1077 1077
   }
1078 1078
 
1079 1079
   $output .= '  </ul>';
@@ -1090,12 +1090,12 @@  discard block
 block discarded – undo
1090 1090
   $account = user_load($user->uid);
1091 1091
   $team = node_load($account->team);
1092 1092
   $output = '';
1093
-  $output .= '<h2 class="pane-title">' . bts('My team', array(), NULL, 'boinc:account-team-panel') . '</h2>';
1093
+  $output .= '<h2 class="pane-title">' . bts('My team', array(), null, 'boinc:account-team-panel') . '</h2>';
1094 1094
   $output .= '<p>' . bts('You are a member of @team.',
1095
-    array('@team' => $team->title), NULL, 'boinc:account-team-panel') . '</p>';
1095
+    array('@team' => $team->title), null, 'boinc:account-team-panel') . '</p>';
1096 1096
   $output .= '<ul class="tab-list">';
1097 1097
   $output .= '  <li class="first last tab">' .
1098
-    l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}") . '</li>';
1098
+    l(bts('View my team', array(), null, 'boinc:account-team-panel'), "community/teams/{$account->team}") . '</li>';
1099 1099
   $output .= '</ul>';
1100 1100
   return $output;
1101 1101
 }
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
   $boincteam = boincteam_load($boincteam_id);
1112 1112
   $boincuser_id = $account->boincuser_id;
1113 1113
   $output = '';
1114
-  $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), NULL, 'boinc:team-request-foundership') . '</h2>';
1114
+  $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), null, 'boinc:team-request-foundership') . '</h2>';
1115 1115
 
1116 1116
   if (boincteam_user_requested_foundership($team_id)) {
1117 1117
     $deadline = boincteam_foundership_transfer_ok_time($boincteam);
@@ -1122,29 +1122,29 @@  discard block
 block discarded – undo
1122 1122
       $output .= '<p>';
1123 1123
       if ($request_age == 1) {
1124 1124
         $output .= bts('1 day has elapsed since your request and'
1125
-          . ' the founder has not responded.', array(), NULL, 'boinc:team-request-foundership');
1125
+          . ' the founder has not responded.', array(), null, 'boinc:team-request-foundership');
1126 1126
       }
1127 1127
       else {
1128 1128
         $output .= bts('@count days have elapsed since your request and'
1129 1129
           . ' the founder has not responded.',
1130 1130
           array('@count' => $request_age),
1131
-          NULL, 'boinc:team-request-foundership');
1131
+          null, 'boinc:team-request-foundership');
1132 1132
       }
1133 1133
       $output .= ' ';
1134 1134
       if ($days_to_respond == 1) {
1135 1135
         $output .= bts('You now have 1 day to assume foundership before'
1136
-          . ' another team member may submit a request.', array(), NULL, 'boinc:team-request-foundership');
1136
+          . ' another team member may submit a request.', array(), null, 'boinc:team-request-foundership');
1137 1137
       }
1138 1138
       else {
1139 1139
         $output .= bts('You now have @count days to assume foundership before'
1140 1140
           . ' another team member may submit a request.',
1141 1141
           array('@count' => $days_to_respond),
1142
-          NULL, 'boinc:team-request-foundership');
1142
+          null, 'boinc:team-request-foundership');
1143 1143
       }
1144 1144
       $output .= '</p>';
1145 1145
       $output .= '<ul class="tab-list">';
1146 1146
       $output .= '  <li class="first last tab">' .
1147
-        l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1147
+        l(bts('Assume foundership', array(), null, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>';
1148 1148
       $output .= '</ul>';
1149 1149
     }
1150 1150
     else {
@@ -1152,12 +1152,12 @@  discard block
 block discarded – undo
1152 1152
       if ($days_to_deadline == 1) {
1153 1153
         $output .= bts('The team founder has 1 day to respond to your'
1154 1154
           . ' transfer request.',
1155
-          NULL, 'boinc:team-request-foundership');
1155
+          null, 'boinc:team-request-foundership');
1156 1156
       }
1157 1157
       else {
1158 1158
         $output .= bts('The team founder has @count days to respond to your'
1159 1159
           . ' transfer request.', array('@count' => $days_to_deadline),
1160
-          NULL, 'boinc:team-request-foundership');
1160
+          null, 'boinc:team-request-foundership');
1161 1161
       }
1162 1162
       $output .= '</p>';
1163 1163
     }
@@ -1172,14 +1172,14 @@  discard block
 block discarded – undo
1172 1172
     $output .= '<p>';
1173 1173
     $output .= bts('A team foundership change was already requested recently.'
1174 1174
       . ' Only one request is allowed within a period of 90 days.',
1175
-      NULL, 'boinc:team-request-foundership');
1175
+      null, 'boinc:team-request-foundership');
1176 1176
     if ($days_to_deadline == 1) {
1177
-      $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')';
1177
+      $output .= ' (' . bts('1 day remaining', array(), null, 'boinc:team-request-foundership') . ')';
1178 1178
     }
1179 1179
     else {
1180 1180
       $output .= ' (' . bts('@count days remaining',
1181 1181
         array('@count' => $days_to_deadline),
1182
-        NULL, 'boinc:team-request-foundership') . ')';
1182
+        null, 'boinc:team-request-foundership') . ')';
1183 1183
     }
1184 1184
     $output .= '</p>';
1185 1185
   }
@@ -1187,10 +1187,10 @@  discard block
 block discarded – undo
1187 1187
     $output .= '<p>' . bts('If the team founder is not active and you want to'
1188 1188
       . ' assume the role of founder, click below to request foundership of'
1189 1189
       . ' @this_team.',
1190
-      array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership') . '</p>';
1190
+      array('@this_team' =>$team->title), null, 'boinc:team-request-foundership') . '</p>';
1191 1191
     $output .= '<ul class="tab-list">';
1192 1192
     $output .= '  <li class="first last tab">' .
1193
-      l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>';
1193
+      l(bts('Initiate request', array(), null, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>';
1194 1194
     $output .= '</ul>';
1195 1195
   }
1196 1196
   return $output;
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
   if ($boincteam->ping_user) {
1212 1212
     if ($boincteam->ping_user < 0) {
1213 1213
       $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user));
1214
-      $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1214
+      $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), null, 'boinc:team-request-foundership-response')
1215 1215
         . '</h2>';
1216 1216
       $output .= '<p>' . bts('Team member @name requested team foundership on'
1217 1217
         . ' @date, but then left the team. This request is now canceled.',
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
           '@name' => $member->boincuser_name,
1220 1220
           '@date' => date('j M Y', $boincteam->ping_time),
1221 1221
         ),
1222
-        NULL, 'boinc:team-request-foundership-response') . '</p>';
1222
+        null, 'boinc:team-request-foundership-response') . '</p>';
1223 1223
       // Automatically cancel the request
1224 1224
       db_set_active('boinc_rw');
1225 1225
       db_query("
@@ -1232,14 +1232,14 @@  discard block
 block discarded – undo
1232 1232
     }
1233 1233
     else {
1234 1234
       $member = user_load(boincuser_lookup_uid($boincteam->ping_user));
1235
-      $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response')
1235
+      $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), null, 'boinc:team-request-foundership-response')
1236 1236
         . '</h2>';
1237 1237
       $output .= '<p>' . bts('Team member @name has requested team foundership.'
1238 1238
         . ' This may be because you left the team or have not had contact with'
1239 1239
         . ' the team for a long time.', array(
1240 1240
           '@name' => $member->boincuser_name,
1241 1241
         )
1242
-      , array(), NULL, 'boinc:team-request-foundership-response') . '</p>';
1242
+      , array(), null, 'boinc:team-request-foundership-response') . '</p>';
1243 1243
       $output .= '<p>' . bts("If you don't decline the request by @date, @name"
1244 1244
         . ' will have the option of assuming team foundership. (note: To'
1245 1245
         . ' accept the request, assign foundership to @name using the form'
@@ -1248,10 +1248,10 @@  discard block
 block discarded – undo
1248 1248
           '@name' => $member->boincuser_name,
1249 1249
           '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)),
1250 1250
         ),
1251
-        NULL, 'boinc:team-request-foundership-response') . '</p>';
1251
+        null, 'boinc:team-request-foundership-response') . '</p>';
1252 1252
       $output .= '<ul class="tab-list">';
1253 1253
       $output .= '  <li class="first last tab">' .
1254
-        l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request") . '</li>';
1254
+        l(bts('Deny request', array(), null, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request") . '</li>';
1255 1255
       $output .= '</ul>';
1256 1256
     }
1257 1257
   }
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 function boincteam_search_panel() {
1262 1262
   $output = '';
1263 1263
   if (module_exists('global_search_teams_solr')) {
1264
-    $output .= '<h2 class="pane-title">' . bts('Search teams', array(), NULL, 'boinc:search-team') . '</h2>';
1264
+    $output .= '<h2 class="pane-title">' . bts('Search teams', array(), null, 'boinc:search-team') . '</h2>';
1265 1265
     //$output .= '<p>' . bts('Render a search form here.', array(), NULL, 'boinc:search-team') . '</p>';
1266 1266
     $output .= '<p>' . boincteam_search_view() . '</p>';
1267 1267
   }
@@ -1281,18 +1281,18 @@  discard block
 block discarded – undo
1281 1281
 function boincteam_topic_overview_panel() {
1282 1282
   $site_name =  variable_get('site_name', 'Drupal-BOINC');
1283 1283
   $output = '';
1284
-  $output .= '<h2 class="pane-title">' . bts('Teams', array(), NULL, 'boinc:team-general-info') . '</h2>';
1284
+  $output .= '<h2 class="pane-title">' . bts('Teams', array(), null, 'boinc:team-general-info') . '</h2>';
1285 1285
   $output .= '<div class="">';
1286 1286
   $output .= '<p>' . bts('@project participants may form teams. You may belong'
1287 1287
     . ' to only one team. You can join or quit a team at any time. To join a'
1288 1288
     . ' team, visit its team page and click "Join this team". Each team has a'
1289
-    . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info') . '</p>';
1289
+    . ' founder who may:', array('@project' => $site_name), null, 'boinc:team-general-info') . '</p>';
1290 1290
   $output .= '<ul>';
1291
-  $output .= '  <li>' . bts('Private Message all team members', array(), NULL, 'boinc:team-general-info') . '</li>';
1292
-  $output .= '  <li>' . bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info') . '</li>';
1293
-  $output .= '  <li>' . bts('add or remove team admins', array(), NULL, 'boinc:team-general-info') . '</li>';
1294
-  $output .= '  <li>' . bts('remove members from the team', array(), NULL, 'boinc:team-general-info') . '</li>';
1295
-  $output .= '  <li>' . bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info') . '</li>';
1291
+  $output .= '  <li>' . bts('Private Message all team members', array(), null, 'boinc:team-general-info') . '</li>';
1292
+  $output .= '  <li>' . bts("edit the team's name and description", array(), null, 'boinc:team-general-info') . '</li>';
1293
+  $output .= '  <li>' . bts('add or remove team admins', array(), null, 'boinc:team-general-info') . '</li>';
1294
+  $output .= '  <li>' . bts('remove members from the team', array(), null, 'boinc:team-general-info') . '</li>';
1295
+  $output .= '  <li>' . bts('disband a team if it has no members', array(), null, 'boinc:team-general-info') . '</li>';
1296 1296
   $output .= '</ul>';
1297 1297
   $output .= '</div>';
1298 1298
   return $output;
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
   if ($team->type != "team") {
1328 1328
     return;
1329 1329
   }
1330
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
1330
+  $boincteam = boincteam_load(boincteam_lookup_id($team_id), true);
1331 1331
   $founder = user_load(get_drupal_id($boincteam->userid));
1332 1332
   $new_members = array();
1333 1333
   if ($boincteam->new_members) {
@@ -1341,30 +1341,30 @@  discard block
 block discarded – undo
1341 1341
   $output .= '<div>';
1342 1342
   $output .= '<div class="left-column">';
1343 1343
   $output .= '<ul class="stats">';
1344
-  $output .= '  <li>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>';
1345
-  $output .= '  <li>' . bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1346
-  $output .= '  <li>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>';
1347
-  $output .= '  <li>' . bts('Type', array(), NULL, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>';
1344
+  $output .= '  <li>' . bts('Total credit', array(), null, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>';
1345
+  $output .= '  <li>' . bts('Recent average credit', array(), null, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>';
1346
+  $output .= '  <li>' . bts('Country', array(), null, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>';
1347
+  $output .= '  <li>' . bts('Type', array(), null, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>';
1348 1348
   $output .= '</ul>';
1349 1349
   $output .= '</div>';
1350 1350
   $output .= '<div class="right-column">';
1351 1351
   $output .= '<ul class="stats">';
1352
-  $output .= '  <li>' . bts('Founder', array(), NULL, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1353
-  $output .= '  <li>' . bts('New members in last day', array(), NULL, 'boinc:view-team-info') . ': ' . implode('&middot;', $new_members) . '</li>';
1354
-  $output .= '  <li>' . bts('Total members', array(), NULL, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1355
-  $output .= '  <li>' . bts('Active members', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>';
1356
-  $output .= '  <li>' . bts('Members with credit', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>';
1352
+  $output .= '  <li>' . bts('Founder', array(), null, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>';
1353
+  $output .= '  <li>' . bts('New members in last day', array(), null, 'boinc:view-team-info') . ': ' . implode('&middot;', $new_members) . '</li>';
1354
+  $output .= '  <li>' . bts('Total members', array(), null, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>';
1355
+  $output .= '  <li>' . bts('Active members', array(), null, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>';
1356
+  $output .= '  <li>' . bts('Members with credit', array(), null, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>';
1357 1357
   $output .= '</ul>';
1358 1358
   $output .= '</div>';
1359 1359
   $output .= '</div>';
1360 1360
   $output .= '<div class="clearfix"></div>';
1361 1361
   if ($boincteam->url) {
1362 1362
     $output .= '<div class="stats">';
1363
-    $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}");
1363
+    $output .= bts('Website', array(), null, 'boinc:website-of-user-or-team') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}");
1364 1364
     $output .= '</div>';
1365 1365
   }
1366 1366
   if ($team->body) {
1367
-    $output .= '<h3>' . bts('Description', array(), NULL, 'boinc:team-description') . '</h3>';
1367
+    $output .= '<h3>' . bts('Description', array(), null, 'boinc:team-description') . '</h3>';
1368 1368
     $output .= check_markup($team->body, $team->format);
1369 1369
     $output .= '</div>';
1370 1370
   }
Please login to merge, or discard this patch.
sites/default/boinc/modules/comment_form_block/comment_form_block.module 3 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -9,40 +9,40 @@  discard block
 block discarded – undo
9 9
  * Implements hook_block() for Drupal 6 compatibility
10 10
  */
11 11
 function comment_form_block_block($op = 'list', $delta = 0, $edit = array()) {
12
-  switch ($op) {
13
-  case 'view':
12
+    switch ($op) {
13
+    case 'view':
14 14
     //$block = node_comment_block_block_view($delta);
15 15
     $block = array();
16 16
     if ($delta == 'comment_form') {
17
-      if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
17
+        if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
18 18
         global $user;
19 19
         $node = node_load($nid);
20 20
         if ($node->comment !== 0 AND user_access('post comments', $user)) {
21
-          $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
22
-          $block['content'] = '<h2>' . bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment') . '</h2>';
23
-          $block['content'] .= drupal_get_form('comment_form', array('nid' => $nid));
21
+            $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
22
+            $block['content'] = '<h2>' . bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment') . '</h2>';
23
+            $block['content'] .= drupal_get_form('comment_form', array('nid' => $nid));
24
+        }
24 25
         }
25
-      }
26 26
     }
27 27
     break;
28
-  case 'list':
28
+    case 'list':
29 29
     $blocks = comment_form_block_block_info();
30 30
     return $blocks;
31 31
     break;
32
-  default:
32
+    default:
33 33
   }
34
-  return $block;
34
+    return $block;
35 35
 }
36 36
 
37 37
 /**
38 38
  * Implements hook_block_info().
39 39
  */
40 40
 function comment_form_block_block_info() {
41
-  $blocks['comment_form'] = array(
41
+    $blocks['comment_form'] = array(
42 42
     'info' => bts('Comment form', array(), NULL, 'boinc:forum-comment-form'),
43
-  );
43
+    );
44 44
 
45
-  return $blocks;
45
+    return $blocks;
46 46
 }
47 47
 
48 48
 /**
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
  * Implements hook_form_FORM_ID_alter() for block_admin_configure.
82 82
  */
83 83
 function comment_form_block_form_block_admin_configure_alter(&$form, &$form_state) {
84
-  if (isset($form['delta'])) {
84
+    if (isset($form['delta'])) {
85 85
     if ($form['delta']['#value'] == 'comment_form') {
86
-      $form['settings']['title']['#disabled'] = TRUE;
87
-      $form['settings']['title']['#description'] = t('The title for this block cannot be overridden.');
86
+        $form['settings']['title']['#disabled'] = TRUE;
87
+        $form['settings']['title']['#description'] = t('The title for this block cannot be overridden.');
88
+    }
88 89
     }
89
-  }
90 90
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         $node = node_load($nid);
20 20
         if ($node->comment !== 0 AND user_access('post comments', $user)) {
21 21
           $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
22
-          $block['content'] = '<h2>' . bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment') . '</h2>';
22
+          $block['content'] = '<h2>'.bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment').'</h2>';
23 23
           $block['content'] .= drupal_get_form('comment_form', array('nid' => $nid));
24 24
         }
25 25
       }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
       if (arg(0) == 'node' && is_numeric($nid = arg(1)) && !arg(2)) {
18 18
         global $user;
19 19
         $node = node_load($nid);
20
-        if ($node->comment !== 0 AND user_access('post comments', $user)) {
21
-          $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements.
22
-          $block['content'] = '<h2>' . bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment') . '</h2>';
20
+        if ($node->comment !== 0 and user_access('post comments', $user)) {
21
+          $block['subject'] = null; // This should be NULL otherwise there will be duplicate h2 elements.
22
+          $block['content'] = '<h2>' . bts('Post new comment', array(), null, 'boinc:forum-post-new-comment') . '</h2>';
23 23
           $block['content'] .= drupal_get_form('comment_form', array('nid' => $nid));
24 24
         }
25 25
       }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
  */
40 40
 function comment_form_block_block_info() {
41 41
   $blocks['comment_form'] = array(
42
-    'info' => bts('Comment form', array(), NULL, 'boinc:forum-comment-form'),
42
+    'info' => bts('Comment form', array(), null, 'boinc:forum-comment-form'),
43 43
   );
44 44
 
45 45
   return $blocks;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 function comment_form_block_form_block_admin_configure_alter(&$form, &$form_state) {
84 84
   if (isset($form['delta'])) {
85 85
     if ($form['delta']['#value'] == 'comment_form') {
86
-      $form['settings']['title']['#disabled'] = TRUE;
86
+      $form['settings']['title']['#disabled'] = true;
87 87
       $form['settings']['title']['#description'] = t('The title for this block cannot be overridden.');
88 88
     }
89 89
   }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincstats/boincstats.admin.inc 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -8,38 +8,38 @@  discard block
 block discarded – undo
8 8
 
9 9
 
10 10
 /**
11
-  * The BOINC stats configuration determines where statistics are sourced
12
-  */
11
+ * The BOINC stats configuration determines where statistics are sourced
12
+ */
13 13
 function boincstats_admin_stats_system(&$form_state) {
14
-  $form = array();
15
-  $default = array(
14
+    $form = array();
15
+    $default = array(
16 16
     'boinc_stats_server' => variable_get('boinc_stats_server', 'stats.gridrepublic.org'),
17 17
     'boinc_stats_project_list_rpc' => variable_get('boinc_stats_project_list_rpc', 'rpc/get_projects.php'),
18 18
     'boinc_stats_project_credit_history_rpc' => variable_get('boinc_stats_project_credit_history_rpc', 'rpc2/get_project_tc_history.php'),
19 19
     'boinc_stats_user_credit_history_rpc' => variable_get('boinc_stats_user_credit_history_rpc', 'rpc2/get_user_credit_history.php'),
20 20
     'boinc_stats_remote_project_id' => variable_get('boinc_stats_remote_project_id', ''),
21
-  );
22
-  // Define the form
23
-  $form['boinc_stats_server'] = array(
21
+    );
22
+    // Define the form
23
+    $form['boinc_stats_server'] = array(
24 24
     '#type' => 'value',
25 25
     '#value' => $default['boinc_stats_server']
26
-  );
27
-  $form['boinc_stats_project_list_rpc'] = array(
26
+    );
27
+    $form['boinc_stats_project_list_rpc'] = array(
28 28
     '#type' => 'value',
29 29
     '#value' => $default['boinc_stats_project_list_rpc']
30
-  );
31
-  $form['boinc_stats_project_credit_history_rpc'] = array(
30
+    );
31
+    $form['boinc_stats_project_credit_history_rpc'] = array(
32 32
     '#type' => 'value',
33 33
     '#value' => $default['boinc_stats_project_credit_history_rpc']
34
-  );
35
-  $form['boinc_stats_user_credit_history_rpc'] = array(
34
+    );
35
+    $form['boinc_stats_user_credit_history_rpc'] = array(
36 36
     '#type' => 'value',
37 37
     '#value' => $default['boinc_stats_user_credit_history_rpc']
38
-  );
39
-  $form['boinc_stats_remote_project_id'] = array(
38
+    );
39
+    $form['boinc_stats_remote_project_id'] = array(
40 40
     '#type' => 'textfield',
41 41
     '#title' => t('Stats ID for @project', array(
42
-      '@project' => variable_get('site_name', 'Drupal-BOINC'))),
42
+        '@project' => variable_get('site_name', 'Drupal-BOINC'))),
43 43
     '#default_value' => $default['boinc_stats_remote_project_id'],
44 44
     '#description' => t('This project must be registered with a stats system in
45 45
       order for some statistics to be available. Currently only one system is
@@ -47,26 +47,26 @@  discard block
 block discarded – undo
47 47
         '!find_project_id' => l(t('Find your project ID'),
48 48
         "http://{$default['boinc_stats_server']}/{$default['boinc_stats_project_list_rpc']}",
49 49
         array('attributes' => array('target' => 'external')))
50
-      )
50
+        )
51 51
     )
52
-  );
53
-  return system_settings_form($form);
52
+    );
53
+    return system_settings_form($form);
54 54
 }
55 55
 
56 56
 /**
57
-  * Validate the BOINC stats form.
58
-  */
57
+ * Validate the BOINC stats form.
58
+ */
59 59
 function boincstats_admin_stats_system_validate($form, &$form_state) {
60
-  $values = $form_state['values'];
61
-  if (!$values['boinc_stats_remote_project_id']) {
60
+    $values = $form_state['values'];
61
+    if (!$values['boinc_stats_remote_project_id']) {
62 62
     form_set_error('boinc_stats_remote_project_id',
63
-      t('Stats may not work without a valid stats ID configured!'));
64
-  }
63
+        t('Stats may not work without a valid stats ID configured!'));
64
+    }
65 65
 }
66 66
 
67 67
 /**
68
-  * Handle post-validation submission of BOINC stats form.
69
-  */
68
+ * Handle post-validation submission of BOINC stats form.
69
+ */
70 70
 function boincstats_admin_stats_system_submit($form, &$form_state) {
71
-  drupal_set_message(t('Stats system configuration has been updated.'));
71
+    drupal_set_message(t('Stats system configuration has been updated.'));
72 72
 }
Please login to merge, or discard this patch.
drupal/sites/all/features/global_search_solr/global_search_solr.module 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 // Hackish... but there doesn't seem to be a non-hackish way to change the
6 6
 // label on the search form!? Need a custom module to call hook_form_alter()...
7 7
 function global_search_solr_form_alter(&$form, &$form_state, $form_id) {
8
-  if ($form_id == 'apachesolr_search_custom_page_search_form') {
8
+    if ($form_id == 'apachesolr_search_custom_page_search_form') {
9 9
     $form['basic']['keys']['#title'] = t('Search');
10 10
     $form['basic']['keys']['#size'] = 40;
11
-  }
11
+    }
12 12
 }
Please login to merge, or discard this patch.
html/ops/bbcode_convert_response1.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,15 +42,15 @@
 block discarded – undo
42 42
     $start_id = 0; //Set this to something else if you like
43 43
     $profiles = _mysql_query("select * from profile where userid>$start_id order by userid");
44 44
     echo _mysql_error();
45
-    $i=0;
46
-    while ($profile = _mysql_fetch_object($profiles)){
45
+    $i = 0;
46
+    while ($profile = _mysql_fetch_object($profiles)) {
47 47
         $i++;
48 48
         if ($i%100 == 0) {                      //For every 100 profiles
49
-            echo $profile->userid.". "; flush();   // print out where we are
49
+            echo $profile->userid.". "; flush(); // print out where we are
50 50
             //usleep(200000);
51 51
         }
52 52
 
53
-        if ($profile->userid > $start_id){
53
+        if ($profile->userid > $start_id) {
54 54
             fix_profile($profile);
55 55
         }
56 56
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,14 +43,15 @@
 block discarded – undo
43 43
     $profiles = _mysql_query("select * from profile where userid>$start_id order by userid");
44 44
     echo _mysql_error();
45 45
     $i=0;
46
-    while ($profile = _mysql_fetch_object($profiles)){
46
+    while ($profile = _mysql_fetch_object($profiles)) {
47 47
         $i++;
48
-        if ($i%100 == 0) {                      //For every 100 profiles
48
+        if ($i%100 == 0) {
49
+//For every 100 profiles
49 50
             echo $profile->userid.". "; flush();   // print out where we are
50 51
             //usleep(200000);
51 52
         }
52 53
 
53
-        if ($profile->userid > $start_id){
54
+        if ($profile->userid > $start_id) {
54 55
             fix_profile($profile);
55 56
         }
56 57
     }
Please login to merge, or discard this patch.
html/inc/bootstrap.inc 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
         // prefix for links; needed for pages not in top dir
142 142
     $user,
143 143
         // logged-in user, if any
144
-    $fixed=false,
144
+    $fixed = false,
145 145
         // if true, navbar is fixed at top of page.
146 146
         // NOTE: if you do this, you must set a global var $fixed_navbar
147 147
         // to true at compile time
148 148
         // (it needs to be set when page_head() is called).
149
-    $inverse=false
149
+    $inverse = false
150 150
         // white on black?
151 151
 ) {
152 152
     global $master_url;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 // output a panel.
215 215
 // $content_func is a function that generates the panel contents
216 216
 //
217
-function panel($title, $content_func, $class="panel-primary", $body_class="") {
217
+function panel($title, $content_func, $class = "panel-primary", $body_class = "") {
218 218
     echo sprintf('<div class="panel %s">
219 219
         ', $class
220 220
     );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 // are functions that generate the top, left, and right content
241 241
 // $left_width is the width of left column in 1/12 units.
242 242
 //
243
-function grid($top_func, $left_func, $right_func, $left_width=6) {
243
+function grid($top_func, $left_func, $right_func, $left_width = 6) {
244 244
     echo '
245 245
         <div class="container-fluid">
246 246
     ';
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             </div>
256 256
         ';
257 257
     }
258
-    $right_width = 12-$left_width;
258
+    $right_width = 12 - $left_width;
259 259
     echo '
260 260
         <div class="row">
261 261
         <div class="col-sm-'.$left_width.'">
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 //      use extra = "name=x"
280 280
 //      call forum_focus(x, foo) after defining the field
281 281
 //
282
-function form_start($action, $method='get', $extra='') {
282
+function form_start($action, $method = 'get', $extra = '') {
283 283
     echo sprintf(
284 284
         '<div class="container-fluid">
285 285
         <form class="form-horizontal" method="%s" action="%s" %s>'
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 // just the input field
312 312
 //
313 313
 function form_input_text_field(
314
-    $name, $value='', $type='text', $attrs='', $extra=''
314
+    $name, $value = '', $type = 'text', $attrs = '', $extra = ''
315 315
 ) {
316 316
     return sprintf(
317 317
         '<input %s type="%s" class="form-control" name="%s" value="%s">%s',
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 // the whole row
323 323
 //
324 324
 function form_input_text(
325
-    $label, $name, $value='', $type='text', $attrs='', $extra=''
325
+    $label, $name, $value = '', $type = 'text', $attrs = '', $extra = ''
326 326
 ) {
327 327
     echo sprintf('
328 328
         <div class="form-group">
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     );
351 351
 }
352 352
 
353
-function form_input_textarea($label, $name, $value='', $nrows=4) {
353
+function form_input_textarea($label, $name, $value = '', $nrows = 4) {
354 354
     echo sprintf('
355 355
         <div class="form-group">
356 356
             <label align=right class="%s" for="%s">%s</label>
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 // same, for multiple select.
390 390
 // flags, if non-null, says which ones are selected
391 391
 //
392
-function form_select_multiple($label, $name, $items, $flags=null) {
392
+function form_select_multiple($label, $name, $items, $flags = null) {
393 393
     echo sprintf('
394 394
         <div class="form-group">
395 395
             <label align=right class="%s" for="%s">%s</label>
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
     );
401 401
     $n = 0;
402 402
     foreach ($items as $i) {
403
-        $s = ($flags && $flags[$n])?'selected':'';
403
+        $s = ($flags && $flags[$n]) ? 'selected' : '';
404 404
         echo '<option '.$s.' value="'.$i[0].'">'.$i[1].'</option>
405 405
         ';
406 406
         $n++;
@@ -410,12 +410,12 @@  discard block
 block discarded – undo
410 410
 
411 411
 // return a list of string for checkbox items
412 412
 //
413
-function checkbox_item_strings($items, $attrs='') {
413
+function checkbox_item_strings($items, $attrs = '') {
414 414
     $x = [];
415 415
     foreach ($items as $i) {
416 416
         $x[] = sprintf('<input %s type="checkbox" name="%s" %s> %s
417 417
             ',
418
-            $attrs, $i[0], $i[2]?"checked":"", $i[1]
418
+            $attrs, $i[0], $i[2] ? "checked" : "", $i[1]
419 419
         );
420 420
     }
421 421
     return $x;
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 
424 424
 // $items is list of (name, label, checked)
425 425
 //
426
-function form_checkboxes($label, $items, $attrs='') {
426
+function form_checkboxes($label, $items, $attrs = '') {
427 427
     echo sprintf('
428 428
         <div class="form-group">
429 429
             <label align=right class="%s">%s</label>
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
         FORM_LEFT_CLASS, $label, FORM_RIGHT_CLASS
450 450
     );
451 451
     foreach ($items as $i) {
452
-        $checked = ($selected == $i[0])?"checked":"";
452
+        $checked = ($selected == $i[0]) ? "checked" : "";
453 453
         echo sprintf('<input type="radio" name="%s" value="%s" %s> %s <br>
454 454
             ',
455 455
             $name, $i[0], $checked, $i[1]
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 ';
483 483
 }
484 484
 
485
-function form_submit($text, $attrs='') {
485
+function form_submit($text, $attrs = '') {
486 486
     form_general(
487 487
         "",
488 488
         sprintf('<button %s type="submit" class="btn btn-success">%s</button>',
@@ -491,11 +491,11 @@  discard block
 block discarded – undo
491 491
     );
492 492
 }
493 493
 
494
-function form_checkbox($label, $name, $checked=false) {
494
+function form_checkbox($label, $name, $checked = false) {
495 495
     echo sprintf('
496 496
         <div class="form-group">
497 497
             <input type="checkbox" name="%s" %s> &nbsp; <span class="lead">%s</span>
498 498
         </div>
499
-        ', $name, $checked?"checked":"", $label
499
+        ', $name, $checked ? "checked" : "", $label
500 500
     );
501 501
 }
Please login to merge, or discard this patch.
html/user/sandbox.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     } else {
68 68
         sort($files);
69 69
         start_table();
70
-        table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download");
70
+        table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download");
71 71
         foreach ($files as $f) {
72 72
             $path = "$dir/$f";
73 73
             list($error, $size, $md5) = sandbox_parse_link_file($path);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $s = stat($tmp_name);
118 118
         $size = $s['size'];
119 119
         [$exists, $elf] = sandbox_lf_exists($user, $md5);
120
-        if (!$exists){
120
+        if (!$exists) {
121 121
             // move file to download dir
122 122
             //
123 123
             $phys_path = sandbox_physical_path($user, $md5);
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
         error_page("physical file is missing");
151 151
     }
152 152
     $bused = sandbox_file_in_use($user, $name);
153
-    if ($bused){
153
+    if ($bused) {
154 154
         $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>";
155
-    } else{
155
+    } else {
156 156
         unlink("$dir/$name");
157 157
         $notice = "<strong>$name</strong> was deleted from your sandbox<br/>";
158 158
         [$exists, $elf] = sandbox_lf_exists($user, $md5);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 if (!$action) $action = post_str('action', true);
197 197
 
198 198
 switch ($action) {
199
-case '': list_files($user,""); break;
199
+case '': list_files($user, ""); break;
200 200
 case 'upload_file': upload_file($user); break;
201 201
 case 'delete_file': delete_file($user); break;
202 202
 case 'download_file': download_file($user); break;
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $s = stat($tmp_name);
118 118
         $size = $s['size'];
119 119
         [$exists, $elf] = sandbox_lf_exists($user, $md5);
120
-        if (!$exists){
120
+        if (!$exists) {
121 121
             // move file to download dir
122 122
             //
123 123
             $phys_path = sandbox_physical_path($user, $md5);
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
         error_page("physical file is missing");
151 151
     }
152 152
     $bused = sandbox_file_in_use($user, $name);
153
-    if ($bused){
153
+    if ($bused) {
154 154
         $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>";
155
-    } else{
155
+    } else {
156 156
         unlink("$dir/$name");
157 157
         $notice = "<strong>$name</strong> was deleted from your sandbox<br/>";
158 158
         [$exists, $elf] = sandbox_lf_exists($user, $md5);
Please login to merge, or discard this patch.
html/ops/check_account_ownership_keys.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
 admin_page_head("Account Ownership Keys");
24 24
 
25 25
 if (!file_exists($account_ownership_private_key_file_path)) {
26
-  echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
26
+    echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
27 27
 } else {
28
-  echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>";
28
+    echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>";
29 29
 }
30 30
 
31 31
 if (!file_exists($account_ownership_public_key_file_path)) {
32
-  echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
32
+    echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
33 33
 } else {
34
-  echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>";
34
+    echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>";
35 35
 }
36 36
 
37 37
 echo "<p>For more info see the related wiki page: <a href=\"https://github.com/BOINC/boinc/wiki/ProofOfOwnership\">ProofOfOwnership</a></p>";
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
 admin_page_head("Account Ownership Keys");
24 24
 
25 25
 if (!file_exists($account_ownership_private_key_file_path)) {
26
-  echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
26
+  echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
27 27
 } else {
28
-  echo "<p>The account ownership private key '" . $account_ownership_private_key_file_name . "' exists.</p>";
28
+  echo "<p>The account ownership private key '".$account_ownership_private_key_file_name."' exists.</p>";
29 29
 }
30 30
 
31 31
 if (!file_exists($account_ownership_public_key_file_path)) {
32
-  echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
32
+  echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' <b>doesn't</b> exist. Please run the 'generate_account_ownership_keys.php' script from the command line in the BOINC web server ops directory.</p>";
33 33
 } else {
34
-  echo "<p>The account ownership public key '" . $account_ownership_public_key_file_name . "' exists.</p>";
34
+  echo "<p>The account ownership public key '".$account_ownership_public_key_file_name."' exists.</p>";
35 35
 }
36 36
 
37 37
 echo "<p>For more info see the related wiki page: <a href=\"https://github.com/BOINC/boinc/wiki/ProofOfOwnership\">ProofOfOwnership</a></p>";
Please login to merge, or discard this patch.
html/inc/sandbox.inc 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 // Return path of sandbox directory for the given user.
33 33
 // Create dir if not present.
34 34
 //
35
-if (!function_exists("sandbox_dir")){
35
+if (!function_exists("sandbox_dir")) {
36 36
 function sandbox_dir($user) {
37 37
     $dir = parse_config(get_config(), "<sandbox_dir>");
38 38
     if (!$dir) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     foreach ($files as $file) {
64 64
         $path = "$dir/$file";
65 65
         [$err, $file_size, $file_md5] = sandbox_parse_link_file($path);
66
-        if (!$err){
66
+        if (!$err) {
67 67
             if (strcmp($md5, $file_md5) == 0) {
68 68
                 $exist = true;
69 69
                 $elf = $file;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     }
131 131
     $files = sandbox_file_names($user);
132 132
     foreach ($files as $f) {
133
-        if ($regexp && !preg_match("/$regexp/",$f)) continue;
133
+        if ($regexp && !preg_match("/$regexp/", $f)) continue;
134 134
         $x .= "<option value=\"$f\">$f</option>\n";
135 135
     }
136 136
     $x .= "</select>\n";
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 // TODO: this is a kludge.
153 153
 // Should we use the job_file and batch_file_assoc tables instead?
154 154
 //
155
-function sandbox_file_in_use($user, $file){
155
+function sandbox_file_in_use($user, $file) {
156 156
     $ufiles = array();
157 157
 
158 158
     $pbatches = BoincBatch::enum(
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
     );
163 163
     if (!$pbatches) return false;
164 164
 
165
-    foreach ($pbatches as $batch){
166
-        $wus = BoincWorkUnit::enum("batch = $batch->id limit 1" );
167
-        if ($wus == null){
165
+    foreach ($pbatches as $batch) {
166
+        $wus = BoincWorkUnit::enum("batch = $batch->id limit 1");
167
+        if ($wus == null) {
168 168
             continue;
169 169
         }
170
-        foreach($wus as $wu){
170
+        foreach ($wus as $wu) {
171 171
             $x = "<in>".$wu->xml_doc."</in>";
172 172
             $x = simplexml_load_string($x);
173 173
             global $fanout;
174
-            foreach($x->workunit->file_ref as $fr){
174
+            foreach ($x->workunit->file_ref as $fr) {
175 175
                 $pname = (string)$fr->file_name;
176 176
                 $ufiles[] = $pname;
177 177
             }
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
     $dir = sandbox_dir($user);
181 181
     $path = $dir."/".$file;
182 182
     list($err, $size, $md5) = sandbox_parse_link_file($path);
183
-    if (!$err){
183
+    if (!$err) {
184 184
         $f = sandbox_file_name($user, $md5);
185
-        foreach($ufiles as $uf) {
186
-            if (strcmp($f,$uf) == 0){
185
+        foreach ($ufiles as $uf) {
186
+            if (strcmp($f, $uf) == 0) {
187 187
                 return true;
188 188
             }
189 189
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 // Return path of sandbox directory for the given user.
33 33
 // Create dir if not present.
34 34
 //
35
-if (!function_exists("sandbox_dir")){
35
+if (!function_exists("sandbox_dir")) {
36 36
 function sandbox_dir($user) {
37 37
     $dir = parse_config(get_config(), "<sandbox_dir>");
38 38
     if (!$dir) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     foreach ($files as $file) {
64 64
         $path = "$dir/$file";
65 65
         [$err, $file_size, $file_md5] = sandbox_parse_link_file($path);
66
-        if (!$err){
66
+        if (!$err) {
67 67
             if (strcmp($md5, $file_md5) == 0) {
68 68
                 $exist = true;
69 69
                 $elf = $file;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 // TODO: this is a kludge.
153 153
 // Should we use the job_file and batch_file_assoc tables instead?
154 154
 //
155
-function sandbox_file_in_use($user, $file){
155
+function sandbox_file_in_use($user, $file) {
156 156
     $ufiles = array();
157 157
 
158 158
     $pbatches = BoincBatch::enum(
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
     );
163 163
     if (!$pbatches) return false;
164 164
 
165
-    foreach ($pbatches as $batch){
165
+    foreach ($pbatches as $batch) {
166 166
         $wus = BoincWorkUnit::enum("batch = $batch->id limit 1" );
167
-        if ($wus == null){
167
+        if ($wus == null) {
168 168
             continue;
169 169
         }
170
-        foreach($wus as $wu){
170
+        foreach($wus as $wu) {
171 171
             $x = "<in>".$wu->xml_doc."</in>";
172 172
             $x = simplexml_load_string($x);
173 173
             global $fanout;
174
-            foreach($x->workunit->file_ref as $fr){
174
+            foreach($x->workunit->file_ref as $fr) {
175 175
                 $pname = (string)$fr->file_name;
176 176
                 $ufiles[] = $pname;
177 177
             }
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
     $dir = sandbox_dir($user);
181 181
     $path = $dir."/".$file;
182 182
     list($err, $size, $md5) = sandbox_parse_link_file($path);
183
-    if (!$err){
183
+    if (!$err) {
184 184
         $f = sandbox_file_name($user, $md5);
185 185
         foreach($ufiles as $uf) {
186
-            if (strcmp($f,$uf) == 0){
186
+            if (strcmp($f,$uf) == 0) {
187 187
                 return true;
188 188
             }
189 189
 
Please login to merge, or discard this patch.