<?php
// Silence is golden.

	$settings = $this->get_settings_for_display();
    $id = $this->get_id();
    

    if( class_exists('SFWD_LMS') ) :
            $tab_count = count( $settings['list'] );
            ?>
            <div class="learndash-wrapper">
                <div class="ld-tabs <?php echo esc_attr( 'ld-tab-count-' . $tab_count ); ?>">
                    <div class="ld-tabs-navigation">
                        <?php
                        $i = 0;
                        foreach ( $settings['list'] as $tab ) :

                            $tab_class = 'ld-tab ' . ( 0 === $i ? 'ld-active' : '' );
                            ?>

                            <div class="<?php echo esc_attr( $tab_class ); ?>" data-ld-tab="<?php echo esc_attr( 'ld-tab-' . $tab['_id']); ?>">
                                <?php \Elementor\Icons_Manager::render_icon( $tab['tab_icon'] ); ?>
                                <span class="ld-text"><?php echo esc_attr( $tab['tab_title'] ); ?></span>
                            </div>
                                <?php
                                $i++;
                            endforeach;
                        ?>
                    </div>

                    <div class="ld-tabs-content">
                        <?php 
                            $i = 0;
                            foreach ( $settings['list'] as $tab ) :
                                $tab_class = 'ld-tab-content ' . ( 0 === $i ? 'ld-visible' : '' );
                                ?>
                    
                                <div class="<?php echo esc_attr( $tab_class ); ?>" id="<?php echo esc_attr( 'ld-tab-' . $tab['_id'] ); ?>">
                                    <?php
                                        if( $tab['tab_content_source'] == 'editor' ) {
                                            echo wp_kses_post($tab['tab_content_editor']);
                                        } else {
                                            if( !empty( $tab['tab_content_learndash_template'] ) ) {
                                                echo do_shortcode( '[wkfe-ld-template id="'.$tab['tab_content_learndash_template'].'"]' );
                                            }
                                        }
                                    ?>
                                </div>
                    
                                <?php
                                $i++;
                            endforeach;
                        ?>
                    </div>
                </div>
            </div>
    <?php
        else :
    ?>
        <div class="plugin-active-massage">
            <h3><?php esc_html_e('Please activate LearnDash LMS plugin first', 'widgetkit-pro');?></h3>
        </div>
    <?php
    endif;
