<?php $global_sett = new Eventprime_Global_Settings(); ?>
<div class="ep-setting-tab-content">
    <input type="hidden" name="em_setting_type" value="general_tab_settings">
    <ul class="subsubsub">
        <?php
        if (isset($_GET['tab_nonce']) && isset( $_GET['sub_tab'] ) && wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['tab_nonce'])), 'ep_settings_tab'))
        {
            $sub_tab = sanitize_text_field(wp_unslash($_GET['sub_tab']));
            $active_sub_tab = isset( $sub_tab ) && array_key_exists( $sub_tab, $global_sett->ep_get_general_settings_sub_tabs() ) ? $sub_tab : 'regular';
        }
        else
        {
            $active_sub_tab = 'regular';
        }
        $nonce = wp_create_nonce('ep_settings_tab');
        foreach ( $global_sett->ep_get_general_settings_sub_tabs() as $sub_tab_id => $sub_tab_name ) {
            $sub_tab_url = add_query_arg( 
                array(
                    'sub_tab' => $sub_tab_id,'tab_nonce'=>$nonce 
                )
            );
            $sub_active = $active_sub_tab == $sub_tab_id ? 'current' : '';

            echo '<li><a href="' . esc_url( $sub_tab_url ) . '" title="' . esc_attr( $sub_tab_name ) . '" class="' . esc_attr($sub_active) . '">';
                echo esc_html( $sub_tab_name );
            echo '</a> | </li>';
        }?>
    </h3>
    <?php 
    $global_sett->ep_get_settings_general_tabs_content( $active_sub_tab ); ?>
</ul>
