function theme_certificate_certificate in Certificate 8.3
Same name and namespace in other branches
- 6.2 certificate.pages.inc \theme_certificate_certificate()
- 6 certificate.pages.inc \theme_certificate_certificate()
- 7.3 certificate.pages.inc \theme_certificate_certificate()
- 7.2 certificate.pages.inc \theme_certificate_certificate()
- 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 213 - certificate.pages.inc Functions for generating certificates.
Code
function theme_certificate_certificate($variables) {
$node = $variables['node'];
$account = $variables['account'];
$template = $variables['template'];
$types = array(
'global' => NULL,
'certificate' => NULL,
'node' => $node,
'user' => $account,
);
$view = entity_view('certificate', array(
$template,
), 'full', NULL, TRUE);
$page = drupal_render($view);
if (module_exists('purl')) {
purl_disable(TRUE);
}
// Token replace, clear out empty tokens.
$body = token_replace($page, $types, array(
'clear' => TRUE,
));
return $body;
}