You are here

function hook_certificate_map in Certificate 3.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. 4.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
Implements 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;
      }
    }
  }
}