<?php
function dancemaster_header_settings( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	/*=========================================
	Header Settings Panel
	=========================================*/
	$wp_customize->add_panel( 
		'header_section', 
		array(
			'priority'      => 2,
			'capability'    => 'edit_theme_options',
			'title'			=> __('Header', 'dance-master'),
		) 
	);

	
	/*=========================================
	Dance Master Site Identity
	=========================================*/
	$wp_customize->add_section(
        'title_tagline',
        array(
        	'priority'      => 1,
            'title' 		=> __('Site Identity','dance-master'),
			'panel'  		=> 'header_section',
		)
    );


	 // top header Site Title Color
	 $topheadersitetitlecol = esc_html__('#fff', 'dance-master' );
	 $wp_customize->add_setting(
		 'topheader_sitetitlecol',
		 array(
			 'default' => $topheadersitetitlecol,
			 'capability'     	=> 'edit_theme_options',
			 'sanitize_callback' => 'wp_kses_post',
			 'priority'      => 2,
		 )
	 );	
 
	 $wp_customize->add_control( 
		 'topheader_sitetitlecol',
		 array(
			 'label'   		=> __('Site Title Color','dance-master'),
			 'section'		=> 'title_tagline',
			 'type' 			=> 'color',
			 'transport'         => $selective_refresh,
		 )  
	 );

	 // top header Site border Color
	 $topheadersitebordercol = esc_html__('#fd053f', 'dance-master' );
	 $wp_customize->add_setting(
		 'topheader_sitebordercol',
		 array(
			 'default' => $topheadersitebordercol,
			 'capability'     	=> 'edit_theme_options',
			 'sanitize_callback' => 'wp_kses_post',
			 'priority'      => 2,
		 )
	 );	
 
	 $wp_customize->add_control( 
		 'topheader_sitebordercol',
		 array(
			 'label'   		=> __('Site Title Border Color','dance-master'),
			 'section'		=> 'title_tagline',
			 'type' 			=> 'color',
			 'transport'         => $selective_refresh,
		 )  
	 );

	 // top header Tagline Color
	$topheadertaglinecol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
    	'topheader_taglinecol',
    	array(
			'default' => $topheadertaglinecol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'topheader_taglinecol',
		array(
		    'label'   		=> __('Tagline Color','dance-master'),
		    'section'		=> 'title_tagline',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);
	
  

	/*=========================================
	Dance Master header
	=========================================*/
	$wp_customize->add_section(
        'top_header',
        array(
        	'priority'      => 5,
            'title' 		=> __('Header','dance-master'),
			'panel'  		=> 'header_section',
		)
    );	

	
	$wp_customize->add_setting('dancemaster_reset_header_settings',array(
		'sanitize_callback'   => 'sanitize_text_field'
	  ));
	  $wp_customize->add_control(new dancemaster_Reset_Custom_Control($wp_customize, 'dancemaster_reset_header_settings',array(
		'type' => 'reset_control',
		 'priority' => 1,
		'label' => __('Reset Header Settings', 'dance-master'),
		'description' => 'dancemaster_header_reset_settings',
		'section' => 'top_header'
	  )));
  
  
  
	  $wp_customize->add_setting('dancemaster_top_header_tabs', array(
		 'sanitize_callback' => 'wp_kses_post',
	  ));
  
	  $wp_customize->add_control(new dancemaster_Tab_Control($wp_customize, 'dancemaster_top_header_tabs', array(
		 'section' => 'top_header',
		 'priority' => 1,
		 'buttons' => array(
			array(
			   'name' => esc_html__('General', 'dance-master'),
			   'icon' => 'dashicons dashicons-welcome-write-blog',
			  'fields' => array(
				  'hide_show_sticky',
				  'topheader_phn',
				  'topheader_phnicon'
  
			  ),
			  'active' => true,
		   ),
			array(
			  'name' => esc_html__('Style', 'dance-master'),
			  'icon' => 'dashicons dashicons-art',
			  'fields' => array(
				'topheader_menucol',
				'topheader_menuiconcol',
				'topheader_menuhovercol',
				'topheader_submenucol',
				'topheader_submenuiconcol',
				'topheader_submenuhrvcol',
				'topheader_submenubgcol',
				'topheader_phonenoiconcol',
				'topheader_phonenotextcol'
			  ),
		   )
		  
		  ),
	  )));
  
  

	// general

	// sticky header
	$wp_customize->add_setting( 'hide_show_sticky',array(
        'default' => false,
        'sanitize_callback' => 'dancemaster_switch_sanitization'
   	) );
   	$wp_customize->add_control( new dancemaster_Toggle_Switch_Custom_Control( $wp_customize, 'hide_show_sticky',array(
        'label' => __( 'Show Sticky Header','dance-master' ),
        'section' => 'top_header'
   	)));



	
	// topheader Phone Number
	$topheaderphn = esc_html__('+(012)1234 5678', 'dance-master' );
	$wp_customize->add_setting(
    	'topheader_phn',
    	array(
			'default' => $topheaderphn,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'topheader_phn',
		array(
		    'label'   		=> __('Phone Number','dance-master'),
		    'section'		=> 'top_header',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);		


	// topheader phone number icon
	$topheaderphnicon = esc_html__('fa fa-phone', 'dance-master' );
	$wp_customize->add_setting(
    	'topheader_phnicon',
    	array(
			'default' => $topheaderphnicon,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'topheader_phnicon',
		array(
		    'label'   		=> __('Phone Number Icon','dance-master'),
		    'section'		=> 'top_header',
			'type' 			=> 'icon',
			'transport'         => $selective_refresh,
		)  
	);	

	// style
	// top header menu Color
	$topheadermenucol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_menucol',
		array(
			'default' => $topheadermenucol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_menucol',
		array(
			'label'   		=> __('Menu Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header menuicon Color
	$topheadermenuiconcol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_menuiconcol',
		array(
			'default' => $topheadermenuiconcol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_menuiconcol',
		array(
			'label'   		=> __('Menu Icon Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header menuhover Color
	$topheadermenuhovercol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_menuhovercol',
		array(
			'default' => $topheadermenuhovercol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_menuhovercol',
		array(
			'label'   		=> __('Menu Hover Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header submenu Color
	$topheadersubmenucol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_submenucol',
		array(
			'default' => $topheadersubmenucol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_submenucol',
		array(
			'label'   		=> __('SubMenu Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header submenuicon Color
	$topheadersubmenuiconcol = esc_html__('#fd053f', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_submenuiconcol',
		array(
			'default' => $topheadersubmenuiconcol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_submenuiconcol',
		array(
			'label'   		=> __('SubMenu Icon Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header submenuhvr Color
	$topheadersubmenuhvrcol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_submenuhrvcol',
		array(
			'default' => $topheadersubmenuhvrcol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_submenuhrvcol',
		array(
			'label'   		=> __('SubMenu Hover Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header submenubg Color
	$topheadersubmenubgcol = esc_html__('#000', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_submenubgcol',
		array(
			'default' => $topheadersubmenubgcol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_submenubgcol',
		array(
			'label'   		=> __('SubMenu BG Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header phonenoicon Color
	$topheaderphonenoiconcol = esc_html__('#fd053f', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_phonenoiconcol',
		array(
			'default' => $topheaderphonenoiconcol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_phonenoiconcol',
		array(
			'label'   		=> __('Phone Number Icon Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// top header phonenotext Color
	$topheaderphonenotextcol = esc_html__('#fff', 'dance-master' );
	$wp_customize->add_setting(
		'topheader_phonenotextcol',
		array(
			'default' => $topheaderphonenotextcol,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'topheader_phonenotextcol',
		array(
			'label'   		=> __('Phone Number Text Color','dance-master'),
			'section'		=> 'top_header',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



	$wp_customize->register_control_type('dancemaster_Tab_Control');


}
add_action( 'customize_register', 'dancemaster_header_settings' );





