<?php

function educational_institute_remove_customize_register() {
    global $wp_customize;

    $wp_customize->remove_setting( 'elearning_education_login_button' );
    $wp_customize->remove_control( 'elearning_education_login_button' );

    $wp_customize->remove_setting( 'elearning_education_login_button_link' );
    $wp_customize->remove_control( 'elearning_education_login_button_link' );

    $wp_customize->remove_setting( 'elearning_education_header_teacher' );
    $wp_customize->remove_control( 'elearning_education_header_teacher' );

    $wp_customize->remove_setting( 'elearning_education_header_wishlist_url' );
    $wp_customize->remove_control( 'elearning_education_header_wishlist_url' );

     $wp_customize->remove_setting( 'elearning_education_tp_footer_bg_color_option' );
    $wp_customize->remove_control( 'elearning_education_tp_footer_bg_color_option' );

    $wp_customize->remove_setting( 'elearning_education_footer_widget_image' );
    $wp_customize->remove_control( 'elearning_education_footer_widget_image' );

    $wp_customize->remove_setting( 'elearning_education_slider_content_layout' );
    $wp_customize->remove_control( 'elearning_education_slider_content_layout' );

    $wp_customize->remove_setting( 'elearning_education_show_slider_content' );
    $wp_customize->remove_control( 'elearning_education_show_slider_content' );

    $wp_customize->remove_setting( 'elearning_education_slider_top' );
    $wp_customize->remove_control( 'elearning_education_slider_top' );

    $wp_customize->remove_setting( 'elearning_education_tp_secoundary_color_option' );
    $wp_customize->remove_control( 'elearning_education_tp_secoundary_color_option' );

    $wp_customize->remove_setting( 'elearning_education_slider_opacity_setting' );
    $wp_customize->remove_control( 'elearning_education_slider_opacity_setting' );

    $wp_customize->remove_setting( 'elearning_education_image_opacity_color' );
    $wp_customize->remove_control( 'elearning_education_image_opacity_color' );

    $wp_customize->remove_setting( 'elearning_education_slider_opacity' );
    $wp_customize->remove_control( 'elearning_education_slider_opacity' );
}
add_action( 'customize_register', 'educational_institute_remove_customize_register', 11 );

if ( ! defined( 'EDUCATIONAL_INSTITUTE_TEXT' ) ) {
    define( 'EDUCATIONAL_INSTITUTE_TEXT', __( 'Educational Institute Pro','educational-institute' ));
}
if ( ! defined( 'EDUCATIONAL_INSTITUTE_BUY_TEXT' ) ) {
    define( 'EDUCATIONAL_INSTITUTE_BUY_TEXT', __( 'Upgrade Pro','educational-institute' ));
}


add_action( 'customize_register', function( $manager ) {

// Load custom sections.
load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' );

    $manager->register_section_type( elearning_education_Button::class );

    $manager->add_section(
        new elearning_education_Button( $manager, 'elearning_education_pro', [
            'title'       => esc_html( EDUCATIONAL_INSTITUTE_TEXT,'educational-institute' ),
            'priority'    => 0,
            'button_text' => __( 'GET PREMIUM', 'educational-institute' ),
            'button_url'  => esc_url( ELEARNING_EDUCATION_PRO_THEME_URL )
        ] )
    );

} );

function educational_institute_customize_register( $wp_customize ) {

    // Pro Version
    class educational_institute_Customize_Pro_Version extends WP_Customize_Control {
        public $type = 'pro_options';

        public function render_content() {
            echo '<span>Unlock Premium <strong>'. esc_html( $this->label ) .'</strong>? </span>';
            echo '<a href="'. esc_url($this->description) .'" target="_blank">';
                echo '<span class="dashicons dashicons-info"></span>';
                echo '<strong> '. esc_html( EDUCATIONAL_INSTITUTE_BUY_TEXT,'educational-institute' ) .'<strong></a>';
            echo '</a>';
        }
    }

    // Custom Controls
    function educational_institute_sanitize_custom_control( $input ) {
        return $input;
    }

    $wp_customize->add_setting('educational_institute_slider_content_layout',array(
        'default' => 'LEFT-ALIGN',
        'sanitize_callback' => 'elearning_education_sanitize_choices'
    ));
    $wp_customize->add_control('educational_institute_slider_content_layout',array(
        'type' => 'radio',
        'label'     => __('Slider Content Layout', 'educational-institute'),
        'section' => 'elearning_education_slider_section',
        'choices' => array(
            'LEFT-ALIGN' => __('LEFT-ALIGN','educational-institute'),
            'CENTER-ALIGN' => __('CENTER-ALIGN','educational-institute'),
            'RIGHT-ALIGN' => __('RIGHT-ALIGN','educational-institute'),
        ),
    ) );

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



