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