<?php
/**
 * advance-education-pro Theme Customizer
 *
 * @package advance-education-pro
 */
/**
 * Loads custom control for layout settings
 */
function advance_education_pro_custom_controls() {
  require_once get_template_directory() . '/inc/customize/controls/admin/customize-texteditor-control.php';
    require_once get_template_directory() . '/inc/customize/controls/custom-controls.php';
     // Inlcude the Alpha Color Picker control file.
    require_once get_template_directory() . '/inc/customize/controls/alpha-color-picker.php';
     get_stylesheet_directory_uri() . '/assets/js/alpha-color-picker.js';
     get_stylesheet_directory_uri() . '/assets/css/alpha-color-picker.css';

}
add_action( 'customize_register', 'advance_education_pro_custom_controls' );
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function advance_education_pro_customize_register( $wp_customize ) {
    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
    $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
    //add home page setting pannel

    $wp_customize->selective_refresh->add_partial( 'blogname', array(
        'selector' => '.logo a',
        'render_callback' => 'twentyfifteen_customize_partial_blogname',
    ) );
    $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
        'selector' => '.site-description',
        'render_callback' => 'twentyfifteen_customize_partial_blogdescription',
    ) );
    $wp_customize->add_setting('advance_education_pro_display_title',array(
        'default' => 'false',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('advance_education_pro_display_title',array(
        'type' => 'checkbox',
        'label' => __('Show Title','advance-education-pro'),
        'section' => 'title_tagline',
    ));
    $wp_customize->add_setting('advance_education_pro_display_tagline',array(
        'default' => 'false',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('advance_education_pro_display_tagline',array(
        'type' => 'checkbox',
        'label' => __('Show Tagline','advance-education-pro'),
        'section' => 'title_tagline',
    ));

    $wp_customize->add_panel( 'advance_education_pro_panel_id', array(
        'priority' => 10,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => __( 'Theme Settings', 'advance-education-pro' ),
        'description' => __( 'Description of what this panel does.', 'advance-education-pro' ),
    ) );

    $font_array = array(
        '' => __( 'No Fonts', 'advance-education-pro' ),
        'Abril Fatface' => __( 'Abril Fatface', 'advance-education-pro' ),
        'Acme' => __( 'Acme', 'advance-education-pro' ),
        'Anton' => __( 'Anton', 'advance-education-pro' ),
        'Architects Daughter' => __( 'Architects Daughter', 'advance-education-pro' ),
        'Arimo' => __( 'Arimo', 'advance-education-pro' ),
        'Arsenal' => __( 'Arsenal', 'advance-education-pro' ),
        'Arvo' => __( 'Arvo', 'advance-education-pro' ),
        'Alegreya' => __( 'Alegreya', 'advance-education-pro' ),
        'Alfa Slab One' => __( 'Alfa Slab One', 'advance-education-pro' ),
        'Averia Serif Libre' => __( 'Averia Serif Libre', 'advance-education-pro' ),
        'Bangers' => __( 'Bangers', 'advance-education-pro' ),
        'Boogaloo' => __( 'Boogaloo', 'advance-education-pro' ),
        'Bad Script' => __( 'Bad Script', 'advance-education-pro' ),
        'Bitter' => __( 'Bitter', 'advance-education-pro' ),
        'Bree Serif' => __( 'Bree Serif', 'advance-education-pro' ),
        'BenchNine' => __( 'BenchNine', 'advance-education-pro' ),
        'Cabin' => __( 'Cabin', 'advance-education-pro' ),
        'Cardo' => __( 'Cardo', 'advance-education-pro' ),
        'Courgette' => __( 'Courgette', 'advance-education-pro' ),
        'Cherry Swash' => __( 'Cherry Swash', 'advance-education-pro' ),
        'Cormorant Garamond' => __( 'Cormorant Garamond', 'advance-education-pro' ),
        'Crimson Text' => __( 'Crimson Text', 'advance-education-pro' ),
        'Cuprum' => __( 'Cuprum', 'advance-education-pro' ),
        'Cookie' => __( 'Cookie', 'advance-education-pro' ),
        'Chewy' => __( 'Chewy', 'advance-education-pro' ),
        'Days One' => __( 'Days One', 'advance-education-pro' ),
        'Dosis' => __( 'Dosis', 'advance-education-pro' ),
        'Economica' => __( 'Economica', 'advance-education-pro' ),
        'Fredoka One' => __( 'Fredoka One', 'advance-education-pro' ),
        'Fjalla One' => __( 'Fjalla One', 'advance-education-pro' ),
        'Francois One' => __( 'Francois One', 'advance-education-pro' ),
        'Frank Ruhl Libre' => __( 'Frank Ruhl Libre', 'advance-education-pro' ),
        'Gloria Hallelujah' => __( 'Gloria Hallelujah', 'advance-education-pro' ),
        'Great Vibes' => __( 'Great Vibes', 'advance-education-pro' ),
        'Handlee' => __( 'Handlee', 'advance-education-pro' ),
        'Hammersmith One' => __( 'Hammersmith One', 'advance-education-pro' ),
        'Inconsolata' => __( 'Inconsolata', 'advance-education-pro' ),
        'Indie Flower' => __( 'Indie Flower', 'advance-education-pro' ),
        'IM Fell English SC' => __( 'IM Fell English SC', 'advance-education-pro' ),
        'Julius Sans One' => __( 'Julius Sans One', 'advance-education-pro' ),
        'Josefin Slab' => __( 'Josefin Slab', 'advance-education-pro' ),
        'Josefin Sans' => __( 'Josefin Sans', 'advance-education-pro' ),
        'Kanit' => __( 'Kanit', 'advance-education-pro' ),
        'Lobster' => __( 'Lobster', 'advance-education-pro' ),
        'Lato' => __( 'Lato', 'advance-education-pro' ),
        'Lora' => __( 'Lora', 'advance-education-pro' ),
        'Libre Baskerville' => __( 'Libre Baskerville', 'advance-education-pro' ),
        'Lobster Two' => __( 'Lobster Two', 'advance-education-pro' ),
        'Merriweather' => __( 'Merriweather', 'advance-education-pro' ),
        'Monda' => __( 'Monda', 'advance-education-pro' ),
        'Montserrat' => __( 'Montserrat', 'advance-education-pro' ),
        'Muli' => __( 'Muli', 'advance-education-pro' ),
        'Marck Script' => __( 'Marck Script', 'advance-education-pro' ),
        'Noto Serif' => __( 'Noto Serif', 'advance-education-pro' ),
        'Open Sans' => __( 'Open Sans', 'advance-education-pro' ),
        'Overpass' => __( 'Overpass', 'advance-education-pro' ),
        'Overpass Mono' => __( 'Overpass Mono', 'advance-education-pro' ),
        'Oxygen' => __( 'Oxygen', 'advance-education-pro' ),
        'Orbitron' => __( 'Orbitron', 'advance-education-pro' ),
        'Patua One' => __( 'Patua One', 'advance-education-pro' ),
        'Pacifico' => __( 'Pacifico', 'advance-education-pro' ),
        'Padauk' => __( 'Padauk', 'advance-education-pro' ),
        'Playball' => __( 'Playball', 'advance-education-pro' ),
        'Playfair Display' => __( 'Playfair Display', 'advance-education-pro' ),
        'PT Sans' => __( 'PT Sans', 'advance-education-pro' ),
        'Philosopher' => __( 'Philosopher', 'advance-education-pro' ),
        'Permanent Marker' => __( 'Permanent Marker', 'advance-education-pro' ),
        'Poiret One' => __( 'Poiret One', 'advance-education-pro' ),
        'Quicksand' => __( 'Quicksand', 'advance-education-pro' ),
        'Quattrocento Sans' => __( 'Quattrocento Sans', 'advance-education-pro' ),
        'Raleway' => __( 'Raleway', 'advance-education-pro' ),
        'Rubik' => __( 'Rubik', 'advance-education-pro' ),
        'Rokkitt' => __( 'Rokkitt', 'advance-education-pro' ),
        'Russo One' => __( 'Russo One', 'advance-education-pro' ),
        'Righteous' => __( 'Righteous', 'advance-education-pro' ),
        'Slabo' => __( 'Slabo', 'advance-education-pro' ),
        'Source Sans Pro' => __( 'Source Sans Pro', 'advance-education-pro' ),
        'Shadows Into Light Two' => __( 'Shadows Into Light Two', 'advance-education-pro'),
        'Shadows Into Light' => __( 'Shadows Into Light', 'advance-education-pro' ),
        'Sacramento' => __( 'Sacramento', 'advance-education-pro' ),
        'Shrikhand' => __( 'Shrikhand', 'advance-education-pro' ),
        'Tangerine' => __( 'Tangerine', 'advance-education-pro' ),
        'Ubuntu' => __( 'Ubuntu', 'advance-education-pro' ),
        'VT323' => __( 'VT323', 'advance-education-pro' ),
        'Varela Round' => __( 'Varela Round', 'advance-education-pro' ),
        'Vampiro One' => __( 'Vampiro One', 'advance-education-pro' ),
        'Vollkorn' => __( 'Vollkorn', 'advance-education-pro' ),
        'Volkhov' => __( 'Volkhov', 'advance-education-pro' ),
        'Yanone Kaffeesatz' => __( 'Yanone Kaffeesatz', 'advance-education-pro' )
    );


        
    require_once get_template_directory() . '/inc/customize/controls/button-controls.php';
    require_once get_template_directory() . '/inc/customize/controls/social-icons/social-icon-picker.php';
    require_once get_template_directory() . '/inc/customize/controls/slider-line-control/slider-line-control.php';
    require_once get_template_directory() . '/inc/customize/controls/customizer-notice/class/customizer-notice.php';
    require_once get_template_directory() . '/inc/customize/controls/customizer-text-radio-button/class/customizer-text-radio-button.php';
    require_once get_template_directory() . '/inc/customize/controls/customize-repeater/customize-repeater.php';
     require_once get_template_directory() . '/inc/customize/controls/customizer-seperator/class/customizer-seperator.php';
    if(varifying_status_key_activation()){

       //general Settings
    require_once get_template_directory(). '/inc/customize/sections/customizer-custom-variables.php';
    //Header
    require_once get_template_directory(). '/inc/customize/sections/customizer-part-top-bar.php';
     //Header
    require_once get_template_directory(). '/inc/customize/sections/customizer-part-header.php';
    //Home page sections
    require_once get_template_directory(). '/inc/customize/sections/customizer-part-slide.php';
      //Home page sections
    require get_template_directory() . '/inc/customize/sections/customizer-part-home.php';
    //Footer
    require_once get_template_directory(). '/inc/customize/sections/customizer-part-footer.php';

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

load_template( trailingslashit( get_template_directory() ) . '/inc/logo/logo-resizer.php' );
//Integer
function advance_education_pro_sanitize_integer( $input ) {
    if( is_numeric( $input ) ) {
        return intval( $input );
    }
}

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class advance_education_pro_customize {
    /**
     * Returns the instance.
     *
     * @since  1.0.0
     * @access public
     * @return object
     */
    public static function get_instance() {
        static $instance = null;
        if ( is_null( $instance ) ) {
            $instance = new self;
            $instance->setup_actions();
        }
        return $instance;
    }
    /**
     * Constructor method.
     *
     * @since  1.0.0
     * @access private
     * @return void
     */
    private function __construct() {}
    /**
     * Sets up initial actions.
     *
     * @since  1.0.0
     * @access private
     * @return void
     */
    private function setup_actions() {
        // Register panels, sections, settings, controls, and partials.
        add_action( 'customize_register', array( $this, 'sections' ) );
        // Register scripts and styles for the controls.
        add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
    }
    /**
     * Sets up the customizer sections.
     *
     * @since  1.0.0
     * @access public
     * @param  object  $manager
     * @return void
     */
    public function sections( $manager ) {
        // Load custom sections.
        load_template( trailingslashit( get_template_directory() ) . '/inc/review-section.php' );
        // Register custom section types.
        $manager->register_section_type( 'advance_education_pro_customize_reviews_and_testimonials' );
        // Register sections.
        $manager->add_section(
            new advance_education_pro_customize_reviews_and_testimonials(
                $manager,
                'example_1',
                array(
                    'title'    => esc_html__( 'Review & Testimonial', 'advance-education-pro' ),
                    'reviews_and_testimonials_text' => esc_html__( 'Rate Us', 'advance-education-pro' ),
                    'reviews_and_testimonials_url'  => 'https://www.themeshopy.com/forum/reviews-and-testimonials/'
                )
            )
        );
    }
    /**
     * Loads theme customizer CSS.
     *
     * @since  1.0.0
     * @access public
     * @return void
     */
       public function enqueue_control_scripts() {
       wp_enqueue_script( 'advance-education-pro-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) );
        wp_enqueue_style( 'advance-education-pro-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/css/customize-controls.css' );
    }
}
// Doing this customizer thang!
advance_education_pro_customize::get_instance();


