| @@ -27,10 +27,23 @@ | ||
| 27 | 27 | |
| 28 | 28 | if ( 'paypal' === $action_control->id_base ) { |
| 29 | 29 | $action_control->name = 'PayPal Commerce'; |
| 30 | 30 | } |
| 31 | + | |
| 32 | +// An action that needs a plan upgrade, as opposed to one this license can install with a single click. | |
| 33 | +$is_locked = isset( $data['data-upgrade'] ) && ! isset( $data['data-oneclick'] ); | |
| 34 | + | |
| 35 | +$li_classes = $group_class; | |
| 36 | + | |
| 37 | +if ( isset( $data['data-upgrade'] ) ) { | |
| 38 | + $li_classes .= ' frm-not-installed'; | |
| 39 | +} | |
| 40 | + | |
| 41 | +if ( $is_locked ) { | |
| 42 | + $li_classes .= ' frm-action-locked'; | |
| 43 | +} | |
| 31 | 44 | ?> |
| 32 | -<li class="frm-card-item frm-card-item--outlined frm-action<?php echo esc_attr( $group_class . ( isset( $data['data-upgrade'] ) ? ' frm-not-installed' : '' ) ); ?>" tabindex="0"> | |
| 45 | +<li class="frm-card-item frm-card-item--outlined frm-action<?php echo esc_attr( $li_classes ); ?>" tabindex="0"> | |
| 33 | 46 | <div class="frm-h-stack-xs frm-w-full"> |
| 34 | 47 | <span class="frm-border-icon frm-shrink-0"> |
| 35 | 48 | <?php FrmAppHelper::icon_by_class( $action_control->action_options['classes'], FrmFormActionsController::get_action_icon_atts( $action_control ) ); ?> |
| 36 | 49 | </span> |
| @@ -37,9 +50,9 @@ | ||
| 37 | 50 | |
| 38 | 51 | <div class="frm-flex-col frm-min-w-0"> |
| 39 | 52 | <h3 class="frm-h-stack-xs frm-capitalize"> |
| 40 | 53 | <?php |
| 41 | - if ( isset( $data['data-upgrade'] ) && ! isset( $data['data-oneclick'] ) ) { | |
| 54 | + if ( $is_locked ) { | |
| 42 | 55 | FrmAppHelper::icon_by_class( 'frmfont frm_lock_icon frm_svg15', array( 'aria-label' => __( 'Lock icon', 'formidable' ) ) ); |
| 43 | 56 | } |
| 44 | 57 | ?> |
| 45 | 58 | <span class="frm-font-medium frm-white-space-nowrap"><?php echo esc_html( str_replace( 'Add to ', '', $action_control->name ) ); ?></span> |
| @@ -54,10 +67,14 @@ | ||
| 54 | 67 | <?php } ?> |
| 55 | 68 | </div> |
| 56 | 69 | |
| 57 | 70 | <a <?php FrmAppHelper::array_to_html_params( $single_action_attrs, true ); ?>> |
| 58 | - <?php FrmAppHelper::icon_by_class( 'frmfont frm_plus_icon' ); ?> | |
| 59 | - <span><?php echo esc_html_x( 'Add', 'form action', 'formidable' ); ?></span> | |
| 71 | + <?php if ( $is_locked ) { ?> | |
| 72 | + <span><?php esc_html_e( 'Upgrade', 'formidable' ); ?></span> | |
| 73 | + <?php } else { ?> | |
| 74 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_plus_icon' ); ?> | |
| 75 | + <span><?php echo esc_html_x( 'Add', 'form action', 'formidable' ); ?></span> | |
| 76 | + <?php } ?> | |
| 60 | 77 | </a> |
| 61 | 78 | |
| 62 | 79 | <?php if ( ! empty( $action_control->action_options['keywords'] ) ) { ?> |
| 63 | 80 | <span class="frm_hidden"><?php echo esc_html( $action_control->action_options['keywords'] ); ?></span> |