function user_badges_receives_badge_form in User Badges 6
Same name and namespace in other branches
- 6.2 user_badges.rules.inc \user_badges_receives_badge_form()
Configuration form for user_badges_receives_badge condition
File
- ./
user_badges.rules.inc, line 123 - Provide better integration into the rules module
Code
function user_badges_receives_badge_form($settings = array(), &$form) {
$form['badges'] = array(
'#tree' => TRUE,
);
$badges = user_badges_get_badges('all');
$settings['badges'] = is_array($settings['badges']) ? $settings['badges'] : array();
foreach ($badges as $badge) {
$form['settings']['badges'][$badge->bid] = array(
'#type' => 'checkbox',
'#title' => theme('user_badge', $badge),
'#return_value' => 1,
'#default_value' => $settings['badges'][$badge->bid],
'#description' => check_plain($badge->name),
);
}
return $form;
}