You are here

function theme_certificate_certificate in Certificate 6.2

Same name and namespace in other branches
  1. 8.3 certificate.pages.inc \theme_certificate_certificate()
  2. 6 certificate.pages.inc \theme_certificate_certificate()
  3. 7.3 certificate.pages.inc \theme_certificate_certificate()
  4. 7.2 certificate.pages.inc \theme_certificate_certificate()
  5. 3.x certificate.pages.inc \theme_certificate_certificate()

Theme a single certificate.

Does token replace (new style [], and old style %)

Parameters

$account: The user account being viewed.

Return value

The certificate HTML with all tokens translated.

2 theme calls to theme_certificate_certificate()
certificate_preview in ./certificate.pages.inc
Preview certificate template as PDF.
certificate_single in ./certificate.pages.inc
Generate a single certificate.

File

./certificate.pages.inc, line 160
certificate.pages.inc Functions for generating certificates.

Code

function theme_certificate_certificate($node, $account, $template) {
  $types = array(
    'global' => NULL,
    'node' => $node,
    'user' => $account,
    'certificate' => array(
      'node' => $node,
      'user' => $account,
    ),
  );

  // Invoke hook_certificate_body_alter() to allow all modules to alter the template body.
  drupal_alter('certificate_body', $template->body, $account, $node);
  if (module_exists('token')) {
    if (module_exists('purl')) {
      purl_disable(TRUE);
    }
    $template->body = token_replace_multiple($template->body, $types);
  }
  $template->body = check_markup($template->body, $template->format, FALSE);
  return $template->body;
}