<?php 
    class Edumodo_Customizer_Page_Search{
        private $panel_key;
        private $priority;
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->page_layout_kirki_config();
        }
        public function page_layout_kirki_config(){

            #   start search region 
                Kirki::add_section('edumodo_section_searchpage', array(
                    'title' => esc_attr__('Search', 'edumodo'),
                    'panel' => $this->panel_key,
                    'priority' => $this->priority,
                ) );

                    Kirki::add_field( 'edumodo_search_page_header_image', [
                        'type'        => 'image',
                        'settings'    => 'edumodo_search_page_header_image',
                        'label'       => esc_html__( 'Breadcrumb Background', 'edumodo' ),
                        'section'     => 'edumodo_section_searchpage',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_page_title_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ]
                    ] );

                    Kirki::add_field( 'edumodo_search_page_layout', [
                        'type'     => 'radio-image',
                        'settings' => 'edumodo_search_page_layout',
                        'label'    => esc_html__( 'Layout', 'edumodo' ),
                        'section'  => 'edumodo_section_searchpage',
                        'priority' => 10,
                        'default'  => 'right-sidebar',
                        'choices'     => [
                            'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                            'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                            'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                        ],
                    ] );

                    Kirki::add_field( 'edumodo_search_posts_per_page', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_search_posts_per_page',
                        'label'       => esc_html__( 'Search Posts per Page', 'edumodo' ),
                        'section'     => 'edumodo_section_searchpage',
                        'default'     => 10,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 100,
                            'step' => 1,
                        ],
                        'priority' => 10,
                    ] );


                    Kirki::add_field( 'edumodo_search_post_source_type', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_search_post_source_type',
                        'label'       => esc_html__( 'Source Type', 'edumodo' ),
                        'section'     => 'edumodo_section_searchpage',
                        'default'     => 'all',
                        'multiple'    => 0,
                        'choices'     => [
                            'all' => esc_html__( 'All Posts Type', 'edumodo' ),
                            'post' => esc_html__( 'Post', 'edumodo' ),
                            'page' => esc_html__( 'Page', 'edumodo' ),
                        ],
                        'priority' => 10,
                    ] );
            #   end of search region 


        }
    }
?>