<?php 
    class Edumodo_Customizer_Footer_Copyright{
        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_copyright_kirki_config();
        }
        public function footer_copyright_kirki_config(){
            
            #	start of blog region 
                Kirki::add_section( 'edumodo_section_footer_copyright', array(
                    'title'          => esc_html__( 'Copyright & Credit', $this->text_domain ),
                    'panel'          => $this->panel_key,
                    'priority'       => $this->priority,
                ) );
                    Kirki::add_field( 'edumodo_section_footer_bottom_trigger', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_section_footer_bottom_trigger',
                        'label'       => esc_html__( 'Enable Footer Bottom', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_copyright',
                        'default'     => 'on',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', 'edumodo' ),
                            'off' => esc_html__( 'No', 'edumodo' ),
                        ],
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_change_copyright', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_section_footer_change_copyright',
                        'label'       => esc_html__( 'Change Copyright', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_copyright',
                        'default'     => 'off',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', 'edumodo' ),
                            'off' => esc_html__( 'No', 'edumodo' ),
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_section_footer_copyright_text', [
                        'type'     => 'textarea',
                        'settings' => 'edumodo_section_footer_copyright_text',
                        'label'    => esc_html__( 'Copyright Text', 'edumodo' ),
                        'section'  => 'edumodo_section_footer_copyright',
                        'default'  => sprintf(esc_html__( 'Copyright@ Edumodo %s', 'edumodo' ),date('Y')),
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_change_copyright',
                                'operator' => '==',
                                'value'    => 'on',
                            ],
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_change_credit', [
                        'type'        => 'radio-buttonset',
                        'settings'    => 'edumodo_section_footer_change_credit',
                        'label'       => esc_html__( 'Change Credit', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_copyright',
                        'default'     => 'off',
                        'priority'    => 10,
                        'choices'     => [
                            'on'   => esc_html__( 'Yes', 'edumodo' ),
                            'off' => esc_html__( 'No', 'edumodo' ),
                        ],
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_credit_text', [
                        'type'     => 'text',
                        'settings' => 'edumodo_section_footer_credit_text',
                        'label'    => __( 'Credit Text', 'edumodo' ),
                        'section'  => 'edumodo_section_footer_copyright',
                        'default'  => esc_html__('Themexpert','edumodo'),
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_change_credit',
                                'operator' => '==',
                                'value'    => 'on',
                            ],
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_credit_url', [
                        'type'     => 'link',
                        'settings' => 'edumodo_section_footer_credit_url',
                        'label'    => __( 'Credit URL', 'edumodo' ),
                        'section'  => 'edumodo_section_footer_copyright',
                        'default'  => '#',
                        'priority' => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_change_credit',
                                'operator' => '==',
                                'value'    => 'on',
                            ],
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    
                    Kirki::add_field( 'footer_copyright_seperator_1', [
                        'type'        => 'custom',
                        'settings'    => 'footer_copyright_seperator_1',
                        'label'       => esc_html__( '', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_copyright',
                        '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;">' . __( 'Style  &darr;', 'edumodo' ) . '</h3>',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
                    Kirki::add_field( 'edumodo_footer_copyright_color', [
                        'type'        => 'color',
                        'settings'    => 'edumodo_footer_copyright_color',
                        'label'       => __( 'Color', 'edumodo' ),
                        'section'     => 'edumodo_section_footer_copyright',
                        'default'     => '',
                        'choices'     => [
                            'alpha' => true,
                        ],
                        'transport'   => 'auto',
                        'priority'    => 10,
                        'active_callback' => [
                            [
                                'setting'  => 'edumodo_section_footer_bottom_trigger',
                                'operator' => '==',
                                'value'    => 'on',
                            ]
                        ],
                    ] );
            
                    Kirki::add_field( 'edumodo_section_footer_bottom_bg_color', [
                    	'type'        => 'color',
                    	'settings'    => 'edumodo_section_footer_bottom_bg_color',
                    	'label'       => __( 'Background Color', 'edumodo' ),
                    	'section'     => 'edumodo_section_footer_copyright',
                    	'default'     => '#2a2e31',
                    	'transport'   => 'auto',
                    	'choices'     => [
                    		'alpha' => true,
                    	],
                    	'output'      => [
                    		[
                    			'element'  => '.copyright',
                    			'property' => 'background-color',
                    		]
                    	],
                    	'active_callback' => [
                    		[
                    			'setting'  => 'edumodo_section_footer_bottom_trigger',
                    			'operator' => '==',
                    			'value'    => 'on',
                    		]
                    	],
                    	'priority'    => 10
                    ] );
            #	end of blog region 


        }
    }
?>