<?php 
    class Edumodo_Customizer_Archive_TX_Course{
        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_txcourse_kirki_config();
        }
        public function archive_txcourse_kirki_config(){

            #   start txcourse archive region
                Kirki::add_section( 'edumodo_section_txcourse_archive', array(
                    'title'          => esc_html__( 'TX Course', $this->text_domain ),
                    'panel'          => $this->panel_key,
                    'priority'       => $this->priority,
                ) );
                    // if (class_exists('SFWD_LMS')) {
                    Kirki::add_field( 'edumodo_txcourse_page_header_image', [
                        'type'        => 'image',
                        'settings'    => 'edumodo_txcourse_page_header_image',
                        'label'       => esc_html__( 'Breadcrumb Background', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_page_title_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ]
                    ] );
                    Kirki::add_field( 'edumodo_txcourse_archive_custom_title', [
                        'type'     => 'text',
                        'settings' => 'edumodo_txcourse_archive_custom_title',
                        'label'    => __( 'Custom Title', $this->text_domain ),
                        'section'  => 'edumodo_section_txcourse_archive',
                        'default'  => esc_html__('Course',$this->text_domain),
                        'priority' => 10,
                    ] );
                    Kirki::add_field( 'txcourse_archive_seperator_1', [
                        'type'        => 'custom',
                        'settings'    => 'txcourse_archive_seperator_1',
                        'label'       => esc_html__( '', 'edumodo' ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        '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_archive_txcourse_course_per_page', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_archive_txcourse_course_per_page',
                        'label'       => esc_html__( 'Course Per Page', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => 6,
                        'choices'     => [
                            'min'  => 0,
                            'max'  => 100,
                            'step' => 1,
                        ],
                        'priority' => 10,
                    ] );
                    Kirki::add_field( 'edumodo_archive_txcourse_course_grid_column', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_archive_txcourse_course_grid_column',
                        'label'       => esc_html__( 'Columns', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => '4',
                        'priority'    => 10,
                        'multiple'    => 0,
                        '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 ),
                        ]
                    ] );
                    Kirki::add_field( 'edumodo_txcourse_archive_image_size', [
                        'type'        => 'select',
                        'settings'    => 'edumodo_txcourse_archive_image_size',
                        'label'       => esc_html__( 'Image Size', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'priority'    => 10,
                        'multiple'    => 0,
                        'default'	  => 'tx_course_archive',
                        'choices'     => edumodo_image_sizes_by_array()
                    ] );
                    
                    Kirki::add_field( 'edumodo_archive_txcourse_date', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_archive_txcourse_date',
                        'label'       => esc_html__( 'Date', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Show', $this->text_domain ),
                            'off' => esc_html__( 'Hide', $this->text_domain )
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_archive_txcourse_view', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_archive_txcourse_view',
                        'label'       => esc_html__( 'View', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Show', $this->text_domain ),
                            'off' => esc_html__( 'Hide', $this->text_domain )
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_archive_txcourse_content', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_archive_txcourse_content',
                        'label'       => esc_html__( 'Content', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Show', $this->text_domain ),
                            'off' => esc_html__( 'Hide', $this->text_domain )
                        ],
                    ] );
                    
                    Kirki::add_field( 'edumodo_archive_txcourse_content_length', [
                        'type'        => 'slider',
                        'settings'    => 'edumodo_archive_txcourse_content_length',
                        'label'       => esc_html__( 'Course Content Length', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => 15,
                        'choices'     => [
                            'min'  => 1,
                            'max'  => 150,
                            'step' => 1,
                        ],
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_archive_txcourse_content',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ]
                    ] );
                    // Kirki::add_field( 'edumodo_archive_txcourse_course_button_text', [
                    //     'type'     => 'text',
                    //     'settings' => 'edumodo_archive_txcourse_course_button_text',
                    //     'label'    => esc_html__( 'Button Text', $this->text_domain ),
                    //     'section'  => 'edumodo_section_txcourse_archive',
                    //     'default'  => esc_html__('See more',$this->text_domain),
                    //     'priority' => 10,
                    // ] );
                    // Kirki::add_field( 'edumodo_typo_heading', [
                    //     'type' 	=> 'heading',
                    //     'label'	=> 'Typography',
                    //     'section'     => 'edumodo_section_txcourse_archive',
                    //     'priority' => 10,
                    // ]);
                    // Kirki::add_field( 'txcourse_course_archive_title', [
                    //     'type'        => 'typography',
                    //     'settings'    => 'txcourse_course_archive_title',
                    //     'label'       => esc_html__( 'Title', $this->text_domain ),
                    //     'section'     => 'edumodo_section_txcourse_archive',
                    //     'priority'    => 10,
                    //     'transport'   => 'auto',
                    //     'default'     => [
                    //         'font-family'    => 'Poppins',
                    //         'color'			 => '#07294d',
                    //         'text-transform' => 'none',
                    //         'font-size'		 => '20px',
                    //         'line-height'	 => '1.1',
                    //         'letter-spacing' => '0',
                    //         'variant'        => '700',
                    //     ],
                    //     'output'      => [
                    //         [
                    //             'element' => '.post-type-archive-sfwd-courses h3.entry-title',
                    //         ],
                    //     ],
                    // ] );
                    // Kirki::add_field( 'edumodo_txcourse_archive_style', [
                    //     'type' 	=> 'heading',
                    //     'label'	=> 'Style',
                    //     'section'     => 'edumodo_section_txcourse_archive',
                    //     'priority' => 10,
                    // ]);
                    // Kirki::add_field( 'edumodo_txcourse_excerpt_padding', [
                    //     'type'        => 'dimensions',
                    //     'settings'    => 'edumodo_txcourse_excerpt_padding',
                    //     'label'       => esc_html__( 'Excerpt Padding', $this->text_domain ),
                    //     'section'     => 'edumodo_section_txcourse_archive',
                    //     'priority' => 10,
                    //     'default'     => [
                    //         'top'  => '0px',
                    //         'right'  => '0px',
                    //         'bottom'  => '0px',
                    //         'left' => '0px',
                    //     ],
                    // ] );
                    Kirki::add_field( 'txcourse_archive_seperator_2', [
                        'type'        => 'custom',
                        'settings'    => 'txcourse_archive_seperator_2',
                        'label'       => esc_html__( '', 'edumodo' ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        '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;">' . __( 'Slug  &darr;', 'edumodo' ) . '</h3>',
                        'priority'    => 10,
                    ] );
                    Kirki::add_field( 'edumodo_archive_txcourse_custom_slug', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_archive_txcourse_custom_slug',
                        'label'       => esc_html__( 'Custom Slug', $this->text_domain ),
                        'section'     => 'edumodo_section_txcourse_archive',
                        'default'     => 'off',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', $this->text_domain ),
                            'off' => esc_html__( 'No', $this->text_domain )
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_archive_txcourse_course_slug', [
                        'type'     => 'text',
                        'settings' => 'edumodo_archive_txcourse_course_slug',
                        'label'    => esc_html__( 'Course', $this->text_domain ),
                        'section'  => 'edumodo_section_txcourse_archive',
                        'default'  => esc_html__('tx-course',$this->text_domain),
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_archive_txcourse_custom_slug',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ]
                    ] );
                    Kirki::add_field( 'edumodo_archive_txcourse_course_cat_slug', [
                        'type'     => 'text',
                        'settings' => 'edumodo_archive_txcourse_course_cat_slug',
                        'label'    => esc_html__( 'Category', $this->text_domain ),
                        'section'  => 'edumodo_section_txcourse_archive',
                        'default'  => esc_html__('tx-course-category',$this->text_domain),
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_archive_txcourse_custom_slug',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ]
                    ] );
            #   end of txcourse archive region

        }
    }
?>