<?php
/**
* Header Banner Options.
*
* @package Modern Art Gallery
*/

$modern_art_gallery_default = modern_art_gallery_get_default_theme_options();
$modern_art_gallery_post_category_list = modern_art_gallery_post_category_list();

$wp_customize->add_section( 'modern_art_gallery_header_banner_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'modern-art-gallery' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'modern_art_gallery_theme_home_pannel',
    )
);

// Show/Hide Site Logo
$wp_customize->add_setting('modern_art_gallery_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'modern_art_gallery_sanitize_checkbox',
));
$wp_customize->add_control('modern_art_gallery_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'modern-art-gallery'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('modern_art_gallery_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'modern_art_gallery_sanitize_checkbox',
));
$wp_customize->add_control('modern_art_gallery_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'modern-art-gallery'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('modern_art_gallery_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'modern_art_gallery_sanitize_checkbox',
    )
);
$wp_customize->add_control('modern_art_gallery_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'modern-art-gallery'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('modern_art_gallery_header_banner',
    array(
        'default' => $modern_art_gallery_default['modern_art_gallery_header_banner'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'modern_art_gallery_sanitize_checkbox',
    )
);
$wp_customize->add_control('modern_art_gallery_header_banner',
    array(
        'label' => esc_html__('Enable Slider', 'modern-art-gallery'),
        'section' => 'modern_art_gallery_header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'modern_art_gallery_header_banner_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'modern_art_gallery_sanitize_select',
    )
);
$wp_customize->add_control( 'modern_art_gallery_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Category', 'modern-art-gallery' ),
    'section'     => 'modern_art_gallery_header_banner_setting',
    'type'        => 'select',
    'choices'     => $modern_art_gallery_post_category_list,
    )
);

$wp_customize->add_setting( 'modern_art_gallery_slider_section_short_title',
    array(
    'default' => $modern_art_gallery_default['modern_art_gallery_slider_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'modern_art_gallery_slider_section_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'modern-art-gallery' ),
    'section'  => 'modern_art_gallery_header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'modern_art_gallery_slider_section_short_title',
    array(
    'default' => $modern_art_gallery_default['modern_art_gallery_slider_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'modern_art_gallery_slider_section_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'modern-art-gallery' ),
    'section'  => 'modern_art_gallery_header_banner_setting',
    'type'     => 'text',
    )
);

/* Upcoming Exhibitions */


$wp_customize->add_section( 'modern_art_gallery_header_category_setting',
    array(
    'title'      => esc_html__( 'Upcoming Exhibitions Settings', 'modern-art-gallery' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'modern_art_gallery_theme_home_pannel',
    )
);

$wp_customize->add_setting('modern_art_gallery_services',
    array(
        'default' => $modern_art_gallery_default['modern_art_gallery_services'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'modern_art_gallery_sanitize_checkbox',
    )
);
$wp_customize->add_control('modern_art_gallery_services',
    array(
        'label' => esc_html__('Enable Upcoming Exhibitions Section', 'modern-art-gallery'),
        'section' => 'modern_art_gallery_header_category_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'modern_art_gallery_our_team_section_short_title',
    array(
    'default' => $modern_art_gallery_default['modern_art_gallery_our_team_section_short_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'modern_art_gallery_our_team_section_short_title',
    array(
    'label'    => esc_html__( 'Short Title', 'modern-art-gallery' ),
    'section'  => 'modern_art_gallery_header_category_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'modern_art_gallery_our_team_section_title',
    array(
    'default' => $modern_art_gallery_default['modern_art_gallery_our_team_section_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'modern_art_gallery_our_team_section_title',
    array(
    'label'    => esc_html__( 'Main Title', 'modern-art-gallery' ),
    'section'  => 'modern_art_gallery_header_category_setting',
    'type'     => 'text',
    )
);

for($i=1; $i<= 4; $i++) {

    $wp_customize->add_setting('modern_art_gallery_price_list_tab_title'.$i,array(
      'default' => '',
      'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('modern_art_gallery_price_list_tab_title'.$i,array(
      'label' => __('Upcoming Exhibitions Tab Heading ','modern-art-gallery').$i,
      'section' => 'modern_art_gallery_header_category_setting',
      'setting' => 'modern_art_gallery_price_list_tab_title'.$i,
      'type'  => 'text'
    ));
}

    $categories = get_categories();
    $cat_post = array();
    $cat_post[]= 'select';
    $m = 0;
    foreach($categories as $category){
        if($m==0){
            $default = $category->slug;
            $m++;
        }
        $cat_post[$category->slug] = $category->name;
    }

    $wp_customize->add_setting('modern_art_gallery_category_tab1',array(
        'default'   => 'select',
        'sanitize_callback' => 'modern_art_gallery_sanitize_select',
    ));
    $wp_customize->add_control('modern_art_gallery_category_tab1' ,array(
        'type'    => 'select',
        'choices' => $cat_post,
        'label' => __('Select Category to display Upcoming Exhibitions 1','modern-art-gallery'),
        'section' => 'modern_art_gallery_header_category_setting',
    ));

    $categories = get_categories();
    $cat_post = array();
    $cat_post[]= 'select';
    $m = 0;
    foreach($categories as $category){
        if($m==0){
            $default = $category->slug;
            $m++;
        }
        $cat_post[$category->slug] = $category->name;
    }

    $wp_customize->add_setting('modern_art_gallery_category_tab2',array(
        'default'   => 'select',
        'sanitize_callback' => 'modern_art_gallery_sanitize_select',
    ));
    $wp_customize->add_control('modern_art_gallery_category_tab2',array(
        'type'    => 'select',
        'choices' => $cat_post,
        'label' => __('Select Category to display Upcoming Exhibitions 2','modern-art-gallery'),
        'section' => 'modern_art_gallery_header_category_setting',
    ));

     $categories = get_categories();
    $cat_post = array();
    $cat_post[]= 'select';
    $m = 0;
    foreach($categories as $category){
        if($m==0){
            $default = $category->slug;
            $m++;
        }
        $cat_post[$category->slug] = $category->name;
    }

    $wp_customize->add_setting('modern_art_gallery_category_tab3',array(
        'default'   => 'select',
        'sanitize_callback' => 'modern_art_gallery_sanitize_select',
    ));
    $wp_customize->add_control('modern_art_gallery_category_tab3',array(
        'type'    => 'select',
        'choices' => $cat_post,
        'label' => __('Select Category to display Upcoming Exhibitions 3','modern-art-gallery'),
        'section' => 'modern_art_gallery_header_category_setting',
    ));

     $categories = get_categories();
    $cat_post = array();
    $cat_post[]= 'select';
    $m = 0;
    foreach($categories as $category){
        if($m==0){
            $default = $category->slug;
            $m++;
        }
        $cat_post[$category->slug] = $category->name;
    }

    $wp_customize->add_setting('modern_art_gallery_category_tab4',array(
        'default'   => 'select',
        'sanitize_callback' => 'modern_art_gallery_sanitize_select',
    ));
    $wp_customize->add_control('modern_art_gallery_category_tab4',array(
        'type'    => 'select',
        'choices' => $cat_post,
        'label' => __('Select Category to display Upcoming Exhibitions 4','modern-art-gallery'),
        'section' => 'modern_art_gallery_header_category_setting',
    ));