<?php 
    class Edumodo_Customizer_Footer_Widget{
        private $panel_key;
        private $priority;
        private $text_domain = 'edumodo';
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->footer_widget_kirki_config();
        }
        public function footer_widget_kirki_config(){
            
            #	start of blog region 
                Kirki::add_section( 'edumodo_section_footer_widgets', array(
                    'title'          => esc_html__( 'Widget', $this->text_domain ),
                    'panel'          => $this->panel_key,
                    'priority'       => $this->priority,
                ) );
                    Kirki::add_field( 'edumodo_section_footer_widgets_trigger', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_section_footer_widgets_trigger',
                        'label'       => esc_html__( 'Enable Footer Widget Area', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_widgets',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', 'edumodo' ),
                            'off' => esc_html__( 'No', 'edumodo' ),
                        ],
                    ] );

                    Kirki::add_field( 'edumodo_section_footer_widgets_bg_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_section_footer_widgets_bg_color',
                        'label'       => esc_html__( 'Background', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_widgets',
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_widgets_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                        'transport'   => 'auto',
                        'priority'    => 10,
                        'output'      => [
                            [
                                'element'  => 'section.footer',
                            ]
                        ],
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_widgets_text_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_section_footer_widgets_text_color',
                        'label'       => __( 'Text', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_widgets',
                        'transport'   => 'auto',
                        'choices'     => [
                            'alpha' => true,
                        ],
                        'output'      => [
                            [
                                'element'  => 'section.footer, section.footer .widget-title, section.footer .edumodo-quickinfo i',
                                'property' => 'color',
                            ],
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_widgets_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                        'priority'    => 10
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_widgets_link_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_section_footer_widgets_link_color',
                        'label'       => __( 'Link', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_widgets',
                        'transport'   => 'auto',
                        'choices'     => [
                            'alpha' => true,
                        ],
                        'output'      => [
                            [
                                'element'  => 'section.footer a, section.footer .widget ul li a, section.footer .widget ul li:before',
                                'property' => 'color',
                            ]
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_widgets_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                        'priority'    => 10
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_widgets_link_hover_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_section_footer_widgets_link_hover_color',
                        'label'       => __( 'Link Hover', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_widgets',
                        'transport'   => 'auto',
                        'choices'     => [
                            'alpha' => true,
                        ],
                        'output'      => [
                            [
                                'element'  => 'section.footer a:hover, section.footer .widget ul li:hover a, section.footer .widget ul li:hover:before',
                                'property' => 'color',
                            ]
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_widgets_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                        'priority'    => 10
                    ] );

                    Kirki::add_field( 'edumodo_section_footer_widgets_padding', [
                        'type'        => 'dimensions',
                        'settings'    => 'edumodo_section_footer_widgets_padding',
                        'label'       => esc_html__( 'Padding', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_widgets',
                        'default'     => [
                            'padding-top'    => '50px',
                            'padding-bottom' => '30px',
                            'padding-left'   => '0',
                            'padding-right'  => '0',
                        ],
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_widgets_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            #	end of blog region 


        }
    }
?>