<?php
if( ! function_exists( 'relax_spa_register_custom_controls' ) ) :
/**
 * Register Custom Controls
*/
function relax_spa_register_custom_controls( $wp_customize ) {
    
    // Load our custom control.
    require_once get_template_directory() . '/inc/custom-controls/sortable/class-sortable-control.php';
    require_once get_template_directory() . '/inc/custom-controls/toggle/class-toggle-control.php';
    require_once get_template_directory() . '/inc/custom-controls/slider/class-slider-control.php';
    require_once get_template_directory() . '/inc/custom-controls/repeater/class-repeater-setting.php';
    require_once get_template_directory() . '/inc/custom-controls/repeater/class-control-repeater.php';
    require_once get_template_directory() . '/inc/custom-controls/select/class-select-control.php';
    require_once get_template_directory() . '/inc/custom-controls/radiobtn/class-radio-buttonset-control.php';

    require_once get_template_directory() . '/inc/custom-controls/notes.php';

    require get_template_directory() . '/inc/custom-controls/upgrade-to-pro/class-section-pro-control.php';
    require get_template_directory() . '/inc/custom-controls/upgrade-to-pro/class-control-upgrade-to-pro.php';
    require_once get_template_directory() . '/inc/custom-controls/separator/class-separator-control.php';

    $wp_customize->register_section_type( 'Relax_Spa_Customize_Section_Pro_Control' );
    // Register control types
    $wp_customize->register_control_type( 'Relax_Spa_Control_Sortable' );
    $wp_customize->register_control_type( 'Relax_Spa_Toggle_Control' );
    $wp_customize->register_control_type( 'Relax_Spa_Slider_Control' );
    $wp_customize->register_control_type( 'Relax_Spa_Select_Control' );
    $wp_customize->register_control_type( 'Relax_Spa_Control_Upgrade_To_Pro' );
    $wp_customize->register_control_type( 'Relax_Spa_Radio_Buttonset_Control' );
    $wp_customize->register_control_type( 'Relax_Spa_Separator_Control' );
 
}
endif;
add_action( 'customize_register', 'relax_spa_register_custom_controls' );


function relax_spa_enqueue_custom_admin_style() {
        wp_register_style( 'relax-spa-upgrade-to-pro', get_template_directory_uri() . '/inc/custom-controls/upgrade-to-pro/upgrade-to-pro.css', false );
        wp_enqueue_style( 'relax-spa-upgrade-to-pro' );

        wp_enqueue_script( 'relax-spa-upgrade-to-pro', get_template_directory_uri() . '/inc/custom-controls/upgrade-to-pro/upgrade-to-pro.js', array( 'jquery' ), false, true );
}
add_action( 'admin_enqueue_scripts', 'relax_spa_enqueue_custom_admin_style' );