| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
// This view is used on the style page to render a single style card. |
| 6 |
// It is used for both custom style cards and card templates. |
| 7 |
// This includes a basic preview (text field and submit button only). |
| 8 |
// It also includes the title of the style and possibly some basic tags if "selected" or "default". |
| 9 |
|
| 10 |
$is_template = 0 === $style->ID; |
| 11 |
$include_info = $is_active_style; |
| 12 |
?> |
| 13 |
<div <?php FrmAppHelper::array_to_html_params( $params, true ); ?>> |
| 14 |
<div> |
| 15 |
<div class="frm-style-card-title-wrapper"> |
| 16 |
<?php |
| 17 |
if ( $is_active_style ) { |
| 18 |
FrmAppHelper::icon_by_class( 'frmfont frm_checkmark_circle_icon' ); |
| 19 |
} |
| 20 |
if ( ! empty( $is_locked ) ) { |
| 21 |
FrmAppHelper::icon_by_class( 'frmfont frm_lock_icon' ); |
| 22 |
} |
| 23 |
?> |
| 24 |
<?php |
| 25 |
// The rename option uses the text content of .frm-style-card-title so don't leave any additional whitespace here. |
| 26 |
?> |
| 27 |
<span class="frm-style-card-title"><?php echo esc_html( $style->post_title ); ?></span> |
| 28 |
<?php if ( $include_info ) { ?> |
| 29 |
<span class="frm-style-card-info"> |
| 30 |
<?php |
| 31 |
$info_text = __( 'Applied', 'formidable' ); |
| 32 |
echo '(' . esc_html( $info_text ) . ')'; |
| 33 |
?> |
| 34 |
</span> |
| 35 |
<?php } ?> |
| 36 |
<?php if ( ! empty( $is_new_template ) ) { ?> |
| 37 |
<span class="frm-meta-tag frm-new-pill"><?php esc_html_e( 'NEW', 'formidable' ); ?></span> |
| 38 |
<?php } ?> |
| 39 |
</div> |
| 40 |
<div class="frm-style-card-preview"> |
| 41 |
<div class="frm-color-blocks"> |
| 42 |
<?php |
| 43 |
$colors = array( |
| 44 |
'label-color' => $style->post_content['label_color'], |
| 45 |
'text-color' => $style->post_content['text_color'], |
| 46 |
'submit-bg-color' => $style->post_content['submit_bg_color'], |
| 47 |
); |
| 48 |
$index = 0; |
| 49 |
foreach ( $colors as $css_var_name => $color ) { |
| 50 |
if ( 0 !== strpos( $color, 'rgb' ) ) { |
| 51 |
$color = '#' . $color; |
| 52 |
} |
| 53 |
|
| 54 |
$circle_params = array( |
| 55 |
'class' => 'frm-style-circle' . absint( $index + 1 ), |
| 56 |
'style' => 'background-color: var(--' . $css_var_name . ')', |
| 57 |
); |
| 58 |
|
| 59 |
++$index; |
| 60 |
?> |
| 61 |
<div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div> |
| 62 |
<?php |
| 63 |
} |
| 64 |
?> |
| 65 |
</div> |
| 66 |
<div class="frm-style-card-separator"></div> |
| 67 |
<div class="frm-mini-form-style"> |
| 68 |
<div class="frm-button-style-example"> |
| 69 |
<div></div> |
| 70 |
</div> |
| 71 |
<div class="frm-input-style-example"> |
| 72 |
<div></div> |
| 73 |
</div> |
| 74 |
</div> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
</div> |
| 78 |
|