<?php
/**
 * Soma Theme Customizer
 *
 * @package somalite
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */

if ( ! function_exists( 'somalite_customize_register' ) ) :
function somalite_customize_register( $wp_customize ) {

    require( get_template_directory() . '/inc/customizer/custom-controls/control-custom-content.php' );  

    // Add custom controls.
    require get_parent_theme_file_path( 'inc/customizer/custom-controls/info/class-info-control.php' );
    require get_parent_theme_file_path( 'inc/customizer/custom-controls/info/class-title-info-control.php' );
    require get_parent_theme_file_path( 'inc/customizer/custom-controls/toggle-button/class-login-designer-toggle-control.php' );
    require get_parent_theme_file_path( 'inc/customizer/custom-controls/radio-images/class-radio-image-control.php' );
    require get_parent_theme_file_path( 'inc/customizer/custom-controls/slider/class-slider-control.php' );


    // Register the custom control type.
    $wp_customize->register_control_type( 'Somalite_Toggle_Control' );

}
endif;
add_action( 'customize_register', 'somalite_customize_register' );

//site title settings
get_template_part( 'inc/customizer/options/section-site-title' );

//topbar settings
get_template_part( 'inc/customizer/options/section-topbar' );

//general settings
get_template_part( 'inc/customizer/options/section-general' );

//header styles settings
get_template_part( 'inc/customizer/options/section-header-styles' );

//sticky header settings
get_template_part( 'inc/customizer/options/section-sticky-header' );

//page settings
get_template_part( 'inc/customizer/options/section-page' );

//color settings
get_template_part( 'inc/customizer/options/section-color' );

//fonts settings
get_template_part( 'inc/customizer/options/section-fonts' );

//shop settings
get_template_part( 'inc/customizer/options/section-shop' );

//blog settings
get_template_part( 'inc/customizer/options/section-blog' );

//footer settings
get_template_part( 'inc/customizer/options/section-footer' );

//misc settings
get_template_part( 'inc/customizer/options/section-misc' );

//preloader settings
get_template_part( 'inc/customizer/options/section-preloader' );

//customizer helper
get_template_part( 'inc/customizer/customizer-helpers' );

//data sanitization
get_template_part( 'inc/customizer/data-sanitization' );




/**
 * Enqueue the customizer stylesheet.
 */
if ( ! function_exists( 'somalite_enqueue_customizer_stylesheets' ) ) :
function somalite_enqueue_customizer_stylesheets() {
    wp_register_style( 'customizer-css', get_template_directory_uri() . '/inc/customizer/assets/customizer.css', NULL, NULL, 'all' );
    wp_enqueue_style( 'customizer-css' );
}
endif;

add_action( 'customize_controls_print_styles', 'somalite_enqueue_customizer_stylesheets' );
