Completed
Pull Request — master (#1795)
by Christian
16:22 queued 04:43
created
drupal/sites/default/boinc/modules/boincwork/boincwork.module 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
   $items['host/%/set-venue/%'] = array(
116 116
     'title' => 'Set host venue',
117 117
     'page callback' => 'boincwork_host_set_venue',
118
-    'page arguments' => array(1,3),
118
+    'page arguments' => array(1, 3),
119 119
     'access callback' => 'user_is_logged_in',
120 120
     'type' => MENU_CALLBACK,
121 121
   );
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
       drupal_prepare_form('boincwork_generalprefs_form', $prefs[$pref_set], $form_state);
247 247
     }
248 248
 
249
-    $output .= '<p>' . bts('These apply to all BOINC projects in which you participate.') . '<br/>';
250
-    $output .= bts('On computers attached to multiple projects, the most recently modified preferences will be used.') . '</p>';
251
-    $output .= '<p>' . bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['prefs']['modified']['#value']))) . '</p>';
252
-    $output .= '<h2>' . bts('Combined preferences') . ' ' . l('(' . bts('Switch View') . ')', 'account/prefs/computing') . '</h2>';
249
+    $output .= '<p>'.bts('These apply to all BOINC projects in which you participate.').'<br/>';
250
+    $output .= bts('On computers attached to multiple projects, the most recently modified preferences will be used.').'</p>';
251
+    $output .= '<p>'.bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['prefs']['modified']['#value']))).'</p>';
252
+    $output .= '<h2>'.bts('Combined preferences').' '.l('('.bts('Switch View').')', 'account/prefs/computing').'</h2>';
253 253
     
254 254
     $output .= '<table class="preferences combined">';
255 255
     
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
       $output .= '<tr class="section-heading">';
260 260
       $output .= "<td>{$section['name']}</td>";
261 261
       foreach ($pref_sets as $pref_set) {
262
-        $output .= '<td>' . $pref_set . '</td>';
262
+        $output .= '<td>'.$pref_set.'</td>';
263 263
       }
264 264
       $output .= '</tr>';
265 265
       foreach ($section['elements'] as $name => $setting) {
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
               $second_pref = $special_map[$name];
308 308
               $second_pref_setting = $prefs[$pref_set]['prefs']['advanced'][$category][$second_pref];
309 309
               $second_value = isset($second_pref_setting['#options']) ? $second_pref_setting['#options'][$second_pref_setting['#default_value']] : $second_pref_setting['#default_value'];
310
-              $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}" .
310
+              $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}".
311 311
                 " {$second_value} {$second_pref_setting['#field_suffix']} </td>";
312 312
             }
313 313
           }
314
-          else  {
314
+          else {
315 315
             $output .= '<td>---</td>';
316 316
           }
317 317
         }
@@ -339,12 +339,12 @@  discard block
 block discarded – undo
339 339
       );
340 340
       // Show Clear links for established preference sets
341 341
       if ($pref_set != 'generic' AND $prefs[$pref_set]['#established']) {
342
-        $output .= ' </li><li class="tab"> ' . l(bts('Clear'), "account/prefs/computing/clear/{$pref_set}",
342
+        $output .= ' </li><li class="tab"> '.l(bts('Clear'), "account/prefs/computing/clear/{$pref_set}",
343 343
           array(
344 344
             'query' => drupal_get_destination(),
345 345
             'attributes' => array(
346
-              'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the "@name" preference set. Are you sure?',
347
-                array('@name' => ucfirst($pref_set))) . '\')'
346
+              'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the "@name" preference set. Are you sure?',
347
+                array('@name' => ucfirst($pref_set))).'\')'
348 348
             )
349 349
           )
350 350
         );
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
         "{$path}/work" => bts('Work')
371 371
       );
372 372
       variable_set('jump_use_js_venues-Array', 1);
373
-      drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
374
-      drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme');
373
+      drupal_add_js(drupal_get_path('module', 'jump').'/jump.js');
374
+      drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme');
375 375
       
376 376
       $output .= '<div id="venue-selector" class="simple-form-controls">';
377 377
       $output .= '  <div class="form-item venue">';
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     if (!$current_set['#established']) {
392 392
       drupal_set_message(bts(
393 393
           "No preferences found for set '@venue'. Click SAVE CHANGES below to save the following preferences to your account.",
394
-          array( '@venue' => $venue, )
394
+          array('@venue' => $venue,)
395 395
       ), 'status');
396 396
     }
397 397
     
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
       drupal_prepare_form('boincwork_projectprefs_form', $prefs[$pref_set], $form_state);
451 451
     }
452 452
     
453
-    $output .= '<h2>' . bts('Combined preferences') . ' ' . l('(' . bts('Switch View') . ')', 'account/prefs/project') . '</h2>';
453
+    $output .= '<h2>'.bts('Combined preferences').' '.l('('.bts('Switch View').')', 'account/prefs/project').'</h2>';
454 454
     
455 455
     $output .= '<table class="preferences combined">';
456 456
     
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
       $output .= '<tr class="section-heading">';
461 461
       $output .= "<td>{$section['name']}</td>";
462 462
       foreach ($pref_sets as $pref_set) {
463
-        $output .= '<td>' . $pref_set . '</td>';
463
+        $output .= '<td>'.$pref_set.'</td>';
464 464
       }
465 465
       $output .= '</tr>';
466 466
       foreach ($section['elements'] as $name => $setting) {
@@ -502,12 +502,12 @@  discard block
 block discarded – undo
502 502
       $output .= l($action_text, "account/prefs/project/edit/{$pref_set}");
503 503
       // Show Clear links for established preference sets
504 504
       if ($pref_set != 'generic' AND $prefs[$pref_set]['#established']) {
505
-        $output .= ' </li><li class="tab"> ' . l(bts('Clear'), "account/prefs/project/clear/{$pref_set}",
505
+        $output .= ' </li><li class="tab"> '.l(bts('Clear'), "account/prefs/project/clear/{$pref_set}",
506 506
           array(
507 507
             'query' => drupal_get_destination(),
508 508
             'attributes' => array(
509
-              'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the "@name" preference set. Are you sure?',
510
-                array('@name' => ucfirst($pref_set))) . '\')'
509
+              'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the "@name" preference set. Are you sure?',
510
+                array('@name' => ucfirst($pref_set))).'\')'
511 511
             )
512 512
           )
513 513
         );
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
     // Set this preference set as the one to use for any new hosts attached
524 524
     // to the user account
525 525
     boincwork_set_default_venue($venue);
526
-    drupal_set_message( bts('The primary preference set has been changed to "@set"', array('@set' => $venue)) );
526
+    drupal_set_message(bts('The primary preference set has been changed to "@set"', array('@set' => $venue)));
527 527
     drupal_goto('account/prefs/project/combined');
528 528
     break;
529 529
     
@@ -542,8 +542,8 @@  discard block
 block discarded – undo
542 542
         "{$path}/work" => bts('Work')
543 543
       );
544 544
       variable_set('jump_use_js_venues-Array', 1);
545
-      drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
546
-      drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme');
545
+      drupal_add_js(drupal_get_path('module', 'jump').'/jump.js');
546
+      drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme');
547 547
       
548 548
       $output .= '<div id="venue-selector" class="simple-form-controls">';
549 549
       $output .= '  <div class="form-item venue">';
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
     if (!$current_set['#established']) {
564 564
       drupal_set_message(bts(
565 565
           "No preferences found for set '@venue'. Click SAVE CHANGES below to save the following preferences to your account.",
566
-          array( '@venue' => $venue, )
566
+          array('@venue' => $venue,)
567 567
       ), 'status');
568 568
     }
569 569
     
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
     // Edit preferences link
636 636
     $output .= '<tr>';
637 637
     $output .= '<td></td>';
638
-    $output .= '<td>' . l(bts('Edit privacy preferences', array('@project' => PROJECT)), "account/prefs/privacy/edit") . '</td>';
638
+    $output .= '<td>'.l(bts('Edit privacy preferences', array('@project' => PROJECT)), "account/prefs/privacy/edit").'</td>';
639 639
     $output .= '</tr>';
640 640
     
641 641
     $output .= '</table>';
@@ -670,15 +670,15 @@  discard block
 block discarded – undo
670 670
   switch ($type) {
671 671
   case 'all':
672 672
     //include_boinc('user/cert_all.php');
673
-    require_boinc(array('util','cert','user'));
673
+    require_boinc(array('util', 'cert', 'user'));
674 674
 
675 675
     $join = date('j F Y', $boincuser->create_time);
676 676
     $today = date('j F Y', time(0));
677 677
 
678
-    if ($border=="no") {
678
+    if ($border == "no") {
679 679
         $border = 0;
680 680
     } else {
681
-        $border=8;
681
+        $border = 8;
682 682
     }
683 683
 
684 684
     $title_font = "\"Optima,ZapfChancery\"";
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
         <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr>
723 723
     ";
724 724
     foreach ($boincuser->projects as $p) {
725
-        if ($p->total_credit<100) continue;
725
+        if ($p->total_credit < 100) continue;
726 726
         show_proj($p);
727 727
     }
728 728
     echo "
@@ -741,15 +741,15 @@  discard block
 block discarded – undo
741 741
   case 'account':
742 742
   default:
743 743
     //include_boinc('user/cert1.php');
744
-    require_boinc(array('util','cert'));
744
+    require_boinc(array('util', 'cert'));
745 745
 
746 746
     $join = date('j F Y', $boincuser->create_time);
747 747
     $today = date('j F Y', time(0));
748 748
 
749
-    if ($border=="no") {
749
+    if ($border == "no") {
750 750
         $border = 0;
751 751
     } else {
752
-        $border=8;
752
+        $border = 8;
753 753
     }
754 754
 
755 755
     $credit = credit_string($boincuser->total_credit, false);
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinccore/boinccore.module 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
         // RFC2616 mandates that the decimal part is no more than three digits,
263 263
         // so we multiply the qvalue by 1000 to avoid floating point comparisons.
264 264
         $langcode = strtolower($match[1]);
265
-        $qvalue = isset($match[2]) ? (float) $match[2] : 1;
266
-        $browser_langcodes[$langcode] = (int) ($qvalue * 1000);
265
+        $qvalue = isset($match[2]) ? (float)$match[2] : 1;
266
+        $browser_langcodes[$langcode] = (int)($qvalue*1000);
267 267
       }
268 268
     }
269 269
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
     global $base_url;
329 329
     global $base_path;
330 330
     $site_name = variable_get('site_name', bts('project'));
331
-    $site_url = $base_url . $base_path;
331
+    $site_url = $base_url.$base_path;
332 332
     $settings = array(
333 333
       'from' => '',
334 334
       'subject' => "Content at {$site_name} is awaiting moderation",
@@ -380,11 +380,11 @@  discard block
 block discarded – undo
380 380
         $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false);
381 381
       }
