Passed
Pull Request — master (#2921)
by Christian
11:20
created
drupal/sites/default/boinc/modules/contrib/flag/flag.module 1 patch
Switch Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
  */
166 166
 function flag_help($path, $arg) {
167 167
   switch ($path) {
168
-    case FLAG_ADMIN_PATH:
169
-      $output = '<p>' . t('This page lists all the <em>flags</em> that are currently defined on this system. You may <a href="@add-url">add new flags</a>.', array('@add-url' => url(FLAG_ADMIN_PATH . '/add'))) . '</p>';
170
-      return $output;
168
+  case FLAG_ADMIN_PATH:
169
+    $output = '<p>' . t('This page lists all the <em>flags</em> that are currently defined on this system. You may <a href="@add-url">add new flags</a>.', array('@add-url' => url(FLAG_ADMIN_PATH . '/add'))) . '</p>';
170
+    return $output;
171 171
   }
172 172
 }
173 173
 
@@ -433,57 +433,57 @@  discard block
 block discarded – undo
433 433
 function flag_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
434 434
   global $user;
435 435
   switch ($op) {
436
-    case 'update':
437
-    case 'insert':
438
-      // Response to the flag checkboxes added to the form in flag_form_alter().
439
-      $remembered = FALSE;
440
-      if (isset($node->flag)) {
441
-        foreach ($node->flag as $name => $state) {
442
-          $flag = flag_get_flag($name);
443
-          // Flagging may trigger actions. We want actions to get the current
444
-          // node, not a stale database-loaded one:
445
-          if (!$remembered) {
446
-            $flag->remember_content($node->nid, $node);
447
-            // Actions may modify a node, and we don't want to overwrite this
448
-            // modification:
449
-            $remembered = TRUE;
450
-          }
451
-          flag($state ? 'flag' : 'unflag', $name, $node->nid, $user);
436
+  case 'update':
437
+  case 'insert':
438
+    // Response to the flag checkboxes added to the form in flag_form_alter().
439
+    $remembered = FALSE;
440
+    if (isset($node->flag)) {
441
+      foreach ($node->flag as $name => $state) {
442
+        $flag = flag_get_flag($name);
443
+        // Flagging may trigger actions. We want actions to get the current
444
+        // node, not a stale database-loaded one:
445
+        if (!$remembered) {
446
+          $flag->remember_content($node->nid, $node);
447
+          // Actions may modify a node, and we don't want to overwrite this
448
+          // modification:
449
+          $remembered = TRUE;
452 450
         }
451
+        flag($state ? 'flag' : 'unflag', $name, $node->nid, $user);
453 452
       }
454
-      break;
455
-    case 'delete':
456
-      foreach (flag_get_flags('node') as $flag) {
457
-        // If the flag is being tracked by translation set and the node is part
458
-        // of a translation set, don't delete the flagging record.
459
-        // Instead, data will be updated in the 'translation_change' op, below.
460
-        if (!$flag->i18n || empty($node->tnid)) {
461
-          db_query("DELETE FROM {flag_content} WHERE fid = %d AND content_id = %d", $flag->fid, $node->nid);
462
-          db_query("DELETE FROM {flag_counts} WHERE fid = %d AND content_id = %d", $flag->fid, $node->nid);
463
-
464
-          // Delete comments.
465
-          db_query("DELETE FROM {flag_content}
453
+    }
454
+    break;
455
+  case 'delete':
456
+    foreach (flag_get_flags('node') as $flag) {
457
+      // If the flag is being tracked by translation set and the node is part
458
+      // of a translation set, don't delete the flagging record.
459
+      // Instead, data will be updated in the 'translation_change' op, below.
460
+      if (!$flag->i18n || empty($node->tnid)) {
461
+        db_query("DELETE FROM {flag_content} WHERE fid = %d AND content_id = %d", $flag->fid, $node->nid);
462
+        db_query("DELETE FROM {flag_counts} WHERE fid = %d AND content_id = %d", $flag->fid, $node->nid);
463
+
464
+        // Delete comments.
465
+        db_query("DELETE FROM {flag_content}
466 466
                      WHERE content_type = 'comment'
467 467
                        AND content_id IN(
468 468
                     SELECT cid
469 469
                       FROM {comments}
470 470
                      WHERE nid = %d)", $node->nid);
471
-        }
472 471
       }
473
-      break;
474
-    case 'translation_change':
475
-      if (isset($node->translation_change)) {
476
-        // If there is only one node remaining, track by nid rather than tnid.
477
-        // Otherwise, use the new tnid.
478
-        $content_id = $node->translation_change['new_tnid'] == 0 ? $node->translation_change['remaining_nid'] : $node->translation_change['new_tnid'];
479
-        foreach (flag_get_flags('node') as $flag) {
480
-          if ($flag->i18n) {
481
-            db_query("UPDATE {flag_content} SET content_id = %d WHERE fid = %d AND content_id = %d", $content_id, $flag->fid, $node->translation_change['old_tnid']);
482
-            db_query("UPDATE {flag_counts} SET content_id = %d WHERE fid = %d AND content_id = %d", $content_id, $flag->fid, $node->translation_change['old_tnid']);
483
-          }
472
+    }
473
+    break;
474
+  case 'translation_change':
475
+    if (isset($node->translation_change)) {
476
+      // If there is only one node remaining, track by nid rather than tnid.
477
+      // Otherwise, use the new tnid.
478
+      $content_id = $node->translation_change['new_tnid'] == 0 ? $node->translation_change['remaining_nid'] : $node->translation_change['new_tnid'];
479
+      foreach (flag_get_flags('node') as $flag) {
480
+        if ($flag->i18n) {
481
+          db_query("UPDATE {flag_content} SET content_id = %d WHERE fid = %d AND content_id = %d", $content_id, $flag->fid, $node->translation_change['old_tnid']);
482
+          db_query("UPDATE {flag_counts} SET content_id = %d WHERE fid = %d AND content_id = %d", $content_id, $flag->fid, $node->translation_change['old_tnid']);
484 483
         }
485 484
       }
486
-      break;
485
+    }
486
+    break;
487 487
   }
488 488
 }
489 489
 
@@ -492,74 +492,74 @@  discard block
 block discarded – undo
492 492
  */
493 493
 function flag_user($op, &$edit, &$account, $category = NULL) {
494 494
   switch ($op) {
495
-    case 'login':
496
-      // Migrate anonymous flags to this user's account.
497
-      if (module_exists('session_api') && ($sid = flag_get_sid(0))) {
498
-        // The @ symbol suppresses errors if the user flags a piece of content
499
-        // they have already flagged as a logged-in user.
500
-        @db_query("UPDATE {flag_content} SET uid = %d, sid = 0 WHERE uid = 0 AND sid = %d", $account->uid, $sid);
501
-
502
-        // Delete any remaining flags this user had as an anonymous user. We use the
503
-        // proper unflag action here to make sure the count gets decremented again
504
-        // and so that other modules can clean up their tables if needed.
505
-        $result = db_query("SELECT fcid, fid, content_id FROM {flag_content} WHERE uid = 0 AND sid = %d", $sid);
506
-        $anonymous_user = drupal_anonymous_user();
507
-        while ($row = db_fetch_array($result)) {
508
-          $flag = flag_get_flag(NULL, $row['fid']);
509
-          $flag->flag('unflag', $row['content_id'], $anonymous_user, TRUE);
510
-        }
495
+  case 'login':
496
+    // Migrate anonymous flags to this user's account.
497
+    if (module_exists('session_api') && ($sid = flag_get_sid(0))) {
498
+      // The @ symbol suppresses errors if the user flags a piece of content
499
+      // they have already flagged as a logged-in user.
500
+      @db_query("UPDATE {flag_content} SET uid = %d, sid = 0 WHERE uid = 0 AND sid = %d", $account->uid, $sid);
501
+
502
+      // Delete any remaining flags this user had as an anonymous user. We use the
503
+      // proper unflag action here to make sure the count gets decremented again
504
+      // and so that other modules can clean up their tables if needed.
505
+      $result = db_query("SELECT fcid, fid, content_id FROM {flag_content} WHERE uid = 0 AND sid = %d", $sid);
506
+      $anonymous_user = drupal_anonymous_user();
507
+      while ($row = db_fetch_array($result)) {
508
+        $flag = flag_get_flag(NULL, $row['fid']);
509
+        $flag->flag('unflag', $row['content_id'], $anonymous_user, TRUE);
510
+      }
511 511
 
512
-        // Clean up anonymous cookies.
513
-        FlagCookieStorage::drop();
512
+      // Clean up anonymous cookies.
513
+      FlagCookieStorage::drop();
514
+    }
515
+    break;
516
+  case 'delete':
517
+    // Remove flags by this user.
518
+    $result = db_query("SELECT fc.fid, fc.content_id, c.count FROM {flag_content} fc LEFT JOIN {flag_counts} c ON fc.content_id = c.content_id AND fc.content_type = c.content_type WHERE fc.uid = %d", $account->uid);
519
+    while ($flag_data = db_fetch_object($result)) {
520
+      $flag_data->count--;
521
+      // Only decrement the flag count table if it's greater than 1.
522
+      if ($flag_data->count > 0) {
523
+        db_query("UPDATE {flag_counts} SET count = %d WHERE fid = %d AND content_id = %d", $flag_data->count, $flag_data->fid, $flag_data->content_id);
514 524
       }
515
-      break;
516
-    case 'delete':
517
-      // Remove flags by this user.
518
-      $result = db_query("SELECT fc.fid, fc.content_id, c.count FROM {flag_content} fc LEFT JOIN {flag_counts} c ON fc.content_id = c.content_id AND fc.content_type = c.content_type WHERE fc.uid = %d", $account->uid);
519
-      while ($flag_data = db_fetch_object($result)) {
520
-        $flag_data->count--;
521
-        // Only decrement the flag count table if it's greater than 1.
522
-        if ($flag_data->count > 0) {
523
-          db_query("UPDATE {flag_counts} SET count = %d WHERE fid = %d AND content_id = %d", $flag_data->count, $flag_data->fid, $flag_data->content_id);
524
-        }
525
-        elseif ($flag_data->count == 0) {
526
-          db_query("DELETE FROM {flag_counts} WHERE fid = %d AND content_id = %d", $flag_data->fid, $flag_data->content_id);
527
-        }
525
+      elseif ($flag_data->count == 0) {
526
+        db_query("DELETE FROM {flag_counts} WHERE fid = %d AND content_id = %d", $flag_data->fid, $flag_data->content_id);
528 527
       }
529
-      db_query("DELETE FROM {flag_content} WHERE uid = %d", $account->uid);
530
-
531
-      // Remove flags that have been done to this user.
532
-      db_query("DELETE FROM {flag_counts} WHERE content_type = 'user' AND content_id = %d", $account->uid);
533
-      db_query("DELETE FROM {flag_content} WHERE content_type = 'user' AND content_id = %d", $account->uid);
534
-      break;
535
-    case 'view';
536
-      $flags = flag_get_flags('user');
537
-      $flag_items = array();
538
-      foreach ($flags as $flag) {
539
-        if (!$flag->access($account->uid)) {
540
-          // User has no permission to use this flag.
541
-          continue;
542
-        }
543
-        if (!$flag->uses_hook_link(array())) {
544
-          // Flag not set to appear on profile.
545
-          continue;
546
-        }
547
-        $flag_items[$flag->name] = array(
548
-          '#type' => 'user_profile_item',
549
-          '#title' => $flag->get_title($account->uid),
550
-          '#value' => $flag->theme($flag->is_flagged($account->uid) ? 'unflag' : 'flag', $account->uid),
551
-          '#attributes' => array('class' => 'flag-profile-' . $flag->name),
552
-        );
528
+    }
529
+    db_query("DELETE FROM {flag_content} WHERE uid = %d", $account->uid);
530
+
531
+    // Remove flags that have been done to this user.
532
+    db_query("DELETE FROM {flag_counts} WHERE content_type = 'user' AND content_id = %d", $account->uid);
533
+    db_query("DELETE FROM {flag_content} WHERE content_type = 'user' AND content_id = %d", $account->uid);
534
+    break;
535
+  case 'view';
536
+    $flags = flag_get_flags('user');
537
+    $flag_items = array();
538
+    foreach ($flags as $flag) {
539
+      if (!$flag->access($account->uid)) {
540
+        // User has no permission to use this flag.
541
+        continue;
553 542
       }
554
-      if (!empty($flag_items)) {
555
-        $account->content['flags'] = $flag_items;
556
-        $account->content['flags'] += array(
557
-          '#type' => 'user_profile_category',
558
-          '#title' => t('Actions'),
559
-          '#attributes' => array('class' => 'flag-profile'),
560
-        );
543
+      if (!$flag->uses_hook_link(array())) {
544
+        // Flag not set to appear on profile.
545
+        continue;
561 546
       }
562
-      break;
547
+      $flag_items[$flag->name] = array(
548
+        '#type' => 'user_profile_item',
549
+        '#title' => $flag->get_title($account->uid),
550
+        '#value' => $flag->theme($flag->is_flagged($account->uid) ? 'unflag' : 'flag', $account->uid),
551
+        '#attributes' => array('class' => 'flag-profile-' . $flag->name),
552
+      );
553
+    }
554
+    if (!empty($flag_items)) {
555
+      $account->content['flags'] = $flag_items;
556
+      $account->content['flags'] += array(
557
+        '#type' => 'user_profile_category',
558
+        '#title' => t('Actions'),
559
+        '#attributes' => array('class' => 'flag-profile'),
560
+      );
561
+    }
562
+    break;
563 563
   }
564 564
 }
565 565
 
@@ -588,10 +588,10 @@  discard block
 block discarded – undo
588 588
  */
589 589
 function flag_node_type($op, $info) {
590 590
   switch ($op) {
591
-    case 'delete':
592
-      // Remove entry from flaggable content types.
593
-      db_query("DELETE FROM {flag_types} WHERE type = '%s'", $info->type);
594
-      break;
591
+  case 'delete':
592
+    // Remove entry from flaggable content types.
593
+    db_query("DELETE FROM {flag_types} WHERE type = '%s'", $info->type);
594
+    break;
595 595
   }
596 596
 }
597 597
 
@@ -1012,15 +1012,15 @@  discard block
 block discarded – undo
1012 1012
  */
1013 1013
 function flag_comment(&$comment, $op) {
1014 1014
   switch ($op) {
1015
-    case 'delete':
1016
-      db_query("DELETE FROM {flag_content}
1015
+  case 'delete':
1016
+    db_query("DELETE FROM {flag_content}
1017 1017
                  WHERE content_type = 'comment'
1018 1018
                    AND content_id = %d", $comment->cid);
1019 1019
 
1020
-      db_query("DELETE FROM {flag_counts}
1020
+    db_query("DELETE FROM {flag_counts}
1021 1021
                  WHERE content_type = 'comment'
1022 1022
                    AND content_id = %d", $comment->cid);
1023
-      break;
1023
+    break;
1024 1024
   }
1025 1025
 }
1026 1026
 
@@ -1029,10 +1029,10 @@  discard block
 block discarded – undo
1029 1029
  */
1030 1030
 function flag_mail($key, &$message, $params) {
1031 1031
   switch ($key) {
1032
-    case 'over_threshold':
1033
-      $message['subject'] = $params['subject'];
1034
-      $message['body'] = $params['body'];
1035
-      break;
1032
+  case 'over_threshold':
1033
+    $message['subject'] = $params['subject'];
1034
+    $message['body'] = $params['body'];
1035
+    break;
1036 1036
   }
1037 1037
 }
1038 1038
 
Please login to merge, or discard this patch.
views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc 1 patch
Switch Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -57,92 +57,92 @@
 block discarded – undo
57 57
     $transform = isset($this->argument->options['validate_argument_transform']) ? $this->argument->options['validate_argument_transform'] : FALSE;
58 58
 
59 59
     switch ($type) {
60
-      case 'tid':
61
-        if (!is_numeric($argument)) {
62
-          return FALSE;
63
-        }
64
-
65
-        $result = db_fetch_object(db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t WHERE t.tid = %d", 't', 'tid', array($argument)),  $argument));
66
-        if (!$result) {
67
-          return FALSE;
68
-        }
69
-
70
-        return empty($vids) || !empty($vids[$result->vid]);
71
-      case 'tids':
72
-        // An empty argument is not a term so doesn't pass.
73
-        if (empty($argument)) {
74
-          return FALSE;
75
-        }
76
-
77
-        $tids = new stdClass();
78
-        $tids->value = $argument;
79
-        $tids = views_break_phrase($argument, $tids);
80
-        if ($tids->value == array(-1)) {
81
-          return FALSE;
82
-        }
83
-
84
-        $test = drupal_map_assoc($tids->value);
85
-        $titles = array();
86
-
87
-        // check, if some tids already verified
88
-        static $validated_cache = array();
89
-        foreach ($test as $tid) {
90
-          if (isset($validated_cache[$tid])) {
91
-            if ($validated_cache[$tid] === FALSE) {
92
-              return FALSE;
93
-            }
94
-            else {
95
-              $titles[] = $validated_cache[$tid];
96
-              unset($test[$tid]);
97
-            }
60
+    case 'tid':
61
+      if (!is_numeric($argument)) {
62
+        return FALSE;
63
+      }
64
+
65
+      $result = db_fetch_object(db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t WHERE t.tid = %d", 't', 'tid', array($argument)),  $argument));
66
+      if (!$result) {
67
+        return FALSE;
68
+      }
69
+
70
+      return empty($vids) || !empty($vids[$result->vid]);
71
+    case 'tids':
72
+      // An empty argument is not a term so doesn't pass.
73
+      if (empty($argument)) {
74
+        return FALSE;
75
+      }
76
+
77
+      $tids = new stdClass();
78
+      $tids->value = $argument;
79
+      $tids = views_break_phrase($argument, $tids);
80
+      if ($tids->value == array(-1)) {
81
+        return FALSE;
82
+      }
83
+
84
+      $test = drupal_map_assoc($tids->value);
85
+      $titles = array();
86
+
87
+      // check, if some tids already verified
88
+      static $validated_cache = array();
89
+      foreach ($test as $tid) {
90
+        if (isset($validated_cache[$tid])) {
91
+          if ($validated_cache[$tid] === FALSE) {
92
+            return FALSE;
93
+          }
94
+          else {
95
+            $titles[] = $validated_cache[$tid];
96
+            unset($test[$tid]);
98 97
           }
99 98
         }
99
+      }
100 100
 
101 101
 
102
-        // if unverified tids left - verify them and cache results
103
-        if (count($test)) {
104
-          $placeholders = implode(', ', array_fill(0, count($test), '%d'));
102
+      // if unverified tids left - verify them and cache results
103
+      if (count($test)) {
104
+        $placeholders = implode(', ', array_fill(0, count($test), '%d'));
105 105
 
106
-          $result = db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t WHERE t.tid IN ($placeholders)", 't', 'tid', array($test)), $test);
107
-          while ($term = db_fetch_object($result)) {
108
-            if ($vids && empty($vids[$term->vid])) {
109
-              $validated_cache[$term->tid] = FALSE;
110
-              return FALSE;
111
-            }
112
-
113
-            $titles[] = $validated_cache[$term->tid] = check_plain($term->name);
114
-            unset($test[$term->tid]);
106
+        $result = db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t WHERE t.tid IN ($placeholders)", 't', 'tid', array($test)), $test);
107
+        while ($term = db_fetch_object($result)) {
108
+          if ($vids && empty($vids[$term->vid])) {
109
+            $validated_cache[$term->tid] = FALSE;
110
+            return FALSE;
115 111
           }
116
-        }
117
-
118
-        // Remove duplicate titles
119
-        $titles = array_unique($titles);
120
-
121
-        $this->argument->validated_title = implode($tids->operator == 'or' ? ' + ' : ', ', $titles);
122
-        // If this is not empty, we did not find a tid.
123
-        return empty($test);
124
-      case 'name':
125
-      case 'convert':
126
-        $and = '';
127
-        if (!empty($vids)) {
128
-          $and = " AND t.vid IN(" . implode(', ', $vids) . ')';
129
-        }
130
-        if ($transform) {
131
-          $result = db_fetch_object(db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t LEFT JOIN {term_synonym} ts ON ts.tid = t.tid WHERE (replace(t.name, ' ', '-') = '%s' OR replace(ts.name, ' ', '-') = '%s')$and", 't', 'tid', array($argument, $argument)), $argument, $argument));
132
-        }
133
-        else {
134
-          $result = db_fetch_object(db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t LEFT JOIN {term_synonym} ts ON ts.tid = t.tid WHERE (t.name = '%s' OR ts.name = '%s')$and", 't', 'tid', array($argument, $argument)), $argument, $argument));
135
-        }
136
-        if (!$result) {
137
-          return FALSE;
138
-        }
139 112
 
140
-        if ($type == 'convert') {
141
-          $this->argument->argument = $result->tid;
113
+          $titles[] = $validated_cache[$term->tid] = check_plain($term->name);
114
+          unset($test[$term->tid]);
142 115
         }
143
-        $this->argument->validated_title = check_plain($result->name);
144
-
145
-        return TRUE;
116
+      }
117
+
118
+      // Remove duplicate titles
119
+      $titles = array_unique($titles);
120
+
121
+      $this->argument->validated_title = implode($tids->operator == 'or' ? ' + ' : ', ', $titles);
122
+      // If this is not empty, we did not find a tid.
123
+      return empty($test);
124
+    case 'name':
125
+    case 'convert':
126
+      $and = '';
127
+      if (!empty($vids)) {
128
+        $and = " AND t.vid IN(" . implode(', ', $vids) . ')';
129
+      }
130
+      if ($transform) {
131
+        $result = db_fetch_object(db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t LEFT JOIN {term_synonym} ts ON ts.tid = t.tid WHERE (replace(t.name, ' ', '-') = '%s' OR replace(ts.name, ' ', '-') = '%s')$and", 't', 'tid', array($argument, $argument)), $argument, $argument));
132
+      }
133
+      else {
134
+        $result = db_fetch_object(db_query(db_rewrite_sql("SELECT t.* FROM {term_data} t LEFT JOIN {term_synonym} ts ON ts.tid = t.tid WHERE (t.name = '%s' OR ts.name = '%s')$and", 't', 'tid', array($argument, $argument)), $argument, $argument));
135
+      }
136
+      if (!$result) {
137
+        return FALSE;
138
+      }
139
+
140
+      if ($type == 'convert') {
141
+        $this->argument->argument = $result->tid;
142
+      }
143
+      $this->argument->validated_title = check_plain($result->name);
144
+
145
+      return TRUE;
146 146
     }
147 147
   }
148 148
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/themes/boinc/template.php 1 patch
Switch Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -626,13 +626,13 @@  discard block
 block discarded – undo
626 626
   $sender = user_load($sender->uid);
627 627
   
628 628
   switch ($status) {
629
-    case FLAG_FRIEND_FLAGGED:
630
-      // Sender accepted recipient's friend request
631
-      $email['subject'] = bts('!name accepted your friend request [!site]', array(
632
-        '!name' => $sender->boincuser_name,
633
-        '!site' => variable_get('site_name', 'Drupal-BOINC'),
634
-        ), NULL, 'boinc:friend-request-email');
635
-      $email['body'] = bts('!name confirmed you as a friend on !site.
629
+  case FLAG_FRIEND_FLAGGED:
630
+    // Sender accepted recipient's friend request
631
+    $email['subject'] = bts('!name accepted your friend request [!site]', array(
632
+      '!name' => $sender->boincuser_name,
633
+      '!site' => variable_get('site_name', 'Drupal-BOINC'),
634
+      ), NULL, 'boinc:friend-request-email');
635
+    $email['body'] = bts('!name confirmed you as a friend on !site.
636 636
 
637 637
 Follow this link to view his or her profile:
638 638
 !link
@@ -641,17 +641,17 @@  discard block
 block discarded – undo
641 641
 
642 642
 Thanks,
643 643
 The !site team', array(
644
-        '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name,
645
-        '!site' => variable_get('site_name', 'Drupal-BOINC'),
646
-        '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '',
647
-        '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)),
648
-        ), array(), NULL, 'boinc:friend-request-email');
649
-      break;
644
+      '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name,
645
+      '!site' => variable_get('site_name', 'Drupal-BOINC'),
646
+      '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '',
647
+      '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)),
648
+      ), array(), NULL, 'boinc:friend-request-email');
649
+    break;
650 650
 
651
-    case FLAG_FRIEND_PENDING:
652
-      // Sender is requesting to be recipient's friend
653
-      $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email');
654
-      $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts.
651
+  case FLAG_FRIEND_PENDING:
652
+    // Sender is requesting to be recipient's friend
653
+    $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', 'Drupal-BOINC')), NULL, 'boinc:friend-request-email');
654
+    $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts.
655 655
 
656 656
 Follow the link below to view this request:
657 657
 !link
@@ -660,13 +660,13 @@  discard block
 block discarded – undo
660 660
 
661 661
 Thanks,
662 662
 The !site team', array(
663
-        '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name,
664
-        '!site' => variable_get('site_name', 'Drupal-BOINC'),
665
-        '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '',
666
-        '!link' => url('goto/friend-requests', array('absolute' => TRUE)),
667
-        ),
668
-      array(), NULL, 'boinc:friend-request-email');
669
-      break;
663
+      '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name,
664
+      '!site' => variable_get('site_name', 'Drupal-BOINC'),
665
+      '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '',
666
+      '!link' => url('goto/friend-requests', array('absolute' => TRUE)),
667
+      ),
668
+    array(), NULL, 'boinc:friend-request-email');
669
+    break;
670 670
   }
671 671
   return $email;
672 672
 }
Please login to merge, or discard this patch.
default/boinc/modules/boinctranslate/includes/boinctranslate.helpers.inc 1 patch
Switch Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1398,72 +1398,72 @@
 block discarded – undo
1398 1398
 
1399 1399
   switch ($op) {
1400 1400
     // Return stored strings
1401
-    case 'mem-report':
1402
-      return $strings;
1403
-
1404
-      // Store string in memory (only supports single strings)
1405
-    case 'mem-store':
1406
-      $strings[$value['msgid']] = $value['msgstr'];
1407
-      return;
1408
-
1409
-      // Called at end of import to inform the user
1410
-    case 'db-report':
1411
-      return array(
1412
-        $headerdone,
1413
-        $report['additions'],
1414
-        $report['updates'],
1415
-        $report['deletes'],
1416
-        $report['skips'],
1417
-      );
1401
+  case 'mem-report':
1402
+    return $strings;
1403
+
1404
+    // Store string in memory (only supports single strings)
1405
+  case 'mem-store':
1406
+    $strings[$value['msgid']] = $value['msgstr'];
1407
+    return;
1408
+
1409
+    // Called at end of import to inform the user
1410
+  case 'db-report':
1411
+    return array(
1412
+      $headerdone,
1413
+      $report['additions'],
1414
+      $report['updates'],
1415
+      $report['deletes'],
1416
+      $report['skips'],
1417
+    );
1418 1418
 
1419
-      // Store the string we got in the database.
1420
-    case 'db-store':
1421
-      // We got header information.
1422
-      if ($value['msgid'] == '') {
1423
-        $languages = language_list();
1424
-        if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) {
1425
-          // Since we only need to parse the header if we ought to update the
1426
-          // plural formula, only run this if we don't need to keep existing
1427
-          // data untouched or if we don't have an existing plural formula.
1428
-          $header = _locale_import_parse_header($value['msgstr']);
1429
-
1430
-          // Get and store the plural formula if available.
1431
-          if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) {
1432
-            list($nplurals, $plural) = $p;
1433
-            db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang);
1434
-          }
1419
+    // Store the string we got in the database.
1420
+  case 'db-store':
1421
+    // We got header information.
1422
+    if ($value['msgid'] == '') {
1423
+      $languages = language_list();
1424
+      if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) {
1425
+        // Since we only need to parse the header if we ought to update the
1426
+        // plural formula, only run this if we don't need to keep existing
1427
+        // data untouched or if we don't have an existing plural formula.
1428
+        $header = _locale_import_parse_header($value['msgstr']);
1429
+
1430
+        // Get and store the plural formula if available.
1431
+        if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) {
1432
+          list($nplurals, $plural) = $p;
1433
+          db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang);
1435 1434
         }
1436
-        $headerdone = TRUE;
1437 1435
       }
1436
+      $headerdone = TRUE;
1437
+    }
1438 1438
 
1439
-      else {
1440
-        // Some real string to import.
1441
-        $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']);
1442
-
1443
-        if (strpos($value['msgid'], "\0")) {
1444
-          // This string has plural versions.
1445
-          $english = explode("\0", $value['msgid'], 2);
1446
-          $entries = array_keys($value['msgstr']);
1447
-          for ($i = 3; $i <= count($entries); $i++) {
1448
-            $english[] = $english[1];
1449
-          }
1450
-          $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries);
1451
-          $english = array_map('_locale_import_append_plural', $english, $entries);
1452
-          foreach ($translation as $key => $trans) {
1453
-            if ($key == 0) {
1454
-              $plid = 0;
1455
-            }
1456
-            $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key);
1439
+    else {
1440
+      // Some real string to import.
1441
+      $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']);
1442
+
1443
+      if (strpos($value['msgid'], "\0")) {
1444
+        // This string has plural versions.
1445
+        $english = explode("\0", $value['msgid'], 2);
1446
+        $entries = array_keys($value['msgstr']);
1447
+        for ($i = 3; $i <= count($entries); $i++) {
1448
+          $english[] = $english[1];
1449
+        }
1450
+        $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries);
1451
+        $english = array_map('_locale_import_append_plural', $english, $entries);
1452
+        foreach ($translation as $key => $trans) {
1453
+          if ($key == 0) {
1454
+            $plid = 0;
1457 1455
           }
1456
+          $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key);
1458 1457
         }
1458
+      }
1459 1459
 
1460
-        else {
1461
-          // A simple string to import.
1462
-          $english = $value['msgid'];
1463
-          $translation = $value['msgstr'];
1464
-          _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode);
1465
-        }
1460
+      else {
1461
+        // A simple string to import.
1462
+        $english = $value['msgid'];
1463
+        $translation = $value['msgstr'];
1464
+        _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode);
1466 1465
       }
1466
+    }
1467 1467
   } // end of db-store operation
1468 1468
 }
1469 1469
 
Please login to merge, or discard this patch.
sites/default/boinc/modules/boinc_solr_search/boinc_solr_search.module 1 patch
Switch Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -18,15 +18,15 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function boinc_solr_search_block($op = 'list', $delta = 0, $edit = array()) {
20 20
   switch ($op) {
21
-    case 'list':
22
-      return boinc_solr_search_block_info();
23
-      break;
24
-    case 'view':
25
-      return boinc_solr_search_block_view($delta);
26
-      break;
27
-    case 'configure':
28
-    case 'save':
29
-    default:
21
+  case 'list':
22
+    return boinc_solr_search_block_info();
23
+    break;
24
+  case 'view':
25
+    return boinc_solr_search_block_view($delta);
26
+    break;
27
+  case 'configure':
28
+  case 'save':
29
+  default:
30 30
   }
31 31
 }
32 32
 
@@ -53,26 +53,26 @@  discard block
 block discarded – undo
53 53
 function boinc_solr_search_block_view($delta = 0) {
54 54
   $block = array();
55 55
   switch($delta) {
56
-    case 'boinc_solr_search_0':
57
-      $items = array(
58
-          bts('By default a search matches ANY search term. Results with more than one term will be presented higher in the search results.', array(), NULL, 'boinc:search-help-sidebar-block'),
59
-          bts('You may use \'AND\' to have the search engine return results with ALL search terms.', array(), NULL, 'boinc:search-help-sidebar-block'),
60
-          bts('For example, searching for \'boinc AND client\' will only contain results with words boinc and client.', array(), NULL, 'boinc:search-help-sidebar-block')
61
-      );
56
+  case 'boinc_solr_search_0':
57
+    $items = array(
58
+        bts('By default a search matches ANY search term. Results with more than one term will be presented higher in the search results.', array(), NULL, 'boinc:search-help-sidebar-block'),
59
+        bts('You may use \'AND\' to have the search engine return results with ALL search terms.', array(), NULL, 'boinc:search-help-sidebar-block'),
60
+        bts('For example, searching for \'boinc AND client\' will only contain results with words boinc and client.', array(), NULL, 'boinc:search-help-sidebar-block')
61
+    );
62 62
 
63
-      drupal_add_js('misc/collapse.js');
64
-      // For Drupal 7 the format of the array changes, see https://api.drupal.org/api/drupal/includes%21form.inc/function/theme_fieldset/7.x for details.
65
-      $collapsible_item = array(
66
-        '#title' => bts('Search Help', array(), NULL, 'boinc:search-help-sidebar-block'),
67
-        '#description' => theme_item_list($items),
68
-        '#collapsible' => TRUE,
69
-        '#collapsed' => TRUE,
70
-        '#attributes' => array(
71
-          'class' => 'search-help-block',
72
-        ),
73
-      );
74
-      $block['content'] = theme('fieldset', $collapsible_item);
75
-      break;
63
+    drupal_add_js('misc/collapse.js');
64
+    // For Drupal 7 the format of the array changes, see https://api.drupal.org/api/drupal/includes%21form.inc/function/theme_fieldset/7.x for details.
65
+    $collapsible_item = array(
66
+      '#title' => bts('Search Help', array(), NULL, 'boinc:search-help-sidebar-block'),
67
+      '#description' => theme_item_list($items),
68
+      '#collapsible' => TRUE,
69
+      '#collapsed' => TRUE,
70
+      '#attributes' => array(
71
+        'class' => 'search-help-block',
72
+      ),
73
+    );
74
+    $block['content'] = theme('fieldset', $collapsible_item);
75
+    break;
76 76
   }
77 77
   return $block;
78 78
 }
Please login to merge, or discard this patch.
html/inc/password_compat/password.inc 1 patch
Switch Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -50,47 +50,47 @@  discard block
 block discarded – undo
50 50
             }
51 51
             $resultLength = 0;
52 52
             switch ($algo) {
53
-                case PASSWORD_BCRYPT:
54
-                    $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55
-                    if (isset($options['cost'])) {
56
-                        $cost = (int) $options['cost'];
57
-                        if ($cost < 4 || $cost > 31) {
58
-                            trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59
-                            return null;
60
-                        }
53
+            case PASSWORD_BCRYPT:
54
+                $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55
+                if (isset($options['cost'])) {
56
+                    $cost = (int) $options['cost'];
57
+                    if ($cost < 4 || $cost > 31) {
58
+                        trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59
+                        return null;
61 60
                     }
62
-                    // The length of salt to generate
63
-                    $raw_salt_len = 16;
64
-                    // The length required in the final serialization
65
-                    $required_salt_len = 22;
66
-                    $hash_format = sprintf("$2y$%02d$", $cost);
67
-                    // The expected length of the final crypt() output
68
-                    $resultLength = 60;
69
-                    break;
70
-                default:
71
-                    trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
72
-                    return null;
61
+                }
62
+                // The length of salt to generate
63
+                $raw_salt_len = 16;
64
+                // The length required in the final serialization
65
+                $required_salt_len = 22;
66
+                $hash_format = sprintf("$2y$%02d$", $cost);
67
+                // The expected length of the final crypt() output
68
+                $resultLength = 60;
69
+                break;
70
+            default:
71
+                trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
72
+                return null;
73 73
             }
74 74
             $salt_req_encoding = false;
75 75
             if (isset($options['salt'])) {
76 76
                 switch (gettype($options['salt'])) {
77
-                    case 'NULL':
78
-                    case 'boolean':
79
-                    case 'integer':
80
-                    case 'double':
81
-                    case 'string':
77
+                case 'NULL':
78
+                case 'boolean':
79
+                case 'integer':
80
+                case 'double':
81
+                case 'string':
82
+                    $salt = (string) $options['salt'];
83
+                    break;
84
+                case 'object':
85
+                    if (method_exists($options['salt'], '__tostring')) {
82 86
                         $salt = (string) $options['salt'];
83 87
                         break;
84
-                    case 'object':
85
-                        if (method_exists($options['salt'], '__tostring')) {
86
-                            $salt = (string) $options['salt'];
87
-                            break;
88
-                        }
89
-                    case 'array':
90
-                    case 'resource':
91
-                    default:
92
-                        trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
93
-                        return null;
88
+                    }
89
+                case 'array':
90
+                case 'resource':
91
+                default:
92
+                    trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
93
+                    return null;
94 94
                 }
95 95
                 if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
96 96
                     trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
                 return true;
213 213
             }
214 214
             switch ($algo) {
215
-                case PASSWORD_BCRYPT:
216
-                    $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217
-                    if ($cost !== $info['options']['cost']) {
218
-                        return true;
219
-                    }
220
-                    break;
215
+            case PASSWORD_BCRYPT:
216
+                $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217
+                if ($cost !== $info['options']['cost']) {
218
+                    return true;
219
+                }
220
+                break;
221 221
             }
222 222
             return false;
223 223
         }
Please login to merge, or discard this patch.
filefield_meta/includes/filefield_meta_handler_field_samplerate.inc 1 patch
Switch Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@
 block discarded – undo
50 50
     }
51 51
 
52 52
     switch ($this->options['format']) {
53
-      case 'raw':
54
-        $output = $value;
55
-        break;
56
-      default:
57
-        $output = theme('filefield_meta_samplerate', $value);
53
+    case 'raw':
54
+      $output = $value;
55
+      break;
56
+    default:
57
+      $output = theme('filefield_meta_samplerate', $value);
58 58
     }
59 59
 
60 60
     return check_plain($this->options['prefix']) . $output . check_plain($this->options['suffix']);
Please login to merge, or discard this patch.
filefield/filefield_meta/includes/filefield_meta_handler_field_duration.inc 1 patch
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -48,20 +48,20 @@
 block discarded – undo
48 48
     $value = $values->{$this->field_alias};
49 49
 
50 50
     switch ($this->options['format']) {
51
-      case 'hours':
52
-        $output = date('g', (int) $value);
53
-        break;
54
-      case 'minutes':
55
-        $output = date('i', (int) $value);
56
-        break;
57
-      case 'seconds':
58
-        $output = date('s', (int) $value);
59
-        break;
60
-      case 'total':
61
-        $output = check_plain($value);
62
-        break;
63
-      default:
64
-        $output = theme('filefield_meta_duration', $value);
51
+    case 'hours':
52
+      $output = date('g', (int) $value);
53
+      break;
54
+    case 'minutes':
55
+      $output = date('i', (int) $value);
56
+      break;
57
+    case 'seconds':
58
+      $output = date('s', (int) $value);
59
+      break;
60
+    case 'total':
61
+      $output = check_plain($value);
62
+      break;
63
+    default:
64
+      $output = theme('filefield_meta_duration', $value);
65 65
     }
66 66
 
67 67
     // Check to see if hiding should happen before adding prefix and suffix.
Please login to merge, or discard this patch.
filefield/filefield_meta/includes/filefield_meta_handler_field_bitrate.inc 1 patch
Switch Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@
 block discarded – undo
50 50
     }
51 51
 
52 52
     switch ($this->options['format']) {
53
-      case 'raw':
54
-        $output = $value;
55
-        break;
56
-      default:
57
-        $output = theme('filefield_meta_bitrate', $value);
53
+    case 'raw':
54
+      $output = $value;
55
+      break;
56
+    default:
57
+      $output = theme('filefield_meta_bitrate', $value);
58 58
     }
59 59
 
60 60
     return check_plain($this->options['prefix']) . $output . check_plain($this->options['suffix']);
Please login to merge, or discard this patch.