You are here

function hook_access_certificate in Certificate 8.3

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

Implementation of hook_access_certificate().

Any module wishing to award a certificate based on arbitrary criteria should implement this hook. The $node is the node in question, the $user is the user viewing the node.

Return value

mixed FALSE if user should not be shown the menu tab or link. TRUE if user should be able to download a certificate. A string if the user should be displayed a friendly message instead.

4 functions implement hook_access_certificate()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

certificate_can_access_certificate in ./certificate.module
Check if a user can access a certificate for this node.
certificate_test_access_certificate in modules/certificate_test/certificate_test.module
Implements hook_access_certificate().
quiz_certificate_access_certificate in modules/quiz_certificate/quiz_certificate.module
Implements hook_access_certificate().
signup_certificate_access_certificate in modules/signup_certificate/signup_certificate.module
Implements hook_access_certificate().
1 invocation of hook_access_certificate()
certificate_can_access_certificate in ./certificate.module
Check if a user can access a certificate for this node.

File

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

Code

function hook_access_certificate($node, $user) {
  if ($user->score > $node->pass_rate) {

    // Let the user get a certificate if they passed something.
    return TRUE;
  }
}