function hook_certificate_map in Certificate 6.2
Same name and namespace in other branches
- 8.3 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()
- 4.x 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.
2 functions implement hook_certificate_map()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- certificate_certificate_map in ./
certificate.module - Implementation of hook_certificate_map().
- certificate_test_certificate_map in modules/
certificate_test/ certificate_test.module - Implements certificate_map().
1 invocation of hook_certificate_map()
- certificate_single in ./
certificate.pages.inc - Generate a single certificate.
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;
}
}
}
}