<?php
/**
* Sections Repeater Options.
*
* @package Vintuna
*/

$vintuna_post_category_list = vintuna_post_category_list();
$vintuna_defaults = vintuna_get_default_theme_options();
$home_sections = array(
        'default-banner-area' => esc_html__('Default Banner','vintuna'),
        'banner-blocks-1' => esc_html__('Featured & Tab Block','vintuna'),
        'video-slider' => esc_html__('Video Slider','vintuna'),
        'tiles-blocks' => esc_html__('Slider & Tiles Block','vintuna'),
        'must-read' => esc_html__('Must Read','vintuna'),
        'latest-posts-blocks' => esc_html__('Latest Posts Block','vintuna'),
        'advertise-blocks' => esc_html__('Advertise Block','vintuna'),
        'home-widget-area' => esc_html__('Widgets Area Block','vintuna'),
        'you-may-like-blocks' => esc_html__('You May Like Block','vintuna'),
    );

// Slider Section.
$wp_customize->add_section( 'home_sections_repeater',
	array(
	'title'      => esc_html__( 'Homepage Sections', 'vintuna' ),
	'priority'   => 150,
	'capability' => 'edit_theme_options',
	)
);


// Recommended Posts Enable Disable.
$wp_customize->add_setting( 'wpi_vintuna_home_sections_2', array(
    'sanitize_callback' => 'vintuna_sanitize_repeater',
    'default' => json_encode( $vintuna_defaults['wpi_vintuna_home_sections_2'] ),
    // 'transport'           => 'postMessage',
));

