You are here

function hook_certificate_map in Certificate 4.x

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. 6 certificate.api.php \hook_certificate_map()
  4. 7.3 certificate.api.php \hook_certificate_map()
  5. 7.2 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.

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;
      }
    }
  }
}