| @@ -2,8 +2,12 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Add-Ons addon view. |
| 4 | 4 | * |
| 5 | 5 | * @package Formidable |
| 6 | + * | |
| 7 | + * @var array $addon Single add-on data (slug, title, display_name, excerpt, status, docs, docs_label, is_new, etc.). | |
| 8 | + * @var string $license_type Current license type or empty string. | |
| 9 | + * @var string $pricing Upgrade URL used for CTAs. | |
| 6 | 10 | */ |
| 7 | 11 | |
| 8 | 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 13 | die( 'You are not allowed to call this page directly.' ); |
| @@ -29,9 +33,15 @@ | ||
| 29 | 33 | ?> |
| 30 | 34 | </h3> |
| 31 | 35 | |
| 32 | 36 | <?php |
| 33 | - if ( ! FrmAddonsHelper::is_locked() ) { | |
| 37 | + if ( FrmAddonsHelper::is_locked() ) { | |
| 38 | + ?> | |
| 39 | + <span class="frm-card-lock-icon frm-ml-auto"> | |
| 40 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_lock_icon', array( 'aria-label' => __( 'Lock icon', 'formidable' ) ) ); ?> | |
| 41 | + </span> | |
| 42 | + <?php | |
| 43 | + } else { | |
| 34 | 44 | FrmAddonsController::show_conditional_action_button( |
| 35 | 45 | array( |
| 36 | 46 | 'addon' => $addon, |
| 37 | 47 | 'license_type' => ! empty( $license_type ) ? $license_type : false, |
| @@ -49,14 +59,8 @@ | ||
| 49 | 59 | 'echo' => true, |
| 50 | 60 | 'aria-label-attr' => $addon['title'], |
| 51 | 61 | ) |
| 52 | 62 | ); |
| 53 | - } else { | |
| 54 | - ?> | |
| 55 | - <span class="frm-card-lock-icon frm-ml-auto"> | |
| 56 | - <?php FrmAppHelper::icon_by_class( 'frmfont frm_lock_icon', array( 'aria-label' => __( 'Lock icon', 'formidable' ) ) ); ?> | |
| 57 | - </span> | |
| 58 | - <?php | |
| 59 | 63 | }//end if |
| 60 | 64 | ?> |
| 61 | 65 | </div> |
| 62 | 66 | |
| @@ -68,11 +72,12 @@ | ||
| 68 | 72 | |
| 69 | 73 | <div class="frm-flex frm-items-center frm-justify-between"> |
| 70 | 74 | <?php |
| 71 | 75 | if ( ! empty( $addon['docs'] ) && ! FrmAddonsHelper::get_plan() ) { |
| 76 | + $docs_label = ! empty( $addon['docs_label'] ) ? $addon['docs_label'] : __( 'View Docs', 'formidable' ); | |
| 72 | 77 | ?> |
| 73 | - <a class="frm-link-with-external-icon" href="<?php echo esc_url( $addon['docs'] ); ?>" target="_blank" aria-label="<?php esc_attr_e( 'View Docs', 'formidable' ); ?>"> | |
| 74 | - <?php esc_html_e( 'View Docs', 'formidable' ); ?> | |
| 78 | + <a class="frm-link-with-external-icon" href="<?php echo esc_url( $addon['docs'] ); ?>" target="_blank" aria-label="<?php echo esc_attr( $docs_label ); ?>"> | |
| 79 | + <?php echo esc_html( $docs_label ); ?> | |
| 75 | 80 | <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowup8_icon' ); ?> |
| 76 | 81 | </a> |
| 77 | 82 | <?php |
| 78 | 83 | } else { |