<?php 
    class Edumodo_Customizer_Archive_Blog{
        private $panel_key;
        private $priority;
        private $text_domain = 'edumodo';
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->archive_blog_kirki_config();
        }
        public function archive_blog_kirki_config(){

            #   start blog region 
                Kirki::add_section( 'edumodo_archive_blog', array(
                    'title'          => esc_html__( 'Blog', $this->text_domain ),
                    'panel'          => $this->panel_key,
                    'priority'       => $this->priority,
                ) );
                    Kirki::add_field( 'edumodo_blog_related_page_header_image', [
                        'type'        => 'image',
                        'settings'    => 'edumodo_blog_related_page_header_image',
                        'label'       => esc_html__( 'Breadcrumb Background', $this->text_domain ),
                        'section'     => 'edumodo_archive_blog',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_page_title_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ]
                    ] );
                    Kirki::add_field( 'edumodo_blog_archive_custom_title', [
                        'type'     => 'text',
                        'settings' => 'edumodo_blog_archive_custom_title',
                        'label'    => __( 'Custom Title', $this->text_domain ),
                        'section'  => 'edumodo_archive_blog',
                        'default'  => esc_html__('Blog',$this->text_domain),
                        'priority' => 10,
                    ] );
                    

                    Kirki::add_field( 'blog_archive_seperator_1', [
                        'type'        => 'custom',
                        'settings'    => 'blog_archive_seperator_1',
                        'label'       => esc_html__( '', 'edumodo' ),
                        'section'     => 'edumodo_archive_blog',
                        'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; text-transform:uppercase; margin:10px -20px 5px;">' . __( 'Settings  &darr;', 'edumodo' ) . '</h3>',
                        'priority'    => 10,
                    ] );
                    Kirki::add_field( 'edumodo_blog_layout', [
                        'type'     => 'radio-image',
                        'settings' => 'edumodo_blog_layout',
                        'label'    => esc_html__( 'Layout', $this->text_domain ),
                        'section'  => 'edumodo_archive_blog',
                        'priority' => 10,
                        'default'  => 'right-sidebar',
                        'choices'     => [
                            'left-sidebar'   => get_template_directory_uri() . '/dist/images/left-sidebar.png',
                            'right-sidebar'  => get_template_directory_uri() . '/dist/images/right-sidebar.png',
                            'no-sidebar' => get_template_directory_uri() . '/dist/images/no-sidebar.png',
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_blog_style', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_blog_style',
                        'label'       => esc_html__( 'View', $this->text_domain ),
                        'section'     => 'edumodo_archive_blog',
                        'default'     => 'list',
                        'priority'    => 10,
                        'choices'     => [
                            'list' => esc_html__( 'List View', $this->text_domain ),
                            'grid' => esc_html__( 'Grid View', $this->text_domain ),
                        ]
                    ] );
                    Kirki::add_field( 'edumodo_blog_style_grid_column', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_blog_style_grid_column',
                        'label'       => esc_html__( 'Columns', $this->text_domain ),
                        'section'     => 'edumodo_archive_blog',
                        'default'     => '6',
                        'priority'    => 10,
                        'choices'     => [
                            '6' => esc_html__( '2 Columns', $this->text_domain ),
                            '4' => esc_html__( '3 Columns', $this->text_domain ),
                            '3' => esc_html__( '4 Columns', $this->text_domain ),
                            '2' => esc_html__( '6 Columns', $this->text_domain ),
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_blog_style',
                                'operator' => '==',
                                'value'    => 'grid'
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_archive_post_content_type', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_archive_post_content_type',
                        'label'       => esc_html__( 'Post Content', $this->text_domain ),
                        'section'     => 'edumodo_archive_blog',
                        'default'     => 'excerpt',
                        'priority'    => 10,
                        'choices'     => [
                            'excerpt' => esc_html__( 'Excerpt', $this->text_domain ),
                            'full' => esc_html__( 'Full Content', $this->text_domain ),
                        ]
                    ] );
                    Kirki::add_field( 'edumodo_blog_style_post_excerpt_length', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_blog_style_post_excerpt_length',
                        'label'       => esc_html__( 'Excerpt Length', $this->text_domain ),
                        'section'     => 'edumodo_archive_blog',
                        'default'     => 30,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 100,
                            'step' => 1,
                        ],
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_archive_post_content_type',
                                'operator' => '==',
                                'value'    => 'excerpt'
                            ]
                        ],
                    ] );
            #   end of blog region 


        }
    }
?>