<?php
/* ------------------------------------------------------------------------ *
 * Seja Framework Version 3.0
 *
 * 3.0 - Social page wrapper 
 *
 * ------------------------------------------------------------------------ */


function seja_menu_social_display() {
	if( isset( $_GET[ 'tab' ] ) ) {  
        $active_tab = $_GET[ 'tab' ];
		$page_number = '3';  
    } else {
		$active_tab = 'facebook';
		$page_number = '3';
	}
	?>
	<!-- Create a header in the default WordPress 'wrap' container --> 
    <div class="wrap seja-template">
    	<?php screen_icon(); ?>
	    <h2>Social Media Settings</h2>
        <h3 class="nav-tab-wrapper">
        	<a href="admin.php?page=seja-social-settings&amp;tab=facebook" class="nav-tab <?php echo $active_tab == 'facebook' ? 'nav-tab-active' : ''; ?>">Facebook</a>

            <a href="admin.php?page=seja-social-settings&amp;tab=google" class="nav-tab <?php echo $active_tab == 'google' ? 'nav-tab-active' : ''; ?>">Google +</a>
            <a href="admin.php?page=seja-social-settings&amp;tab=twitter" class="nav-tab <?php echo $active_tab == 'twitter' ? 'nav-tab-active' : ''; ?>">Twitter</a>
            <a href="admin.php?page=seja-social-settings&amp;tab=youtube" class="nav-tab <?php echo $active_tab == 'youtube' ? 'nav-tab-active' : ''; ?>">YouTube</a>
            <a href="admin.php?page=seja-social-settings&amp;tab=weather" class="nav-tab <?php echo $active_tab == 'weather' ? 'nav-tab-active' : ''; ?>">Weather</a>
        </h3>
        <?php settings_errors(); ?>
        
        <form method="post" action="options.php">
        <?php
			// tab 1
			if( $active_tab == 'facebook' ) {
				settings_fields( 'seja_facebook_options' ); 
				do_settings_sections( 'seja_facebook_options' );
			}
			// tab 2
			if( $active_tab == 'google' ) {
				settings_fields( 'seja_googleplus_options' ); 
				do_settings_sections( 'seja_googleplus_options' );
			}
			
			// tab 3
			if( $active_tab == 'twitter' ) {
				settings_fields( 'seja_twitter_options' );
				do_settings_sections( 'seja_twitter_options' );
				echo('To create your twitter feed, Log into your Twitter account, go to Settings > Widgets > Create New<br>
				Once configured, copy and paste the code here.');
			}
			// tab 4
			if( $active_tab == 'youtube' ) {
				settings_fields( 'seja_youtube_options' );
            	do_settings_sections( 'seja_youtube_options' );
			}
			// tab 5
			if( $active_tab == 'weather' ) {
				settings_fields( 'seja_weather_options' );
            	do_settings_sections( 'seja_weather_options' );
			}
		?>
         <?php submit_button(); ?> 
      </form>
	</div>
    <?php
} // end seja_menu_social_display


?>