382 382
       elseif (is_string($user_image)) {
383
-        $user_info .= '<img src="' . $user_image . '"/>';
383
+        $user_info .= '<img src="'.$user_image.'"/>';
384 384
       }
385 385
       $user_info .= '  </div>';
386 386
     }
387
-    $user_info .= '  <div class="name">' . theme('username', $account) . '</div>';
387
+    $user_info .= '  <div class="name">'.theme('username', $account).'</div>';
388 388
     if ($account->uid) {
389 389
       //$user_info .= '  <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>';
390 390
       //$user_info .= '  <div class="post-count">Posts: ' . $account->post_count . '</div>';
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     $form['buttons']['preview']['#suffix'] = '</li>';
449 449
     $form['buttons']['preview']['#weight'] = 1003;
450 450
     $form['buttons']['cancel'] = array(
451
-      '#value' => '<li class="tab">' . l(bts('Cancel'), $cancel_url) . '</li>',
451
+      '#value' => '<li class="tab">'.l(bts('Cancel'), $cancel_url).'</li>',
452 452
       '#weight' => 1004,
453 453
     );
454 454
     $form['buttons']['form control tabs suffix'] = array(
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
     $form['buttons']['preview_changes']['#suffix'] = '</li>';
487 487
     $form['buttons']['preview_changes']['#weight'] = 1004;
488 488
     $form['buttons']['cancel'] = array(
489
-      '#value' => '<li class="tab">' . l(bts('Cancel'), "community/forum/{$forum_id}") . '</li>',
489
+      '#value' => '<li class="tab">'.l(bts('Cancel'), "community/forum/{$forum_id}").'</li>',
490 490
       '#weight' => 1005,
491 491
     );
492 492
     $form['buttons']['form control tabs suffix'] = array(
@@ -567,8 +567,8 @@  discard block
 block discarded – undo
567 567
 function boinccore_link($type, $object, $teaser = FALSE) {
568 568
   // Add custom links with this hook
569 569
 
570
-  if ($type=='node') {
571
-    if ( ($object->type=='forum') OR ($object->type=='team_forum') ) {
570
+  if ($type == 'node') {
571
+    if (($object->type == 'forum') OR ($object->type == 'team_forum')) {
572 572
       // Add topic moderator controls
573 573
       if (user_access('edit any forum topic')) {
574 574
         $node_control = "node_control/{$object->nid}";
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
       }// if user_access('edit any forum topic')
630 630
     }
631 631
   }
632
-  else if ($type=='comment') {
632
+  else if ($type == 'comment') {
633 633
     $node = node_load($object->nid);
634 634
     $nid = $object->nid;
635 635
     $cid = $object->cid;
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
     if (user_access('administer comments')) {
652 652
       $comment_control = "comment_control/{$cid}";
653 653
       // Add link to convert comment into a new topic
654
-      $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid ));
654
+      $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid));
655 655
       if ($reply_count == 0) {
656 656
         $links['convert'] = array(
657 657
             'title' => bts('Convert'),
@@ -766,8 +766,8 @@  discard block
 block discarded – undo
766 766
     $node->created = $comment->timestamp;
767 767
     $node->changed = $node->created;
768 768
     $node->promote = 0; // Display on front page?
769
-    $node->sticky = 0;  // Display top of page?
770
-    $node->status = 1;   // Published?
769
+    $node->sticky = 0; // Display top of page?
770
+    $node->status = 1; // Published?
771 771
     $node->comment = 2;
772 772
     //$node->language = 'en';
773 773
     $node->uid = $comment->uid;
@@ -850,16 +850,16 @@  discard block
 block discarded – undo
850 850
     $xml->loadXML($global_prefs, LIBXML_NOBLANKS);
851 851
     if ($errors = libxml_get_errors($xml)) {
852 852
       $lines = explode("\r", $global_prefs);
853
-      watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" .
854
-        ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR);
853
+      watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}".
854
+        ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR);
855 855
     }
856 856
   }
857 857
   elseif ($project_prefs) {
858 858
     $xml->loadXML($project_prefs, LIBXML_NOBLANKS);
859 859
     if ($errors = libxml_get_errors($xml)) {
860 860
       $lines = explode("\r", $project_prefs);
861
-      watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" .
862
-        ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR);
861
+      watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}".
862
+        ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR);
863 863
     }
864 864
   }
865 865
   if (!$errors) {
@@ -902,8 +902,8 @@  discard block
 block discarded – undo
902 902
     $xml = array(
903 903
       'error' => array(
904 904
         'error_num' => -112,
905
-        'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}" .
906
-        ': <br/>' . htmlentities($lines[$errors[0]->line - 1])
905
+        'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}".
906
+        ': <br/>'.htmlentities($lines[$errors[0]->line - 1])
907 907
       ),
908 908
     );
909 909
   }
@@ -1011,10 +1011,10 @@  discard block
 block discarded – undo
1011 1011
           'teaser' => $teaser,
1012 1012
           'uid' => $team_owner_uid,
1013 1013
           'path' => null,
1014
-          'status' => 1,  // published or not - always publish
1014
+          'status' => 1, // published or not - always publish
1015 1015
           'promote' => 0,
1016 1016
           'created' => $created_time,
1017
-          'comment' => 0,  // comments disabled
1017
+          'comment' => 0, // comments disabled
1018 1018
           'moderate' => 0,
1019 1019
           'sticky' => 0,
1020 1020
           'format' => $input_format
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
           module_load_include('inc', 'pathauto', 'pathauto');
1026 1026
           $node['path'] = pathauto_cleanstring($values['name']);
1027 1027
         
1028
-          $node = (object) $node; // node_save requires an object form
1028
+          $node = (object)$node; // node_save requires an object form
1029 1029
           $team_categories = taxonomy_get_term_by_name($values['type']);
1030 1030
           $node->taxonomy[] = $team_categories[0];
