/
content-certificate.php
56 lines (43 loc) · 1.73 KB
/
content-certificate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Certificate: Content
*
* @package LifterLMS/Templates
*
* @since 1.0.0
* @version 3.18.0
*/
defined( 'ABSPATH' ) || exit;
$cert = new LLMS_User_Certificate( get_the_ID() );
$uid = get_current_user_id();
if ( $uid != $cert->get_user_id() && ! llms_can_user_bypass_restrictions( $uid ) ) {
return _e( 'Certificate not found.', 'lifterlms' );
}
$image = llms_get_certificate_image();
?>
<div class="llms-certificate-container" style="width:<?php echo $image['width']; ?>px; height:<?php echo $image['height']; ?>px;">
<img src="<?php echo $image['src']; ?>" style="margin-bottom:-<?php echo $image['height']; ?>px;" alt="Cetrificate Background" class="certificate-background">
<div id="certificate-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="llms-summary">
<?php llms_print_notices(); ?>
<?php do_action( 'before_lifterlms_certificate_main_content' ); ?>
<h1><?php echo llms_get_certificate_title(); ?></h1>
<?php echo llms_get_certificate_content(); ?>
<?php do_action( 'after_lifterlms_certificate_main_content' ); ?>
</div>
</div>
</div>
<div class="llms-print-certificate no-print" id="llms-print-certificate">
<button class="llms-button-secondary" onClick="window.print()" type="button">
<?php echo _e( 'Print', 'lifterlms' ); ?>
<i class="fa fa-print" aria-hidden="true"></i>
</button>
<form action="" method="POST">
<button class="llms-button-secondary" type="submit" name="llms_generate_cert">
<?php echo _e( 'Save', 'lifterlms' ); ?>
<i class="fa fa-cloud-download" aria-hidden="true"></i>
</button>
<input type="hidden" name="certificate_id" value="<?php echo get_the_ID(); ?>">
<?php wp_nonce_field( 'llms-cert-actions', '_llms_cert_actions_nonce' ); ?>
</form>
</div>