onboarding-tabs.php
76 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The Template for displaying the BH Onboarding tabs. |
| 4 | * |
| 5 | * @var array $options The premium tab options array. |
| 6 | * |
| 7 | * @package YITH\PluginFramework\Templates |
| 8 | * @author Emanuela Castorina <emanuela.castorina@yithemes.com> |
| 9 | * @since 3.9.11 |
| 10 | */ |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 13 | $tabs = $options['tabs']; |
| 14 | ?> |
| 15 | <div class="woocommerce yith-plugin-fw-panel" id="yith-bh-onboarding" style="display: none"> |
| 16 | <header> |
| 17 | <div class="yith-bh-onboarding-logo"> |
| 18 | <?php if ( isset( $options['logo'] ) ) : ?> |
| 19 | <div class="logo"> |
| 20 | <img src="<?php echo esc_url( $options['logo'] ); ?>" width="150"/> |
| 21 | </div> |
| 22 | <?php endif; ?> |
| 23 | <?php if ( isset( $options['claim'] ) ) : ?> |
| 24 | <div class="claim"><?php echo esc_html( $options['claim'] ); ?></div> |
| 25 | <?php endif; ?> |
| 26 | </div> |
| 27 | <div class="yith-bh-onboarding-plugin-description"> |
| 28 | <?php if ( isset( $options['plugin-description'] ) ) : ?> |
| 29 | <div class="plugin-description"><?php echo wp_kses_post( $options['plugin-description'] ); ?></div> |
| 30 | <?php endif; ?> |
| 31 | </div> |
| 32 | </header> |
| 33 | <div class="yith-bh-onboarding-tabs yith-plugin-ui"> |
| 34 | <ul class="yith-bh-onboarding-tabs__nav"> |
| 35 | <?php |
| 36 | $c = 0; |
| 37 | foreach ( $tabs as $key => $tab ) : |
| 38 | ?> |
| 39 | <li class="yith-bh-onboarding-tabs__nav__link <?php echo ! ( $c ++ ) ? 'selected' : ''; ?>" data-tab="<?php esc_attr_e( $key ); ?>"><?php echo esc_html( $tab['title'] ); ?></li> |
| 40 | <?php |
| 41 | endforeach; |
| 42 | ?> |
| 43 | </ul> |
| 44 | <div class="yith-bh-onboarding-tabs__content yith-plugin-fw yit-admin-panel-container"> |
| 45 | <?php foreach ( $tabs as $key => $tab ) : ?> |
| 46 | <?php if ( isset( $tab['options'] ) ) : ?> |
| 47 | <div class="yith-bh-onboarding-tabs__tab" id="<?php echo esc_attr( $key ); ?>"> |
| 48 | <p class="yith-bh-onboarding-tab-description"><?php echo wp_kses_post( $tab['description'] ); ?></p> |
| 49 | <form class="yith-bh-onboarding-tabs__form" id="plugin-fw-wc"> |
| 50 | <table class="form-table"> |
| 51 | <?php |
| 52 | foreach ( $tab['options'] as $name => $option ) { |
| 53 | YIT_Plugin_Panel_WooCommerce::add_yith_field( $option ); |
| 54 | } |
| 55 | ?> |
| 56 | </table> |
| 57 | <?php if ( isset( $tab['show_save_button'] ) && $tab['show_save_button'] ) : ?> |
| 58 | <input type="hidden" name="yith-plugin" value="<?php echo esc_attr( $options['slug'] ); ?>"> |
| 59 | <input type="hidden" name="action" value="yith_bh_onboarding"> |
| 60 | <input type="hidden" name="tab" value="<?php echo esc_attr( $key ); ?>"> |
| 61 | <?php wp_nonce_field( 'yith-bh-onboarding-save-options' ); ?> |
| 62 | <div class="submit-area"> |
| 63 | <button id="yith-bh-save-button" class="button button-primary"><?php echo esc_html__( 'Save', 'yith-plugin-fw' ); ?></button> |
| 64 | </div> |
| 65 | <?php endif; ?> |
| 66 | </form> |
| 67 | </div> |
| 68 | <?php |
| 69 | endif; |
| 70 | endforeach; |
| 71 | |
| 72 | ?> |
| 73 | </div> |
| 74 | |
| 75 | </div> |
| 76 |