1031 1031
           
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
             if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) {
1206 1206
               $profile_node = node_load($profile_nid);
1207 1207
               if ($profile_node) {
1208
-                $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE);
1208
+                $avatar_image = get_cck_image_object(file_directory_path().'/'.$image_path, 'field_image', 'profile', TRUE);
1209 1209
                 if ($avatar_image) {
1210 1210
                   $profile_node->field_image[0] = $avatar_image;
1211 1211
                   node_save($profile_node);
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
         WHERE (n.status = 1) AND (c.uid = '%d')
1320 1320
         ORDER BY timestamp DESC
1321 1321
         LIMIT %d",
1322
-        $uid, (int) $count
1322
+        $uid, (int)$count
1323 1323
       );
1324 1324
       $xml = array(
1325 1325
         'rpc_response' => array(
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
         WHERE (n.status = 1) AND (n.uid = '%d')
1363 1363
         ORDER BY changed DESC
1364 1364
         LIMIT %d",
1365
-        $uid, (int) $count
1365
+        $uid, (int)$count
1366 1366
       );
1367 1367
       $xml = array(
1368 1368
         'rpc_response' => array(
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
           );
1526 1526
         }
1527 1527
         // Determine which page to display in order to show the given comment
1528
-        $page = floor($comment_offset / $comments_per_page);
1528
+        $page = floor($comment_offset/$comments_per_page);
1529 1529
         if ($page) {
1530 1530
           $params = array('page' => $page);
1531 1531
         }
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
  * Overview of moderation queues
1882 1882
  */               
1883 1883
 function boinccore_moderation_overview_panel() {
1884
-  $output = '<h2 class="pane-title">' . bts('Moderation') . '</h2>';
1884
+  $output = '<h2 class="pane-title">'.bts('Moderation').'</h2>';
1885 1885
   $output .= '<ul class="tab-list action-list">';
1886 1886
   if (module_exists('user_profiles')) {
1887 1887
     $profile_count = db_result(db_query("
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
     $output .= '<li class="tab primary">';
1893 1893
     $output .= l(bts('Unvetted profiles'), 'moderate/profiles');
1894 1894
     $output .= '<div class="item-count-wrapper">';
1895
-    $output .= '<span class="item-count">' . $profile_count . '</span>';
1895
+    $output .= '<span class="item-count">'.$profile_count.'</span>';
1896 1896
     $output .= '</div>';
1897 1897
     $output .= '</li>';
1898 1898
   }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinccore/boinccore.admin.inc 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
       break;
136 136
     default:
137 137
       end($page_list);
138
-      $page_list[key($page_list)] = 'and ' . $page_list[key($page_list)];
138
+      $page_list[key($page_list)] = 'and '.$page_list[key($page_list)];
139 139
       $page_list = implode(', ', $page_list);
140 140
     }
141 141
     drupal_set_message(t('Default content has been generated for the @listed
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         'type' => 'page',
190 190
         'title' => t('Help'),
191 191
         'uid' => 1,
192
-        'status' => 1,  // published
192
+        'status' => 1, // published
193 193
         'promote' => 0, // not promoted to front page
194 194
         'path' => 'help',
195 195
         'pathauto_perform_alias' => FALSE,
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         'format' => 4,
211 211
         //'teaser' => $teaser,
212 212
       );
213
-      $node = (object) $node; // node_save requires an object
213
+      $node = (object)$node; // node_save requires an object
214 214
       node_save($node);
215 215
       
216 216
       $item = array(
Please login to merge, or discard this patch.
sites/default/boinc/modules/comment_form_block/comment_form_block.module 1 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') . '</h2>';
22
+          $block['content'] = '<h2>'.bts('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.
sites/default/boinc/modules/flag_comment_notify/flag_comment_notify.module 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
   case 'insert':
31 31
     module_load_include('inc', 'drupal_queue', 'drupal_queue');
32 32
     $queue = DrupalQueue::get('flag_comment_notify');
33
-    $subscribed_users = array_keys((array) flag_get_content_flags('node', $a1['nid'], 'subscriptions'));
33
+    $subscribed_users = array_keys((array)flag_get_content_flags('node', $a1['nid'], 'subscriptions'));
34 34
     foreach ($subscribed_users as $uid) {
35
-      $queue->createItem(array('uid' => $uid, 'cid' => (int) $a1['cid']));
35
+      $queue->createItem(array('uid' => $uid, 'cid' => (int)$a1['cid']));
36 36
     }
37 37
     break;
38 38
   default:
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
   );
87 87
   $variables['!topic_name'] = $params['node']->title;
88 88
   $variables['!author'] = $params['author']->name;
89
-  switch($key) {
89
+  switch ($key) {
90 90
   case 'comment_posted':
91 91
     $message['subject'] = bts('!site: comment posted to "!topic_name"', $variables,
92 92
       $language->language);
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincimport/includes/import_team.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
   db_set_active('boinc');
27 27
   $boincteam = db_fetch_object(db_query('SELECT * FROM team WHERE id=%d', array($team_id)));
28 28
   $boincteam_members = db_query('SELECT id FROM user WHERE teamid=%d', array($team_id));
29
-  $boincteam_admin = (int) db_result(db_query('SELECT userid FROM team_admin WHERE teamid=%d', array($team_id)));
29
+  $boincteam_admin = (int)db_result(db_query('SELECT userid FROM team_admin WHERE teamid=%d', array($team_id)));
30 30
   db_set_active('default');
31 31
   
32 32
   $team_exists = db_query('SELECT team_id FROM {boincteam} WHERE team_id = %d', $boincteam->id);
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
       'teaser' => $teaser,
45 45
       'uid' => boincuser_lookup_uid($boincteam->userid),
46 46
       'path' => null,
47
-      'status' => 1,  // published or not - always publish
47
+      'status' => 1, // published or not - always publish
48 48
       'promote' => 0,
49 49
       'created' => $boincteam->create_time,
50
-      'comment' => 0,  // comments disabled
50
+      'comment' => 0, // comments disabled
51 51
       'moderate' => 0,
52 52
       'sticky' => 0,
53 53
       'format' => $input_format
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
       exit;
64 64
     }
65 65
     
66
-    $node = (object) $node; // node_save requires an object form
66
+    $node = (object)$node; // node_save requires an object form
67 67
     
68 68
     $node->taxonomy[] = taxonomy_get_term($team_type_tid);
69 69
     
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
   db_set_active('default');
82 82
   if ($boincteam_member_ids) {
83 83
     $team_members = db_query('SELECT uid FROM {boincuser} WHERE boinc_id IN(%s)', implode(',', $boincteam_member_ids));
84
-    $team_admin = (int) db_result(db_query('SELECT uid FROM {boincuser} WHERE boinc_id=%d', $boincteam_admin));
84
+    $team_admin = (int)db_result(db_query('SELECT uid FROM {boincuser} WHERE boinc_id=%d', $boincteam_admin));
85 85
     
86 86
     while ($drupal_user = db_fetch_object($team_members)) {
87 87
       // Add action to take on member accounts?
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincimport/boincimport.module 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
   $boinc_db_url = (is_array($db_url)) ? (isset($db_url['boinc']) ? $db_url['boinc'] : $db_url['default']) : $db_url;
106 106
   variable_set('boincimport_db_url', $boinc_db_url);
107 107
   variable_set('boincimport_ready', 0);
108
-  return '<p>'. t('The BOINC database URL has been reset. You may now <a href="@configlink">go back to the configuration page</a>.',
109
-      array('@configlink' => url('admin/boinc/import/settings'))) .'</p>';
108
+  return '<p>'.t('The BOINC database URL has been reset. You may now <a href="@configlink">go back to the configuration page</a>.',
109
+      array('@configlink' => url('admin/boinc/import/settings'))).'</p>';
110 110
 }
111 111
 
112 112
 /**
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
  */
115 115
 function boincimport_unlock() {
116 116
   variable_del('boincimport_process_locked');
117
-  return '<p>'. t('The BOINC data import process has been unlocked. You may
117
+  return '<p>'.t('The BOINC data import process has been unlocked. You may
118 118
     now !proceed_with_import.', array(
119 119
       '!proceed_with_import' => l(t('proceed with the import'),
120 120
         'admin/boinc/import/process')
121
-    )) .'</p>';
121
+    )).'</p>';
122 122
 }
123 123
 
124 124
 /**
125 125
  * Callback admin/boinc/import/cleanup
126 126
  */
127 127
 function boincimport_cleanup() {
128
-  return boincimport_process_cleanup() .'<p>'. t('Drupal database cleaned.') .'</p>';
128
+  return boincimport_process_cleanup().'<p>'.t('Drupal database cleaned.').'</p>';
129 129
 }
130 130
 
131 131
 /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
  * fails, the process will die() which is a bit too much since we only
139 139
  * want to test. Therefore, the test part of the code is not used, now.
140 140
  */
141
-function _boincimport_db_connect($test= 0) {
141
+function _boincimport_db_connect($test = 0) {
142 142
   global $db_url;
143 143
   $db_ready = variable_get('boincimport_db_configured', 1);
144 144
   if (!$db_ready) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
       $db_url2['default'] = $db_url;
149 149
     }
150 150
     $db_url2['boinc'] = variable_get('boincimport_db_url', $db_url);
151
-    $GLOBALS['db_url'] =& $db_url2;
151
+    $GLOBALS['db_url'] = & $db_url2;
152 152
     if ($test) {
153 153
       if (!db_connect($db_url2['boinc'])) {
154 154
         return 0;
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
   $result = module_exists($module);
172 172
   $out['result'] = $result;
173 173
   if ($result == 1) {
174
-    $out['html'] .= '<li>'. t('Module %module is enabled. OK!', array('%module' => $module)) .'</li>';
174
+    $out['html'] .= '<li>'.t('Module %module is enabled. OK!', array('%module' => $module)).'</li>';
175 175
   }
176 176
   else {
177
-    $out['html'] .= '<li><span class="marker">'. t('Module %module is disabled.', array('%module' => $module)) .'</span></li>';
177
+    $out['html'] .= '<li><span class="marker">'.t('Module %module is disabled.', array('%module' => $module)).'</span></li>';
178 178
   }
179 179
   $out['html'] .= '</ul>';
180 180
   return $out;
@@ -187,32 +187,32 @@  discard block
 block discarded – undo
187 187
  *   $out['html'] = formatted html.
188 188
  *   $out['result'] = boolean.
189 189
  */
190
-function _boincimport_check_tables($tables = array(), $db = 'default' , $prefix = 1) {
190
+function _boincimport_check_tables($tables = array(), $db = 'default', $prefix = 1) {
191 191
   _boincimport_db_connect();
192 192
 
193 193
   $out['html'] = '<ul>';
194
-  $out['result']= 1;
194
+  $out['result'] = 1;
195 195
   foreach ($tables as $table) {
196 196
     if ($prefix) {
197
-      $table = db_prefix_tables('{'. $table .'}');
197
+      $table = db_prefix_tables('{'.$table.'}');
198 198
     }  
199 199
 
200 200
     db_set_active($db);
201 201
     if ($GLOBALS['db_type'] == 'pgsql') {
202 202
       // adapt from db_table_exists in database.pgsql.inc
203
-      $result = (bool) db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '%s'", $table));
203
+      $result = (bool)db_result(db_query("SELECT COUNT(*) FROM pg_class WHERE relname = '%s'", $table));
204 204
     }
205 205
     else {
206 206
       // adapt from db_table_exists in database.mysql.inc
207
-      $result = (bool) db_fetch_object(db_query("SHOW TABLES LIKE '%s'", $table));
207
+      $result = (bool)db_fetch_object(db_query("SHOW TABLES LIKE '%s'", $table));
208 208
     }
209 209
     db_set_active('default');
210 210
     if ($result) {
211
-      $out['html'] .= '<li>'. t('Table %table: OK!', array('%table' => $table)) .'</li>';
211
+      $out['html'] .= '<li>'.t('Table %table: OK!', array('%table' => $table)).'</li>';
212 212
     }
213 213
     else {
214
-      $out['html'] .= '<li><span class="marker">'. t('Table <strong>%table</strong> does not exist!', array('%table' => $table)) .'</span></li>';
215
-      $out['result']= 0;
214
+      $out['html'] .= '<li><span class="marker">'.t('Table <strong>%table</strong> does not exist!', array('%table' => $table)).'</span></li>';
215
+      $out['result'] = 0;
216 216
     }
217 217
   }
218 218
   $out['html'] .= '</ul>';
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
   boinc_get_path();
227 227
   
228 228
   if (!variable_get('boincimport_ready', 0)) {
229
-    return '<p>'. t('You cannot import the data now. Please <a href="@settings">complete the setup first</a>', array('@settings' => url('admin/boinc/import/settings'))) .'</p>';
229
+    return '<p>'.t('You cannot import the data now. Please <a href="@settings">complete the setup first</a>', array('@settings' => url('admin/boinc/import/settings'))).'</p>';
230 230
   }
231 231
 
232 232
   $output = 'BOINC import process form';
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
 function boincimport_process_form() {
238 238
   $form = array();
239
-  _boincimport_db_connect() ;
239
+  _boincimport_db_connect();
240 240
   // Causes problems with form api redirect
241 241
   //ini_set('display_errors', TRUE);
242 242
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
       }
412 412
       else {
413 413
         drupal_set_message('Congratulations.  Import Finished');
414
-        drupal_set_message('Please visit the '. l('Post migration configuration', 'admin/boinc/import/post_configuration') .' page');
414
+        drupal_set_message('Please visit the '.l('Post migration configuration', 'admin/boinc/import/post_configuration').' page');
415 415
         watchdog('boincimport', 'Import process is complete', array(), WATCHDOG_INFO); 
416 416
         unset($_SESSION['boincimport_stage_selected']);
417 417
       }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
     $context['finished'] = 1;
633 633
   }
634 634
   else {
635
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
635
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
636 636
   }
637 637
 }
638 638
 
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
     // An error occurred.
662 662
     // $operations contains the operations that remained unprocessed.
663 663
     $error_operation = reset($operations);
664
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
664
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
665 665
   }
666 666
   drupal_set_message($message);
667 667
   
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
     $context['finished'] = 1;
846 846
   }
847 847
   else {
848
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
848
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
849 849
   }
850 850
 }
851 851
 
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
     // An error occurred.
873 873
     // $operations contains the operations that remained unprocessed.
874 874
     $error_operation = reset($operations);
875
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
875
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
876 876
   }
877 877
   drupal_set_message($message);
878 878
   
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
     $context['finished'] = 1;
1019 1019
   }
1020 1020
   else {
1021
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
1021
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
1022 1022
   }
1023 1023
 }
1024 1024
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
     // An error occurred.
1047 1047
     // $operations contains the operations that remained unprocessed.
1048 1048
     $error_operation = reset($operations);
1049
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
1049
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
1050 1050
   }
1051 1051
   drupal_set_message($message);
1052 1052
   
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
     $context['finished'] = 1;
1203 1203
   }
1204 1204
   else {
1205
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
1205
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
1206 1206
   }
1207 1207
 }