$wp_customize->add_control(  new Vintuna_Repeater_Controler( $wp_customize, 'wpi_vintuna_home_sections_2', 
    array(
        'section' => 'home_sections_repeater',
        'settings' => 'wpi_vintuna_home_sections_2',
        'vintuna_box_label' => esc_html__('New Section','vintuna'),
        'vintuna_box_add_control' => esc_html__('Add New Section','vintuna'),
        'vintuna_box_add_button' => false,
    ),
        array(
            'section_ed' => array(
                'type'        => 'checkbox',
                'label'       => esc_html__( 'Enable Section', 'vintuna' ),
                'class'       => 'home-section-ed'
            ),
            'home_section_type' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Section Type', 'vintuna' ),
                'options'     => $home_sections,
                'class'       => 'home-section-type'
            ),
            'home_section_column_1' => array(
                 'type'        => 'seperator',
                 'seperator_text'       => esc_html__( 'Grid Area', 'vintuna' ),
                 'class'       => 'home-repeater-fields-hs default-banner-area-fields'
             ),
            'section_post_cat_1' => array(
              'type'        => 'select',
              'label'       => esc_html__( 'Slider Post Category', 'vintuna' ),
              'options'     => $vintuna_post_category_list,
              'class'       => 'home-repeater-fields-hs video-slider-fields default-banner-area-fields'
            ),

            'section_post_offset_1' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Posts Offset', 'vintuna' ),
                'options'     => array(
                    '0' => 0,
                    '1' => 1,
                    '2' => 2,
                    '3' => 3,
                    '4' => 4,
                    '5' => 5,
                    '6' => 6,
                    '7' => 7,
                    '8' => 8,
                    '9' => 9,
                    '10' => 10,
                    '11' => 11,
                    '12' => 12,
                ),
                'class'       => 'home-repeater-fields-hs default-banner-area-fields banner-blocks-1-fields'
            ),
            'tab_section_title' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Section Title', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs banner-blocks-1-fields'
            ),

            'home_section_title' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Section Title', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields you-may-like-blocks-fields'
            ),

            'home_section_title_video' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Section Title', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs video-slider-fields'
            ),
            'section_category_tile_slider' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Slider Category', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields'
            ),
            'section_category' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Category', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields you-may-like-blocks-fields'
            ),

            'home_section_title_2' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Tile Section Title', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields'
            ),

            'section_view_more_title_2' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Set New Label for View More Button', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields'
            ),

            'section_category_6' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Category', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs must-read-fields'
            ),

             'home_section_must_read' => array(
                 'type'        => 'text',
                 'label'       => esc_html__( 'Section Area Title', 'vintuna' ),
                 'class'       => 'home-repeater-fields-hs must-read-fields'
             ),

            'home_section_column_3' => array(
                 'type'        => 'seperator',
                 'seperator_text'       => esc_html__( 'Slider Area', 'vintuna' ),
                 'class'       => 'home-repeater-fields-hs default-banner-area-fields'
             ),

            'section_category_7' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Fixed Post Category', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs default-banner-area-fields'
            ),

            'section_post_tab_list_cat' => array(
              'type'        => 'select',
              'label'       => esc_html__( 'Choose a Category for the Vertical List', 'vintuna' ),
              'options'     => $vintuna_post_category_list,
              'class'       => 'home-repeater-fields-hs banner-blocks-1-fields'
            ),


            'home_section_column_4' => array(
                 'type'        => 'seperator',
                 'seperator_text'       => esc_html__( 'Metro Tile Display Area', 'vintuna' ),
                 'class'       => 'home-repeater-fields-hs banner-blocks-1-fields'
             ),

            'section_post_tab_list_cat_2' => array(
              'type'        => 'select',
              'label'       => esc_html__( 'Choose a Category for Metro Tiles', 'vintuna' ),
              'options'     => $vintuna_post_category_list,
              'class'       => 'home-repeater-fields-hs banner-blocks-1-fields'
            ),

            'section_post_number' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Posts Per Page', 'vintuna' ),
                'options'     => array(
                    '6' => 6,
                    '7' => 7,
                    '8' => 8,
                    '9' => 9,
                    '10' => 10,
                    '11' => 11,
                    '12' => 12,
                ),
              'class'       => 'home-repeater-fields-hs video-slider-fields'
            ),

            'section_post_offset' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Posts Offset', 'vintuna' ),
                'options'     => array( 
                    '0' => 0,
                    '1' => 1,
                    '2' => 2,
                    '3' => 3,
                    '4' => 4,                    
                    '5' => 5,
                    '6' => 6,
                    '7' => 7,
                    '8' => 8,
                    '9' => 9,
                    '10' => 10,
                    '11' => 11,
                    '12' => 12,
                ),
              'class'       => 'home-repeater-fields-hs default-banner-area-fields banner-blocks-1-fields tiles-blocks-fields must-read-fields you-may-like-blocks-fields'
            ),
            'advertise_image' => array(
                'type'        => 'upload',
                'label'       => esc_html__( 'Advertise Image', 'vintuna' ),
                'description' => esc_html__( 'Recommended Image Size is 970x250 PX.', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs advertise-blocks-fields'
            ),
            'advertise_link' => array(
                'type'        => 'link',
                'label'       => esc_html__( 'Advertise Image Link', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs advertise-blocks-fields'
            ),
            'section_view_more_title' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Section Area Title', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs banner-blocks-1-fields '
            ),
            'ed_arrows_carousel' => array(
                'type'        => 'checkbox',
                'label'       => esc_html__( 'Enable Arrows', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields default-banner-area-fields'
            ),
            'ed_dots_carousel' => array(
                'type'        => 'checkbox',
                'label'       => esc_html__( 'Enable Dot', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields default-banner-area-fields'
            ),
            'ed_autoplay_carousel' => array(
                'type'        => 'checkbox',
                'label'       => esc_html__( 'Enable Autoplay', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs tiles-blocks-fields default-banner-area-fields'
            ),
            'home_section_column_5' => array(
                 'type'        => 'seperator',
                 'seperator_text'       => esc_html__( 'Tab Section Seperator', 'vintuna' ),
                 'class'       => 'home-repeater-fields-hs banner-blocks-1-fields'
             ),

            'ed_tab' => array(
                'type'        => 'checkbox',
                'label'       => esc_html__( 'Enable Tab', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs ed-tabs-ac banner-blocks-1-fields'
            ),
            'cat_title_1' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Section Title One', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs '
            ),
            'section_category_1' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Category One', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs banner-blocks-1-fields'
            ),
            'cat_title_2' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Section Title Two', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs '
            ),
            'section_category_2' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Category Two', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs banner-block-1-tab-ac banner-blocks-1-fields'
            ),
            'section_category_3' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Category Three', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs banner-block-1-tab-ac banner-blocks-1-fields'
            ),
            'section_category_4' => array(
                'type'        => 'select',
                'label'       => esc_html__( 'Post Category Four', 'vintuna' ),
                'options'     => $vintuna_post_category_list,
                'class'       => 'home-repeater-fields-hs banner-block-1-tab-ac banner-blocks-1-fields'
            ),
            'section_view_more_title' => array(
                'type'        => 'text',
                'label'       => esc_html__( 'Set New Label for View More Button', 'vintuna' ),
                'class'       => 'home-repeater-fields-hs video-slider-fields must-read-fields tiles-blocks-fields you-may-like-blocks-fields'
            ),
    )
));

// Info.
$wp_customize->add_setting(
    'vintuna_notiece_info',
    array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field'
    )
);
$wp_customize->add_control(
    new Vintuna_Info_Notiece_Control( 
        $wp_customize,
        'vintuna_notiece_info',
        array(
            'settings' => 'vintuna_notiece_info',
            'section'       => 'home_sections_repeater',
            'label'         => esc_html__( 'Info', 'vintuna' ),
        )
    )
);

$wp_customize->add_setting(
    'vintuna_premium_notiece',
    array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field'
    )
);
$wp_customize->add_control(
    new Vintuna_Premium_Notiece_Control( 
        $wp_customize,
        'vintuna_premium_notiece',
        array(
            'label'      => esc_html__( 'Home Page Blocks', 'vintuna' ),
            'settings' => 'vintuna_premium_notiece',
            'section'       => 'home_sections_repeater',
        )
    )
);