| 1 |
<?php |
| 2 |
/** |
| 3 |
* Form Templates - Upgrade modal. |
| 4 |
* |
| 5 |
* @package Formidable |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
die( 'You are not allowed to call this page directly.' ); |
| 10 |
} |
| 11 |
|
| 12 |
$plans = FrmFormsHelper::get_license_types( array( 'include_all' => false ) ); |
| 13 |
?> |
| 14 |
<div id="frm-form-upgrade-modal" class="frm_wrap frm-form-templates-modal-item frm_hidden"> |
| 15 |
<div class="frm_modal_top frm-mt-xs"> |
| 16 |
<div class="frm-circled-icon frm-flex-center frm-mb-sm"> |
| 17 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_filled_lock_icon' ); ?> |
| 18 |
</div> |
| 19 |
|
| 20 |
<div class="frm-modal-title"> |
| 21 |
<h2> |
| 22 |
<?php |
| 23 |
printf( |
| 24 |
/* translators: %1$s: Open span tag, %2$s: Close span tag */ |
| 25 |
esc_html__( '%1$sTEMPLATE NAME%2$s is a PRO Template', 'formidable' ), |
| 26 |
'<span class="frm-upgrade-modal-template-name frm-capitalize">', |
| 27 |
'</span>' |
| 28 |
); |
| 29 |
?> |
| 30 |
</h2> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
|
| 34 |
<div class="inside frm-px-md frm-mt-xs frm-m-0"> |
| 35 |
<p> |
| 36 |
<?php |
| 37 |
printf( |
| 38 |
/* translators: %1$s: Open span tag, %2$s: Close span tag */ |
| 39 |
esc_html__( 'The %1$sTEMPLATE NAME%2$s is not available on your plan. Please upgrade to unlock this and more awesome templates.', 'formidable' ), |
| 40 |
'<span class="frm-upgrade-modal-template-name frm-capitalize">', |
| 41 |
'</span>' |
| 42 |
); |
| 43 |
?> |
| 44 |
</p> |
| 45 |
|
| 46 |
<?php if ( 'free' === FrmAddonsController::license_type() ) { ?> |
| 47 |
<div class="frm-cta frm-cta-green"> |
| 48 |
<span class="frm-banner-title frm-flex-box frm-items-center frm-font-medium frm-mb-2xs"> |
| 49 |
<?php |
| 50 |
$best_discount = FrmSalesApi::get_best_sale_value( 'discount_percent' ); |
| 51 |
$use_discount = $best_discount > 50 ? $best_discount : 50; |
| 52 |
printf( |
| 53 |
/* translators: %1$s: Open span tag, %2$s: Close span tag */ |
| 54 |
esc_html__( 'Lite users get %1$s%2$d%% OFF%3$s regular price.', 'formidable' ), |
| 55 |
'<span class="frm-meta-tag frm-green-tag">', |
| 56 |
absint( $use_discount ), |
| 57 |
'</span>' |
| 58 |
); |
| 59 |
?> |
| 60 |
</span> |
| 61 |
<span class="frm-banner-text"><?php esc_html_e( 'Discount is automatically applied at checkout.', 'formidable' ); ?></span> |
| 62 |
</div> |
| 63 |
<?php } ?> |
| 64 |
|
| 65 |
<div id="frm-upgrade-modal-available-plans"> |
| 66 |
<p> |
| 67 |
<?php esc_html_e( 'Template available on:', 'formidable' ); ?> |
| 68 |
</p> |
| 69 |
<p class="frm-flex-box frm-gap-md frm-m-0"> |
| 70 |
<?php foreach ( $plans as $plan ) { ?> |
| 71 |
<span class="frm-upgrade-modal-plan frm-flex-box frm-gap-xs frm-items-center"> |
| 72 |
<span class="frm-upgrade-modal-plan-icon frm-flex-box" data-plan="<?php echo esc_attr( strtolower( $plan ) ); ?>"> |
| 73 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon' ); ?> |
| 74 |
</span> |
| 75 |
<span class="frm-upgrade-modal-plan-text"><?php echo esc_html( $plan ); ?></span> |
| 76 |
</span> |
| 77 |
<?php } ?> |
| 78 |
</p> |
| 79 |
</div> |
| 80 |
</div> |
| 81 |
|
| 82 |
<div class="frm_modal_footer frm-flex-box frm-justify-end frm-pt-sm frm-pb-md"> |
| 83 |
<a href="#" class="button button-secondary frm-button-secondary frm-modal-close dismiss" role="button"> |
| 84 |
<?php esc_html_e( 'Close', 'formidable' ); ?> |
| 85 |
</a> |
| 86 |
<a id="frm-upgrade-modal-link" href="#" class="button button-primary frm-button-primary" target="_blank" rel="noopener"> |
| 87 |
<?php |
| 88 |
if ( 'free' === FrmAddonsController::license_type() ) { |
| 89 |
esc_html_e( 'Upgrade to PRO', 'formidable' ); |
| 90 |
} else { |
| 91 |
esc_html_e( 'Upgrade Now', 'formidable' ); |
| 92 |
} |
| 93 |
?> |
| 94 |
</a> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
|