1208 1208
 
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
     // An error occurred.
1232 1232
     // $operations contains the operations that remained unprocessed.
1233 1233
     $error_operation = reset($operations);
1234
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
1234
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
1235 1235
   }
1236 1236
   drupal_set_message($message);
1237 1237
   
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
     $context['finished'] = 1;
1382 1382
   }
1383 1383
   else {
1384
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
1384
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
1385 1385
   }
1386 1386
 }
1387 1387
 
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
     // An error occurred.
1409 1409
     // $operations contains the operations that remained unprocessed.
1410 1410
     $error_operation = reset($operations);
1411
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
1411
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
1412 1412
   }
1413 1413
   drupal_set_message($message);
1414 1414
   
@@ -1709,7 +1709,7 @@  discard block
 block discarded – undo
1709 1709
     $context['finished'] = 1;
1710 1710
   }
1711 1711
   else {
1712
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
1712
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
1713 1713
   }
1714 1714
 }
1715 1715
 
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
     $context['finished'] = 1;
1788 1788
   }
1789 1789
   else {
1790
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
1790
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
1791 1791
   }
1792 1792
 }
1793 1793
 
@@ -1800,34 +1800,34 @@  discard block
 block discarded – undo
1800 1800
   $forum_perms = array();
1801 1801
   $role_map = array_flip(user_roles());
1802 1802
   $forum_perms[$role_map['anonymous user']] = array(
1803
-    'view' => (int) !$hidden,
1803
+    'view' => (int)!$hidden,
1804 1804
     'update' => 0,
1805 1805
     'delete' => 0,
1806 1806
     'create' => 0,
1807 1807
   );
1808 1808
   $forum_perms[$role_map['authenticated user']] = array(
1809
-    'view' => (int) !$hidden,
1809
+    'view' => (int)!$hidden,
1810 1810
     'update' => 0,
1811 1811
     'delete' => 0,
1812 1812
     'create' => 0,
1813 1813
   );
1814 1814
   $forum_perms[$role_map['community member']] = array(
1815
-    'view' => (int) !$hidden,
1815
+    'view' => (int)!$hidden,
1816 1816
     'update' => 0,
1817 1817
     'delete' => 0,
1818
-    'create' => (int) $open,
1818
+    'create' => (int)$open,
1819 1819
   );
1820 1820
   $forum_perms[$role_map['verified contributor']] = array(
1821
-    'view' => (int) !$hidden,
1821
+    'view' => (int)!$hidden,
1822 1822
     'update' => 0,
1823 1823
     'delete' => 0,
1824
-    'create' => (int) !$hidden,
1824
+    'create' => (int)!$hidden,
1825 1825
   );
1826 1826
   $forum_perms[$role_map['moderator']] = array(
1827
-    'view' => (int) !$hidden,
1828
-    'update' => (int) !$hidden,
1827
+    'view' => (int)!$hidden,
1828
+    'update' => (int)!$hidden,
1829 1829
     'delete' => 0,
1830
-    'create' => (int) !$hidden,
1830
+    'create' => (int)!$hidden,
1831 1831
   );
1832 1832
   $forum_perms[$role_map['administrator']] = array(
1833 1833
     'view' => 1,
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
     // An error occurred.
1893 1893
     // $operations contains the operations that remained unprocessed.
1894 1894
     $error_operation = reset($operations);
1895
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
1895
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
1896 1896
   }
1897 1897
   drupal_set_message($message);
1898 1898
   
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
   $batch_size = 100;
1963 1963
   
1964 1964
   // Create batches to process
1965
-  for ($offset = 0; $offset < $topic_count; $offset+=$batch_size) {
1965
+  for ($offset = 0; $offset < $topic_count; $offset += $batch_size) {
1966 1966
     $topics_per_batch = $batch_size;
1967 1967
     if ($offset + $batch_size > $topic_count) {
1968 1968
       $topics_per_batch = $topic_count - $offset;
@@ -2079,7 +2079,7 @@  discard block
 block discarded – undo
2079 2079
         'type' => $node_type,
2080 2080
         'title' => $topic->title,
2081 2081
         'uid' => $uid,
2082
-        'status' => ($topic->hidden) ? 0 : 1,  // published or not
2082
+        'status' => ($topic->hidden) ? 0 : 1, // published or not
2083 2083
         'promote' => $promote,
2084 2084
         'created' => $topic->create_time,
2085 2085
         'changed' => $topic->timestamp,
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
       $node['tid'] = $tid;
2094 2094
       
2095 2095
       // Save the topic node
2096
-      $node = (object) $node; // node_save requires an object form
2096
+      $node = (object)$node; // node_save requires an object form
2097 2097
       node_save($node);
2098 2098
       taxonomy_node_save($node, array($tid));
2099 2099
       $success = ($node->nid) ? TRUE : FALSE;
@@ -2156,7 +2156,7 @@  discard block
 block discarded – undo
2156 2156
       $context['finished'] = 1;
2157 2157
     }
2158 2158
     else {
2159
-      $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
2159
+      $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
2160 2160
     }
2161 2161
   }
2162 2162
 }
@@ -2194,7 +2194,7 @@  discard block
 block discarded – undo
2194 2194
     // An error occurred.
2195 2195
     // $operations contains the operations that remained unprocessed.
2196 2196
     $error_operation = reset($operations);
2197
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
2197
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
2198 2198
   }
2199 2199
   drupal_set_message($message);
2200 2200
   
@@ -2270,7 +2270,7 @@  discard block
 block discarded – undo
2270 2270
   $batch_size = 100;
2271 2271
   
2272 2272
   // Create batches to process
2273
-  for ($offset = 0; $offset < $topic_count; $offset+=$batch_size) {
2273
+  for ($offset = 0; $offset < $topic_count; $offset += $batch_size) {
2274 2274
     $topics_per_batch = $batch_size;
2275 2275
     if ($offset + $batch_size > $topic_count) {
2276 2276
       $topics_per_batch = $topic_count - $offset;
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
       $context['finished'] = 1;
2485 2485
     }
2486 2486
     else {
2487
-      $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
2487
+      $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
2488 2488
     }
2489 2489
   }
2490 2490
 }
@@ -2502,10 +2502,10 @@  discard block
 block discarded – undo
2502 2502
     $empty_posts = count($results['posts']['empty']);
2503 2503
     $failed_posts = count($results['posts']['failure']);
2504 2504
     $message = t(
2505
-      'Successfully imported @post_count posts in @topic_count topics ' .
2506
-      '(@skipped topics either had no replies or all replies were already imported, ' .
2507
-      '@duplicates posts were skipped as already imported, ' .
2508
-      '@empty_posts had no content, ' .
2505
+      'Successfully imported @post_count posts in @topic_count topics '.
2506
+      '(@skipped topics either had no replies or all replies were already imported, '.
2507
+      '@duplicates posts were skipped as already imported, '.
2508
+      '@empty_posts had no content, '.
2509 2509
       'and @error_posts encountered errors during import)',
2510 2510
       array(
2511 2511
         '@post_count' => $posts_imported,
@@ -2528,7 +2528,7 @@  discard block
 block discarded – undo
2528 2528
     // An error occurred.
2529 2529
     // $operations contains the operations that remained unprocessed.
2530 2530
     $error_operation = reset($operations);
2531
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
2531
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
2532 2532
   }
2533 2533
   drupal_set_message($message);
2534 2534
   
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
     $context['finished'] = 1;
2699 2699
   }
2700 2700
   else {
2701
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
2701
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
2702 2702
   }
2703 2703
 }
2704 2704
 
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
     // An error occurred.
2726 2726
     // $operations contains the operations that remained unprocessed.
