You are here

function hook_certificate_map in Certificate 6

Same name and namespace in other branches
  1. 8.3 certificate.api.php \hook_certificate_map()
  2. 6.2 certificate.api.php \hook_certificate_map()
  3. 7.3 certificate.api.php \hook_certificate_map()
  4. 7.2 certificate.api.php \hook_certificate_map()
  5. 4.x certificate.api.php \hook_certificate_map()
  6. 3.x certificate.api.php \hook_certificate_map()

Implementation of hook_certificate_map().

Return the key of the mapping to use.

Return value

String Key of matched mapping.

1 invocation of hook_certificate_map()
certificate_single in ./certificate.pages.inc
Generate a single certificate.

File

./certificate.api.php, line 71
certificate.api.php Document certificate hooks.

Code

function hook_certificate_map($node, $user, $map_type, $options) {
  if ($map_type == 'mood') {
    foreach ($options as $key => $value) {
      if ($user->mood == $value) {

        // User's mood matched, so return the key. Certificate module will then
        // match the key to the template ID.
        return $key;
      }
    }
  }
}