<?php 
    class Edumodo_Customizer_Single_LearnDash{
        private $panel_key;
        private $priority;
        private $text_domain = 'edumodo';
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->learndash_single_kirki_config();
        }
        public function learndash_single_kirki_config(){
            #	start of learndash region
                Kirki::add_section( 'edumodo_section_ld_single', array(
                    'title'          => esc_html__( 'LearnDash', $this->text_domain ),
                    'panel'          => $this->panel_key,
                    'priority'       => $this->priority
                ) );

                    Kirki::add_field( 'edumodo_single_ld_course_layout', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_single_ld_course_layout',
                        'label'       => esc_html__( 'Layout', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => '2',
                        'priority'    => 10,
                        'multiple'    => 0,
                        'choices'     => [
                            '1' => esc_html__( 'Style One', $this->text_domain ),
                            '2' => esc_html__( 'Style Two', $this->text_domain )
                        ]
                    ] );

                    Kirki::add_field( 'edumodo_single_ld_course_widget_divider_trigger', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_single_ld_course_widget_divider_trigger',
                        'label'       => esc_html__( 'Widget Divider', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_single_ld_course_layout',
                                'operator' => '==',
                                'value'    => '2',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_single_ld_course_post_update_time', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_single_ld_course_post_update_time',
                        'label'       => esc_html__( 'Update Time', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_single_ld_course_layout',
                                'operator' => '==',
                                'value'    => '2',
                            ]
                        ],
                    ] );

                    Kirki::add_field( 'edumodo_single_ld_course_post_tags_trigger', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_single_ld_course_post_tags_trigger',
                        'label'       => esc_html__( 'Post Tags', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                        
                    ] );
                    

                    Kirki::add_field( 'edumodo_single_ld_course_social_trigger', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_single_ld_course_social_trigger',
                        'label'       => esc_html__( 'Enable Social Share', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_single_ld_course_layout',
                                'operator' => '==',
                                'value'    => '1',
                            ]
                        ],
                    ] );

                    Kirki::add_field( 'edumodo_single_ld_course_related_course_trigger', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_single_ld_course_related_course_trigger',
                        'label'       => esc_html__( 'Enable Related Course', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                    ] );

                    

                    Kirki::add_field( 'edumodo_single_ld_related_course_column', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_single_ld_related_course_column',
                        'label'       => esc_html__( 'Columns', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => '2',
                        'priority'    => 10,
                        'multiple'    => 0,
                        'choices'     => [
                            '4' => esc_html__( '4 Columns', $this->text_domain ),
                            '3' => esc_html__( '3 Columns', $this->text_domain ),
                            '2' => esc_html__( '2 Columns', $this->text_domain ),
                            '1' => esc_html__( '1 Columns', $this->text_domain ),
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_single_ld_course_layout',
                                'operator' => '==',
                                'value'    => '2',
                            ],
                            [
                                'setting'  => 'edumodo_single_ld_course_related_course_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );

                    Kirki::add_field( 'edumodo_single_ld_related_course_per_page', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_single_ld_related_course_per_page',
                        'label'       => esc_html__( 'Related Course Count', $this->text_domain ),
                        'section'     => 'edumodo_section_ld_single',
                        'default'     => 3,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 100,
                            'step' => 1,
                        ],
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_single_ld_course_related_course_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );

                    
            #	end of learndash region


        }
    }
?>