2727 2727
     $error_operation = reset($operations);
2728
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
2728
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
2729 2729
   }
2730 2730
   drupal_set_message($message);
2731 2731
   
@@ -2907,7 +2907,7 @@  discard block
 block discarded – undo
2907 2907
         'type' => $node_type,
2908 2908
         'title' => $topic->title,
2909 2909
         'uid' => $uid,
2910
-        'status' => ($topic->hidden) ? 0 : 1,  // published or not
2910
+        'status' => ($topic->hidden) ? 0 : 1, // published or not
2911 2911
         'promote' => $promote,
2912 2912
         'created' => $topic->create_time,
2913 2913
         'changed' => $topic->timestamp,
@@ -2921,7 +2921,7 @@  discard block
 block discarded – undo
2921 2921
       );
2922 2922
       
2923 2923
       // Save the team topic node
2924
-      $node = (object) $node; // node_save requires an object form
2924
+      $node = (object)$node; // node_save requires an object form
2925 2925
       node_save($node);
2926 2926
 
2927 2927
       if ($node->nid) {
@@ -2967,7 +2967,7 @@  discard block
 block discarded – undo
2967 2967
     $context['finished'] = 1;
2968 2968
   }
2969 2969
   else {
2970
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
2970
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
2971 2971
   }
2972 2972
 }
2973 2973
 
@@ -2994,7 +2994,7 @@  discard block
 block discarded – undo
2994 2994
     // An error occurred.
2995 2995
     // $operations contains the operations that remained unprocessed.
2996 2996
     $error_operation = reset($operations);
2997
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
2997
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
2998 2998
   }
2999 2999
   drupal_set_message($message);
3000 3000
   
@@ -3249,7 +3249,7 @@  discard block
 block discarded – undo
3249 3249
     $context['finished'] = 1;
3250 3250
   }
3251 3251
   else {
3252
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
3252
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
3253 3253
   }
3254 3254
 }
3255 3255
 
@@ -3276,7 +3276,7 @@  discard block
 block discarded – undo
3276 3276
     // An error occurred.
3277 3277
     // $operations contains the operations that remained unprocessed.
3278 3278
     $error_operation = reset($operations);
3279
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
3279
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
3280 3280
   }
3281 3281
   drupal_set_message($message);
3282 3282
   
@@ -3398,7 +3398,7 @@  discard block
 block discarded – undo
3398 3398
     $context['finished'] = 1;
3399 3399
   }
3400 3400
   else {
3401
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
3401
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
3402 3402
   }
3403 3403
 }
3404 3404
 
@@ -3427,7 +3427,7 @@  discard block
 block discarded – undo
3427 3427
     // An error occurred.
3428 3428
     // $operations contains the operations that remained unprocessed.
3429 3429
     $error_operation = reset($operations);
3430
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
3430
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
3431 3431
   }
3432 3432
   drupal_set_message($message);
3433 3433
   
@@ -3503,7 +3503,7 @@  discard block
 block discarded – undo
3503 3503
   $batch_size = 100;
3504 3504
   
3505 3505
   // Create node batches to process
3506
-  for ($offset = 0; $offset < $node_count; $offset+=$batch_size) {
3506
+  for ($offset = 0; $offset < $node_count; $offset += $batch_size) {
3507 3507
     $nodes_per_batch = $batch_size;
3508 3508
     if ($offset + $batch_size > $node_count) {
3509 3509
       $nodes_per_batch = $node_count - $offset;
@@ -3515,7 +3515,7 @@  discard block
 block discarded – undo
3515 3515
     );
3516 3516
   }
3517 3517
   // Add comment batches
3518
-  for ($offset = 0; $offset < $comment_count; $offset+=$batch_size) {
3518
+  for ($offset = 0; $offset < $comment_count; $offset += $batch_size) {
3519 3519
     $comments_per_batch = $batch_size;
3520 3520
     if ($offset + $batch_size > $comment_count) {
3521 3521
       $comments_per_batch = $comment_count - $offset;
@@ -3527,7 +3527,7 @@  discard block
 block discarded – undo
3527 3527
     );
3528 3528
   }
3529 3529
   // And don't forget to process private messages
3530
-  for ($offset = 0; $offset < $pm_count; $offset+=$batch_size) {
3530
+  for ($offset = 0; $offset < $pm_count; $offset += $batch_size) {
3531 3531
     $messages_per_batch = $batch_size;
3532 3532
     if ($offset + $batch_size > $pm_count) {
3533 3533
       $messages_per_batch = $pm_count - $offset;
@@ -3616,7 +3616,7 @@  discard block
 block discarded – undo
3616 3616
       $context['finished'] = 1;
3617 3617
     }
3618 3618
     else {
3619
-      $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
3619
+      $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
3620 3620
     }
3621 3621
   }
3622 3622
 }
@@ -3680,7 +3680,7 @@  discard block
 block discarded – undo
3680 3680
       $context['finished'] = 1;
3681 3681
     }
3682 3682
     else {
3683
-      $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
3683
+      $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
3684 3684
     }
3685 3685
   }
3686 3686
 }
@@ -3743,7 +3743,7 @@  discard block
 block discarded – undo
3743 3743
       $context['finished'] = 1;
3744 3744
     }
3745 3745
     else {
3746
-      $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
3746
+      $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
3747 3747
     }
3748 3748
   }
3749 3749
 }
@@ -3812,7 +3812,7 @@  discard block
 block discarded – undo
3812 3812
     // An error occurred.
3813 3813
     // $operations contains the operations that remained unprocessed.
3814 3814
     $error_operation = reset($operations);
3815
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
3815
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
3816 3816
   }
3817 3817
   drupal_set_message($message);
3818 3818
   
@@ -3881,18 +3881,18 @@  discard block
 block discarded – undo
3881 3881
     $max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d', $edit['nid']));
3882 3882
     // Strip the "/" from the end of the thread.
3883 3883
     $max = rtrim($max, '/');
3884
-    $thread = int2vancode(vancode2int($max)+1) .'/';
3884
+    $thread = int2vancode(vancode2int($max) + 1).'/';
3885 3885
   } else {
3886 3886
     // This is comment with a parent comment: we increase the part of the thread
3887 3887
     // value at the proper depth.
3888 3888
     $parent = db_fetch_object(db_query('SELECT * FROM {comments} WHERE cid = %d', $edit['pid']));
3889 3889
     // Strip the "/" from the end of the parent thread.
3890
-    $parent->thread = (string) rtrim((string) $parent->thread, '/');
3890
+    $parent->thread = (string)rtrim((string)$parent->thread, '/');
3891 3891
     // Get the max value in _this_ thread.
3892 3892
     $max = db_result(db_query("SELECT MAX(thread) FROM {comments} WHERE thread LIKE '%s.%%' AND nid = %d", $parent->thread, $edit['nid']));
3893 3893
     if ($max == '') {
3894 3894
       // First child of this parent.
3895
-      $thread = $parent->thread .'.'. int2vancode(1) .'/';
3895
+      $thread = $parent->thread.'.'.int2vancode(1).'/';
3896 3896
     } else {
3897 3897
       // Strip the "/" at the end of the thread.
3898 3898
       $max = rtrim($max, '/');
@@ -3901,14 +3901,14 @@  discard block
 block discarded – undo
3901 3901
       $parent_depth = count(explode('.', $parent->thread));
3902 3902
       $last = $parts[$parent_depth];
3903 3903
       // Finally, build the thread field for this new comment.
3904
-      $thread = $parent->thread .'.'. int2vancode(vancode2int($last) + 1) .'/';
3904
+      $thread = $parent->thread.'.'.int2vancode(vancode2int($last) + 1).'/';
3905 3905
     }
3906 3906
   }
3907 3907
 
3908 3908
   $status = 0; // 1 - not published, 0 - published
3909 3909
   $format = variable_get('boincimport_input_format', 0);
3910 3910
   $score = 0; // 0 default value, comments get higher score depending on the author's roles
3911
-  $users = serialize(array(0 => 1));  // default value for everybody!!
3911
+  $users = serialize(array(0 => 1)); // default value for everybody!!
3912 3912
   
