You are here

function user_badges_receives_badge in User Badges 6.2

Same name and namespace in other branches
  1. 6 user_badges.rules.inc \user_badges_receives_badge()

Test the user_badges_receives_badge condition

File

./user_badges.rules.inc, line 144
Provide better integration into the rules module

Code

function user_badges_receives_badge($badge_id, $settings) {
  $badge_bool = FALSE;
  foreach ($settings['badges'] as $bid => $on) {
    if ($bid == $badge_id && $on == 1) {
      $badge_bool = TRUE;
    }
  }
  return $badge_bool;
}