<?php 
/**
 * mediapulse Customizer Controls
 *
 * @package mediapulse
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'mediapulse_Customizer' ) ) :

	/**
	 * The mediapulse Customizer class
	*/
	class mediapulse_Customizer {

		/**
		 * Setup class
		*/
		public function __construct() {

			add_action( 'customize_register', 					array( $this, 'mediapulse_custom_controls' ) );
			add_action( 'customize_register', 					array( $this, 'mediapulse_controls_helpers' ) );
			add_action( 'after_setup_theme',  					array( $this, 'mediapulse_register_options' ) );

		}


		/**
		 * Adds custom controls
		*/
		public function mediapulse_custom_controls( $wp_customize ) {

			// Load customize control classes
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/custom-controls/toggle/class-toggle-control.php' );
				
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/custom-controls/customizer-image-radio/customizer-image-radio.php' );
			
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/custom-controls/dropdown-posts/dropdown-posts-control.php' );
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/custom-controls/sortable/class-sortable-control.php' );

			// Register custom controls
			$wp_customize->register_control_type('mediapulse_Toggle_Control');
			$wp_customize->register_control_type( 'mediapulse_Control_Sortable' );
		}


		/**
		 * Adds customizer helpers
		*/
		public function mediapulse_controls_helpers() {
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/sanitize-callback.php' );
		}


		/**
		 * Adds customizer options
		*/
		public function mediapulse_register_options() {

			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/settings/general-settings.php' );
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/settings/theme-header.php' );
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/settings/theme-settings.php' );
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/settings/theme-footer.php' );
			require_once ( MEDIAPULSE_TEMPLATE_DIR . '/lib/customizer/settings/front-sections.php' );
			
		}


	}

endif;

new mediapulse_Customizer();