3913 3913
   if ($edit['uid'] === $user->uid) { // '===' because we want to modify anonymous users too
3914 3914
     $edit['name'] = $user->name;
@@ -3942,7 +3942,7 @@  discard block
 block discarded – undo
3942 3942
   // BBcode to normal html
3943 3943
   if (variable_get('boincimport_bbcode', 0)) {
3944 3944
     $input_format = variable_get('boincimport_input_format', 0);
3945
-    $text = bbcode_filter('process', 0 , $input_format, $text);
3945
+    $text = bbcode_filter('process', 0, $input_format, $text);
3946 3946
   }
3947 3947
   return $text;
3948 3948
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincimport/boincimport.pages.inc 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * Callback admin/boinc/import/settings
6 6
  */
7 7
 function boincimport_admin_settings() {
8
-  global $conf ;
8
+  global $conf;
9 9
   global $db_url;
10 10
   global $base_url;
11 11
   $stage = variable_get('boincimport_config_stage', 0); 
@@ -27,17 +27,17 @@  discard block
 block discarded – undo
27 27
     
28 28
   $output = '';
29 29
   if (!variable_get('boincimport_tested', 0)) {
30
-    $form['test']['#collapsed']= FALSE;
30
+    $form['test']['#collapsed'] = FALSE;
31 31
     $output = '<span class="marker">';
32 32
     $ready_for_migration = 0;
33 33
   }
34
-  $output .= '<p>' . t('The migration will modify and even destroy some data. You
34
+  $output .= '<p>'.t('The migration will modify and even destroy some data. You
35 35
     must test this module on a copy of your data first, several times if necessary.
36 36
     Only use this module on your live data when you are familiar with the procedure
37
-    and you\'re confident everything will run smoothly.') . '</p><p>' . t('Also, you
37
+    and you\'re confident everything will run smoothly.').'</p><p>'.t('Also, you
38 38
     should make a full backup of your database just prior to performing the
39 39
     migration on the live data. It is better to turn off both the BOINC site and the
40
-    Drupal site during the migration.') . '</p>';
40
+    Drupal site during the migration.').'</p>';
41 41
   if (!variable_get('boincimport_tested', 0)) {
42 42
     $output .= '</span>';
43 43
   }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
   
56 56
   // Where is BOINC data?
57 57
   $pre = variable_get('boincimport_table_prefix', '');
58
-  $tables = array($pre .'forum', $pre .'post', $pre .'thread', $pre .'user');
58
+  $tables = array($pre.'forum', $pre.'post', $pre.'thread', $pre.'user');
59 59
   $db = (is_array($db_url) AND isset($db_url['boinc'])) ? 'boinc' : 'default';
60 60
   $result = _boincimport_check_tables($tables, $db, 0);
61 61
   
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
     $default_db_url = is_array($db_url) ? end($db_url) : $db_url;
80 80
     $url = variable_get('boincimport_db_url', $default_db_url);
81 81
     if (!preg_match('{(mysql|pgsql):\/\/(.+):(.*?)@(.+)/(\w+)}i', $url)) {
82
-      $output = '<p class="marker">'. t('Set the address of the BOINC database
83
-        according to the following format:') . '<br /><pre>
82
+      $output = '<p class="marker">'.t('Set the address of the BOINC database
83
+        according to the following format:').'<br /><pre>
84 84
         mysql://boinc_username:boinc_password@localhost/boinc_database
85 85
         </pre></p>';
86 86
       $ready_for_migration = 0;
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
     );
99 99
   }
100 100
 
101
-  $output = '<p>' . t('Note that due to a limitation within Drupal core, we cannot
101
+  $output = '<p>'.t('Note that due to a limitation within Drupal core, we cannot
102 102
     import messages from one database type to another database type. E.g, we
103 103
     cannot import BOINC from a myqsl DB, to a postgresql DB. You need to import
104 104
     the data into the same type of database first (import all the BOINC data, as is,
105
-    from mysql to postgresql).') . '</p><p>' . t('If both BOINC and Drupal are on
105
+    from mysql to postgresql).').'</p><p>'.t('If both BOINC and Drupal are on
106 106
     postgresql, see !this_issue.', array('!this_issue' => l(t('this issue'),
107
-    'http://drupal.org/node/64877', array('attributes' => array('target' => '_blank'))))) . '</p>';
107
+    'http://drupal.org/node/64877', array('attributes' => array('target' => '_blank'))))).'</p>';
108 108
   $form['boinc_data']['note'] = array('#value' => $output);
109 109
   
110 110
   // BOINC table prefix
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
   $output = $result['html'];
122 122
   if ($result['result'] != 1) {
123 123
     $ready_for_migration = 0;
124
-    $form['boinc_data']['#collapsed']= FALSE;
124
+    $form['boinc_data']['#collapsed'] = FALSE;
125 125
     $output .= '<span class="marker">';
126 126
     $output .= t('Some tables couldn\'t be found. Are the database settings correct?
127 127
       Please correct the errors so that the BOINC tables can be accessed.');
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
     '#collapsible' => TRUE,
170 170
     '#collapsed' => TRUE
171 171
   );
172
-  $output = '<p>'. t('Select which !input_format should be used for the imported
172
+  $output = '<p>'.t('Select which !input_format should be used for the imported
173 173
     messages. It is highly-recommended that this value be left as it is, as the
174 174
     Full HTML and PHP code formats can be very dangerous!', 
175
-    array('!input_format' => l(t('input format'), 'admin/settings/filters'))) .'</p>';
175
+    array('!input_format' => l(t('input format'), 'admin/settings/filters'))).'</p>';
176 176
   $form['input']['intro'] = array('#value' => $output);
177 177
   
178 178
   $formats = db_query('SELECT format, name FROM {filter_formats}');
179 179
   while ($format = db_fetch_array($formats)) {
180
-    $input_formats[$format['format']]= $format['name'];
180
+    $input_formats[$format['format']] = $format['name'];
181 181
   }
182 182
   
183 183
   // By default, use the format named "Rich text"; fall back to Filtered HTML
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
   );
195 195
   if (!$input_format) {
196 196
     $ready_for_migration = 0;
197
-    $form['input']['#collapsed']= FALSE;
197
+    $form['input']['#collapsed'] = FALSE;
198 198
   }
