function hook_certificate_map in Certificate 4.x
Same name and namespace in other branches
- 8.3 certificate.api.php \hook_certificate_map()
- 6.2 certificate.api.php \hook_certificate_map()
- 6 certificate.api.php \hook_certificate_map()
- 7.3 certificate.api.php \hook_certificate_map()
- 7.2 certificate.api.php \hook_certificate_map()
- 3.x certificate.api.php \hook_certificate_map()
Implementation of hook_certificate_map().
Return the key of the mapping to use.
Parameters
stdClass $node:
stdClass $user:
string $map_type:
array $options: An array of keys that the user wants to check.
Return value
String Key of matched mapping.
File
- ./
certificate.api.php, line 77 - certificate.api.php Document certificate hooks.
Code
function hook_certificate_map($node, $user, $map_type, $options) {
if ($map_type == 'mood') {
foreach ($options as $key) {
if ($user->mood == $key) {
// User's mood matched, so return the key. Certificate module will then
// match the key to the template ID.
return $key;
}
}
}
}