function certificate_certificate_map_options in Certificate 6.2
Same name and namespace in other branches
- 8.3 certificate.module \certificate_certificate_map_options()
- 7.3 certificate.module \certificate_certificate_map_options()
- 7.2 certificate.module \certificate_certificate_map_options()
- 3.x certificate.module \certificate_certificate_map_options()
Implementation of hook_certificate_map_options().
Provide a list of options to the user that can be mapped to certificate templates.
Return value
Array of mapping sets.
File
- ./
certificate.module, line 665 - Certificate module.
Code
function certificate_certificate_map_options() {
$options = array();
if (module_exists('rules')) {
$rules = array();
foreach (rules_get_configured_items('rule_sets') as $key => $ruleset) {
if (in_array('certificate', $ruleset['categories'])) {
$rules[$key] = $ruleset['label'];
}
}
$options['rules'] = array(
'title' => "Ruleset",
'options' => $rules,
'description' => 'When a ruleset ends with "Award certificate", the selected certificate will be awarded.',
);
}
if (module_exists('content_profile')) {
$fieldgroups = variable_get('certificate_field_groups', array());
$options['content_profile'] = array(
'title' => "Content profile",
'options' => $fieldgroups,
'description' => t('If a user matches a value in a field group, the selected certificate will be awarded.'),
);
}
$options['manual'] = array(
'title' => 'Manual',
'description' => t('Select a single certificate to award to the user.'),
'options' => array(
'manual' => 'Manual',
),
);
return $options;
}