199
-  $output = '<p><em>'. t('This setting will be applied to all posts and private
200
-    messages.') .'</em></p>';
199
+  $output = '<p><em>'.t('This setting will be applied to all posts and private
200
+    messages.').'</em></p>';
201 201
   $form['input']['result'] = array('#value' => $output);
202 202
   
203 203
   // BBcode settings
@@ -208,23 +208,23 @@  discard block
 block discarded – undo
208 208
     '#collapsed' => TRUE,
209 209
   );
210 210
   
211
-  $output = '<p>' . t('BOINC posts are often formatted in BBcode. During the
212
-    import process, BBcode can be handled in two diffent ways') . ':</p>';
213
-  $output .= '<ul><li>' . t('Leave the BBcode as is and use the !bbcode_module
211
+  $output = '<p>'.t('BOINC posts are often formatted in BBcode. During the
212
+    import process, BBcode can be handled in two diffent ways').':</p>';
213
+  $output .= '<ul><li>'.t('Leave the BBcode as is and use the !bbcode_module
214 214
     after the migration to filter the imported posts. In this case, the module
215 215
     is not required during the migration, but will need to be installed and
216 216
     configured later.',
217 217
     array('!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode',
218
-    array('attributes' => array('target' => '_blank'))))) . '</li>';
219
-  $output .= '<li>' . t('Filter the BBcode now and replace it with plain HTML.
218
+    array('attributes' => array('target' => '_blank'))))).'</li>';
219
+  $output .= '<li>'.t('Filter the BBcode now and replace it with plain HTML.
220 220
     The BBcode module will be required during the migration process, but can
221
-    be disabled afterwards.') . '</li></ul>';
222
-  $output .= '<p>' . t('An appropriate input filter should be chosen, as well,
221
+    be disabled afterwards.').'</li></ul>';
222
+  $output .= '<p>'.t('An appropriate input filter should be chosen, as well,
223 223
     as it will affect how the post is displayed. For example, if BBcode is
224 224
     removed and replaced by HTML, some HTML tags will be stripped by the
225 225
     "Filtered HTML" input format unless they are first added to the list of
226 226
     allowed tags in that format. See the !input_formats page.',
227
-    array('!input_formats' => l(t('input formats'), 'admin/settings/filters'))) . '</p>';
227
+    array('!input_formats' => l(t('input formats'), 'admin/settings/filters'))).'</p>';
228 228
     
229 229
   $form['bbcode']['intro'] = array('#value' => $output);
230 230
   $form['bbcode']['boincimport_bbcode'] = array(
@@ -254,28 +254,28 @@  discard block
 block discarded – undo
254 254
     $result = db_query($sql, $input_format);
255 255
     if (!db_result($result)) {
256 256
       $form['bbcode']['#collapsed'] = FALSE;
257
-      $output .= '<p class="marker">'. t('You need to !enable_bbcode_input and
257
+      $output .= '<p class="marker">'.t('You need to !enable_bbcode_input and
258 258
         then !configure_bbcode_options', array(
259 259
           '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
260
-          '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) .'</p>';
260
+          '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))).'</p>';
261 261
     }
262
-    $output .= '<p>'. t('For best results, !disable_all_options', 
263
-    array('!disable_all_options' => l(t('all four BBcode configure options should be disabled'), "admin/settings/filters/{$input_format}/configure"))) . '.</p>';
262
+    $output .= '<p>'.t('For best results, !disable_all_options', 
263
+    array('!disable_all_options' => l(t('all four BBcode configure options should be disabled'), "admin/settings/filters/{$input_format}/configure"))).'.</p>';
264 264
   } else {
265 265
     if ($bbcode_disabled) {
266 266
       $form['bbcode']['#collapsed'] = FALSE;
267
-      $output .= '<p>'. t('The !bbcode_module is recommended, but not required.
267
+      $output .= '<p>'.t('The !bbcode_module is recommended, but not required.
268 268
         You may !enable_bbcode after having installed it.', array(
269 269
           '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
270
-          '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules'))) .'</p>';
270
+          '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules'))).'</p>';
271 271
     }
272
-    $output .= '<p>' . t('Don\'t forget to !enable_bbcode_input and then !configure_bbcode_options.', array(
272
+    $output .= '<p>'.t('Don\'t forget to !enable_bbcode_input and then !configure_bbcode_options.', array(
273 273
       '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
274
-      '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) . '</p>';
275
-    $output .= '<p>' . t('You may want to enable it for other input formats, too.') . '</p>';
274
+      '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))).'</p>';
275
+    $output .= '<p>'.t('You may want to enable it for other input formats, too.').'</p>';
276 276
   }
277
-  $output .= '<p><em>'. t('This setting will be applied to all posts, private
278
-    messages and the users\' signature.') .'</em></p>';
277
+  $output .= '<p><em>'.t('This setting will be applied to all posts, private
278
+    messages and the users\' signature.').'</em></p>';
279 279
     
280 280
   $form['bbcode']['result'] = array('#value' => $output);
281 281
   
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     '#collapsed' => TRUE,
288 288
   );
289 289
   if (!variable_get('boincimport_base_url_boinc', 0)) {
290
-    $form['url_transforms']['#collapsed']= FALSE;
290
+    $form['url_transforms']['#collapsed'] = FALSE;
291 291
     $output = '<span class="marker">';
292 292
     $ready_for_migration = 0;
293 293
   }
@@ -320,11 +320,11 @@  discard block
 block discarded – undo
320 320
   );
321 321
   variable_set('boincimport_ready', $ready_for_migration);
322 322
   if ($ready_for_migration) {
323
-    $output = '<p>'. t('Check the settings above one more time. If everything
324
-      is ok, !proceed.', array('!proceed' => l(t('you can now proceed with the migration'), 'admin/boinc/import/process'))) .'</p>';
323
+    $output = '<p>'.t('Check the settings above one more time. If everything
324
+      is ok, !proceed.', array('!proceed' => l(t('you can now proceed with the migration'), 'admin/boinc/import/process'))).'</p>';
325 325
   } else {
326
-    $output = '<p class="marker">'. t('You are not ready for the migration yet.
327
-      Please check the settings above.') .'</p>';
326
+    $output = '<p class="marker">'.t('You are not ready for the migration yet.
327
+      Please check the settings above.').'</p>';
328 328
   }
329 329
   
330 330
   $form['migration']['info'] = array('#value' => $output);
@@ -335,23 +335,23 @@  discard block
 block discarded – undo
335 335
  * Callback admin/boinc/import/post_configuration
336 336
  */
337 337
 function boincimport_post_configuration() {
338
-  $output = '<p>'. t('This page will help to tie up any loose ends following
338
+  $output = '<p>'.t('This page will help to tie up any loose ends following
339 339
     the BOINC data import process. Before continuing, it may be best to have
340
-    already:') .'</p>';
340
+    already:').'</p>';
341 341
   $output .= '<ul>';
342
-  $output .= '<li>'. t('Imported users, teams, and forums using the BOINC
343
-    import module') .'</li>';
344
-  $output .= '<li>'. t('Imported any additional data using add on modules if
345
-    available.') .'</li>';
342
+  $output .= '<li>'.t('Imported users, teams, and forums using the BOINC
343
+    import module').'</li>';
344
+  $output .= '<li>'.t('Imported any additional data using add on modules if
345
+    available.').'</li>';
346 346
   $output .= '</ul>';
347 347
   //User Set up
348
-  $output .= '<h2>'. t('User settings') .'</h2>';  
349
-  $output .= '<p>'. t('Make sure your !user_settings are correct. Specifically,
348
+  $output .= '<h2>'.t('User settings').'</h2>';  
349
+  $output .= '<p>'.t('Make sure your !user_settings are correct. Specifically,
350 350
     you can enable or disable signatures there. ', array(
351 351
       '!user_settings' => l(t('user settings'), 'admin/user/settings')
352
-    )) .'</p>'; 
353
-  $output .= '<p>' . t('Note that avatar/picture support is not tied to user
354
-    settings Picture support at this time.') . '</p>';
352
+    )).'</p>'; 
353
+  $output .= '<p>'.t('Note that avatar/picture support is not tied to user
354
+    settings Picture support at this time.').'</p>';
355 355
   /*$output .= '<p>' . t('In order to activate avatar/picture support, you need to
356 356
     enable pictures on this page and also:') . '</p>';
357 357
   $output .= '<ul>';
@@ -366,15 +366,15 @@  discard block
 block discarded – undo
366 366
   $output .= '</ul>'; */
367 367
   
368 368
   // Forum Set up
369
-  $output .= '<h2>'. t('Forum settings') .'</h2>';
370
-  $output .= '<p>'. t('Check any additional changes to make on the
369
+  $output .= '<h2>'.t('Forum settings').'</h2>';
370
+  $output .= '<p>'.t('Check any additional changes to make on the
371 371
     !forum_settings page.', array(
372 372
       '!forum_settings' =>  l(t('forum settings'), 'admin/content/forum/settings')
373
-    )) .'</p>';
374
-  $output .= '<p>'. t('It also may be a good idea to look at the !forum_list to
373
+    )).'</p>';
374
+  $output .= '<p>'.t('It also may be a good idea to look at the !forum_list to
375 375
     verify that all necessary containers and forums are in place.', array(
376 376
       '!forum_list' =>  l(t('forum list'), 'admin/content/forum')
377
-    )) .'</p>';
377
+    )).'</p>';
378 378
   /*$output .= '<p>'. t('If need be, set up the private forums as explained in the
379 379
     !documentation.', array(
380 380
       '!documentation' => l(t('documentation'), 'http://drupal.org/node/58969', array('attributes' => array('target' => '_blank')))
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
   // BBcode
391 391
   $bbcode = variable_get('boincimport_bbcode', 0);
392 392
   if ($bbcode) {
393
-    $output .= '<h2>'. t('Remove BBcode module') .'</h2>';
394
-    $output .= '<p>'. t('The BBcode has been cleaned from the posts. You shouldn\'t
395
-      need the bbcode module anymore. You can disable it.') .'</p>';
393
+    $output .= '<h2>'.t('Remove BBcode module').'</h2>';
394
+    $output .= '<p>'.t('The BBcode has been cleaned from the posts. You shouldn\'t
395
+      need the bbcode module anymore. You can disable it.').'</p>';
396 396
   } else {
397
-    $output .= '<h2>'. t('Configure BBcode module') .'</h2>';
398
-    $output .= '<p>'. t('Most likely, there are many BOINC forum postings
397
+    $output .= '<h2>'.t('Configure BBcode module').'</h2>';
398
+    $output .= '<p>'.t('Most likely, there are many BOINC forum postings
399 399
       formatted in BBcode. It would be a good idea to verify that BBcode is
400 400
       being formatted correctly in the imported posts. Have a look around
401 401
       !the_forum.', array(
402 402
         '!the_forum' =>  l(t('the forum'), 'community')
403
-      )) . '</p>';
403
+      )).'</p>';
404 404
   }
405 405
 
406 406
   return $output;
@@ -445,11 +445,11 @@  discard block
 block discarded – undo
445 445
   $output .= '</ol>';
446 446
 
447 447
   // process will die() if the link to the BOINC database is wrong:
448
-  $output .= '<p>'. t('If the BOINC data is in another database, but you made a
448
+  $output .= '<p>'.t('If the BOINC data is in another database, but you made a
449 449
     mistake while setting up the data base url, you may be unable to access the
450 450
     setting page due to some limitations of the core of Drupal. !reset_db_url.', array(
451 451
       '!reset_db_url' => l(t('Click here to reset the database url'), 'admin/boinc/import/reset')
452
-    )) .'</p>';
452
+    )).'</p>';
453 453
 
454 454
   return $output;
455 455
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
   // In Drupal 7, these operation cases will all exist as their own hooks,
80 80
   // so let's approximate that here so that this function can simply be removed
81 81
   // upon migration to 7
82
-  switch($op) {
82
+  switch ($op) {
83 83
   case 'update':
84 84
     boinctranslate_node_update($node);
85 85
     break;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
  * is updated (forward compatible to Drupal 7)
97 97
  */
98 98
 function boinctranslate_node_update($node) {
99
-  switch($node->type) {
99
+  switch ($node->type) {
100 100
   case 'page':
101 101
     // Add page content to translation table
102 102
     $textgroup = 'project';
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
  * is viewed (forward compatible to Drupal 7)
171 171
  */
172 172
 function boinctranslate_node_view($node, $view_mode, $langcode) {
173
-  switch($node->type) {
173
+  switch ($node->type) {
174 174
   case 'page':
175 175
     // Replace the node body with translated content, if available
176 176
     $node->content['body']['#value'] = bts(
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
  */
210 210
 function boinctranslate_initialize_languages() {
211 211
 
212
-  require_once(getcwd() . '/includes/locale.inc');
212
+  require_once(getcwd().'/includes/locale.inc');
213 213
   
214 214
   $api_base_url = 'https://www.transifex.com/api/2';
215 215
   $project_name = variable_get(
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
           }
341 341
         }
342 342
         if ($disabled_languages) {
343
-          drupal_set_message('The following languages were not found in Transifex and were disabled: ' . implode(' ', $disabled_languages));
343
+          drupal_set_message('The following languages were not found in Transifex and were disabled: '.implode(' ', $disabled_languages));
344 344
         }
345 345
         if ($process_batches) {
346 346
           $batch = array(
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
  *
390 390
  */
391 391
 function boinctranslate_export_translations() {
392
-  require_once(getcwd() . '/includes/locale.inc');
392
+  require_once(getcwd().'/includes/locale.inc');
393 393
   $project_name = variable_get(
394 394
     'boinc_translate_transifex_project_name', ''
395 395
   );
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
  *
492 492
  */
493 493
 function boinctranslate_update_official_boinc_translations() {
494
-  require_once(getcwd() . '/includes/locale.inc');
494
+  require_once(getcwd().'/includes/locale.inc');
495 495
   $project_name = variable_get(
496 496
     'boinc_translate_transifex_standard_name', ''
497 497
   );
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
   
600 600
   $url = "{$api_base_url}/{$path}";
601 601
   $headers = array(
602
-    'Authorization' => 'Basic ' . base64_encode($username . ":" . $password),
602
+    'Authorization' => 'Basic '.base64_encode($username.":".$password),
603 603
   );
604 604
   $data = NULL;
605 605
   
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
       return json_decode($response->data, TRUE);
628 628
     }
629 629
     else {
630
-      return (string) $response->data;
630
+      return (string)$response->data;
631 631
     }
632 632
     break;
633 633
   case 404:
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
  */
651 651
 function boinctranslate_get_po($langcode, $type = 'standard') {
652 652
 
653
-  require_once(getcwd() . '/includes/locale.inc');
653
+  require_once(getcwd().'/includes/locale.inc');
654 654
   
655 655
   $all_languages = language_list();
656 656
   $language = $langcode ? $all_languages[$langcode] : NULL;
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
  */
710 710
 function boinctranslate_export_po_generate($language = NULL, $strings = array(), $header = NULL, $type = NULL) {
711 711
 
712
-  require_once(getcwd() . '/includes/locale.inc');
712
+  require_once(getcwd().'/includes/locale.inc');
713 713
   global $user;
714 714
 
715 715
   // unset $language to indicate template creation
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
       $header = "# BOINC drupal localization template\n";
726 726
       $header .= "# Copyright (C) ".date("Y")." University of California\n";
727 727
     }
728
-    $header .= '# Generated by ' . $user->name . ' <' . $user->mail . ">\n";
728
+    $header .= '# Generated by '.$user->name.' <'.$user->mail.">\n";
729 729
     $header .= "#\n";
730 730
     $header .= "# This file is distributed under the same license as BOINC.\n";
731 731
     $header .= "#\n";
@@ -737,9 +737,9 @@  discard block
 block discarded – undo
737 737
       $header .= "\"Project-Id-Version: BOINC unknown\\n\"\n"; // TODO: add SHA1 of source checkout here
738 738
     }
739 739
     $header .= "\"Report-Msgid-Bugs-To: BOINC translation team <[email protected]>\\n\"\n";
740
-    $header .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n";
740
+    $header .= "\"POT-Creation-Date: ".date("Y-m-d H:iO")."\\n\"\n";
741 741
     if (isset($language)) {
742
-      $header .= "\"PO-Revision-Date: " . date("Y-m-d H:iO") . "\\n\"\n";
742
+      $header .= "\"PO-Revision-Date: ".date("Y-m-d H:iO")."\\n\"\n";
743 743
     }
744 744
     $header .= "\"Last-Translator: Generated automatically from Drupal translate interface\\n\"\n";
745 745
     $header .= "\"MIME-Version: 1.0\\n\"\n";
@@ -748,31 +748,31 @@  discard block
 block discarded – undo
748 748
     if (isset($language)) {
749 749
       $header .= "\"Language: ".$language->language."\\n\"";
750 750
       if ($language->formula && $language->plurals) {
751
-        $header .= "\"Plural-Forms: nplurals=" . $language->plurals . "; plural=" . strtr($language->formula, array('$' => '')) . ";\\n\"\n";
751
+        $header .= "\"Plural-Forms: nplurals=".$language->plurals."; plural=".strtr($language->formula, array('$' => '')).";\\n\"\n";
752 752
       }
753 753
     }
754 754
     $header .= "\"X-Poedit-SourceCharset: utf-8\\n\"\n";
755 755
   }
756 756
 
757
-  $output = $header . "\n";
757
+  $output = $header."\n";
758 758
 
759 759
   foreach ($strings as $lid => $string) {
760 760
     // Only process non-children, children are output below their parent.
761 761
     if (!isset($string['child'])) {
762 762
       if ($string['comment']) {
763
-        $output .= '#: ' . $string['comment'] . "\n";
763
+        $output .= '#: '.$string['comment']."\n";
764 764
       }
765 765
       if ($string['context']) {
766
-        $output .= 'msgctxt "' . $string['context'] . "\"\n";
766
+        $output .= 'msgctxt "'.$string['context']."\"\n";
767 767
       }
768
-      $output .= 'msgid ' . _locale_export_string($string['source']);
768
+      $output .= 'msgid '._locale_export_string($string['source']);
769 769
       if (!empty($string['plural'])) {
770 770
         $plural = $string['plural'];
771
-        $output .= 'msgid_plural ' . _locale_export_string($strings[$plural]['source']);
771
+        $output .= 'msgid_plural '._locale_export_string($strings[$plural]['source']);
772 772
         if (isset($language)) {
773 773
           $translation = $string['translation'];
774 774
           for ($i = 0; $i < $language->plurals; $i++) {
775
-            $output .= 'msgstr[' . $i . '] ' . _locale_export_string($translation);
775
+            $output .= 'msgstr['.$i.'] '._locale_export_string($translation);
776 776
             if ($plural) {
777 777
               $translation = _locale_export_remove_plural($strings[$plural]['translation']);
778 778
               $plural = isset($strings[$plural]['plural']) ? $strings[$plural]['plural'] : 0;
@@ -783,12 +783,12 @@  discard block
 block discarded – undo
783 783
           }
784 784
         }
785 785
         else {
786
-          $output .= 'msgstr[0] ""' . "\n";
787
-          $output .= 'msgstr[1] ""' . "\n";
786
+          $output .= 'msgstr[0] ""'."\n";
787
+          $output .= 'msgstr[1] ""'."\n";
788 788
         }
789 789
       }
790 790
       else {
791
-        $output .= 'msgstr ' . _locale_export_string($string['translation']);
791
+        $output .= 'msgstr '._locale_export_string($string['translation']);
792 792
       }
793 793
       $output .= "\n";
794 794
     }
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
  *
801 801
  */
802 802
 function boinctranslate_refresh_translations() {
803
-  require_once(getcwd() . '/includes/locale.inc');
803
+  require_once(getcwd().'/includes/locale.inc');
804 804
   $errors = array();
805 805
   $languages = locale_language_list();
806 806
   $translation_resources = array();
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
       ),
848 848
     );
849 849
     // Be sure any strings from the override file are added to the boinc group
850
-    $override_file = './' . drupal_get_path('module', 'boinctranslate') . '/includes/other-boinc-translation-strings.txt';
850
+    $override_file = './'.drupal_get_path('module', 'boinctranslate').'/includes/other-boinc-translation-strings.txt';
851 851
     $other_strings = file($override_file);
852 852
     if ($other_strings) {
853 853
       foreach ($other_strings as $string) {
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
  */
915 915
 function boinctranslate_refresh_translations_op($project, $resource, $langcode, $language, $textgroups, $debug_mode, &$context) {
916 916
   
917
-  require_once(getcwd() . '/includes/locale.inc');
917
+  require_once(getcwd().'/includes/locale.inc');
918 918
   
919 919
   if ($debug_mode) {
920 920
     watchdog(
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
         $file->filename = basename($file->filepath);
946 946
         if (!$file->filepath) {
947 947
           $message = 'Unable to create temporary file in '
948
-            . file_directory_temp() . " for {$language} translation "
948
+            . file_directory_temp()." for {$language} translation "
949 949
             . "resource {$project}:{$resource}";
950 950
         }
951 951
         
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
     $context['finished'] = 1;
1024 1024
   }
1025 1025
   else {
1026
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
1026
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
1027 1027
   }
1028 1028
 }
1029 1029
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
     // An error occurred.
1047 1047
     // $operations contains the operations that remained unprocessed.
1048 1048
     $error_operation = reset($operations);
1049
-    $message = 'An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE);
1049
+    $message = 'An error occurred while processing '.$error_operation[0].' with arguments :'.print_r($error_operation[0], TRUE);
1050 1050
     watchdog(
1051 1051
       'boinctranslate',
1052 1052
       $message,
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
     @set_time_limit(240);
1068 1068
   }
1069 1069
 
1070
-  require_once(getcwd() . '/includes/locale.inc');
1070
+  require_once(getcwd().'/includes/locale.inc');
1071 1071
   
1072 1072
   // Check if we have the language already in the database.
1073 1073
   if (!db_fetch_object(db_query("SELECT language FROM {languages} WHERE language = '%s'", $langcode))) {
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
  */
1110 1110
 function _boinctranslate_locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = 'default') {
1111 1111
 
1112
-  require_once(getcwd() . '/includes/locale.inc');
1112
+  require_once(getcwd().'/includes/locale.inc');
1113 1113
   
1114 1114
   $fd = fopen($file->filepath, "rb"); // File will get closed by PHP on return
1115 1115
   if (!$fd) {
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
   $lineno = 0; // Current line
1130 1130
 
1131 1131
   while (!feof($fd)) {
1132
-    $line = fgets($fd, 10 * 1024); // A line should not be this long
1132
+    $line = fgets($fd, 10*1024); // A line should not be this long
1133 1133
     if ($lineno == 0) {
1134 1134
       // The first line might come with a UTF-8 BOM, which should be removed.
1135 1135
       $line = str_replace("\xEF\xBB\xBF", '', $line);
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
1212 1212
         return FALSE;
1213 1213
       }
1214
-      $current["msgid"] = $current["msgid"] . "\0" . $quoted;
1214
+      $current["msgid"] = $current["msgid"]."\0".$quoted;
1215 1215
       $context = "MSGID_PLURAL";
1216 1216
     }
1217 1217
     elseif (!strncmp("msgid", $line, 5)) {
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
  */
1365 1365
 function _boinctranslate_locale_import_one_string($op, $value = NULL, $mode = NULL, $lang = NULL, $file = NULL, $group = 'default') {
1366 1366
   
1367
-  require_once(getcwd() . '/includes/locale.inc');
1367
+  require_once(getcwd().'/includes/locale.inc');
1368 1368
   
1369 1369
   static $report = array(
1370 1370
     'additions' => 0,
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
       // Don't update location, that just makes Drupal add the same strings
1467 1467
       // over and over
1468 1468
       //db_query("UPDATE {locales_source} SET location = '%s' WHERE lid = %d", $location, $lid);
1469
-      $exists = (bool) db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode));
1469
+      $exists = (bool)db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode));
1470 1470
       if (!$exists) {
1471 1471
         // No translation in this language.
1472 1472
         db_query("INSERT INTO {locales_target} (lid, language, translation, plid, plural) VALUES (%d, '%s', '%s', %d, %d)", $lid, $langcode, $translation, $plid, $plural);
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
     }
1491 1491
   }
1492 1492
   elseif ($mode == LOCALE_IMPORT_OVERWRITE AND $lid) {
1493
-    $exists = (bool) db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode));
1493
+    $exists = (bool)db_result(db_query("SELECT lid FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $langcode));
1494 1494
     if ($exists) {
1495 1495
       // Empty translation, remove existing if instructed.
1496 1496
       db_query("DELETE FROM {locales_target} WHERE language = '%s' AND lid = %d AND plid = %d AND plural = %d", $langcode, $lid, $plid, $plural);
Please login to merge, or discard this patch.