<?php
/**
* Header Banner Options.
*
* @package Online Learning LMS
*/

$online_learning_lms_default = online_learning_lms_get_default_theme_options();
$online_learning_lms_post_category_list = online_learning_lms_post_category_list();

$wp_customize->add_section( 'online_learning_lms_header_slider_setting',
    array(
    'title'      => esc_html__( 'Banner Settings', 'online-learning-lms' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'online_learning_lms_theme_home_pannel',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('online_learning_lms_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'online_learning_lms_sanitize_checkbox',
));
$wp_customize->add_control('online_learning_lms_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'online-learning-lms'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('online_learning_lms_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'online_learning_lms_sanitize_checkbox',
));
$wp_customize->add_control('online_learning_lms_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'online-learning-lms'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('online_learning_lms_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'online_learning_lms_sanitize_checkbox',
    )
);
$wp_customize->add_control('online_learning_lms_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'online-learning-lms'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('online_learning_lms_header_slider',
    array(
        'default' => $online_learning_lms_default['online_learning_lms_header_slider'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'online_learning_lms_sanitize_checkbox',
    )
);
$wp_customize->add_control('online_learning_lms_header_slider',
    array(
        'label' => esc_html__('Enable Banner', 'online-learning-lms'),
        'section' => 'online_learning_lms_header_slider_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('online_learning_lms_banner_background_image',
    array(
        'default' => $online_learning_lms_default['online_learning_lms_banner_background_image'],
        'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control(
    new WP_Customize_Image_Control( $wp_customize,'online_learning_lms_banner_background_image',
        array(
            'label' => __('Slider Background Image','online-learning-lms'),
            'section' => 'online_learning_lms_header_slider_setting',
            'settings' => 'online_learning_lms_banner_background_image',
        )
    )
);

$wp_customize->add_setting( 'online_learning_lms_header_banner_cat',
    array(
    'default'           => 'uncategorized',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'online_learning_lms_sanitize_select',
    )
);
$wp_customize->add_control( 'online_learning_lms_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Left Category', 'online-learning-lms' ),
    'section'     => 'online_learning_lms_header_slider_setting',
    'type'        => 'select',
    'choices'     => $online_learning_lms_post_category_list,
    )
);

// Our Courses Settings

$wp_customize->add_section( 'online_learning_lms_about_us_setting',
    array(
    'title'      => esc_html__( 'Our Courses Settings', 'online-learning-lms' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'online_learning_lms_theme_home_pannel',
    )
);

$wp_customize->add_setting('online_learning_lms_services',
    array(
        'default' => $online_learning_lms_default['online_learning_lms_services'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'online_learning_lms_sanitize_checkbox',
    )
);
$wp_customize->add_control('online_learning_lms_services',
    array(
        'label' => esc_html__('Enable Our Courses', 'online-learning-lms'),
        'section' => 'online_learning_lms_about_us_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'online_learning_lms_our_team_section_title',
    array(
    'default' => $online_learning_lms_default['online_learning_lms_our_team_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'online_learning_lms_our_team_section_title',
    array(
    'label'    => esc_html__( 'Courses Title', 'online-learning-lms' ),
    'section'  => 'online_learning_lms_about_us_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'online_learning_lms_our_team_section_short_title',
    array(
    'default' => $online_learning_lms_default['online_learning_lms_our_team_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'online_learning_lms_our_team_section_short_title',
    array(
    'label'    => esc_html__( 'Courses Heading', 'online-learning-lms' ),
    'section'  => 'online_learning_lms_about_us_setting',
    'type'     => 'text',
    )
);

// Step Guide - Static text (not editable)
$wp_customize->add_setting( 'online_learning_lms_course_steps',
    array(
        'sanitize_callback' => 'wp_kses_post',
    )
);

$wp_customize->add_control( new WP_Customize_Control(
    $wp_customize,
    'online_learning_lms_course_steps',
    array(
        'label'       => esc_html__( 'Steps to Add Courses', 'online-learning-lms' ),
        'description' => wp_kses_post( '
            <ol style="margin-left:15px;">
                <li><strong>Install & Activate the Courses Plugin</strong> (TGM will guide you).</li>
                <li>Create a new course from Dashboard → Tutor LMS → Courses → Add New.</li>
                <li>Upload a featured image (course thumbnail).</li>
                <li>Add course details: title, description, and level (Beginner/Intermediate).</li>
                <li>Publish the course to display it on the website.</li>
            </ol>
        ' ),
        'section'     => 'online_learning_lms_about_us_setting',
        'type'        => 'hidden', // hides input, shows description only
    )
));
