<?php 
    class Edumodo_Customizer_Page_Layout{
        private $panel_key;
        private $priority;
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->page_layout_kirki_config();
        }
        public function page_layout_kirki_config(){

            #   start layout region 
                Kirki::add_section('edumodo_section_page', array(
                    'title' => esc_attr__('Layout', 'edumodo'),
                    'panel'          => $this->panel_key,
                    'priority'       => $this->priority,
                ) );

                    Kirki::add_field( 'edumodo_page_layout', [
                        'type'     => 'radio-image',
                        'settings' => 'edumodo_page_layout',
                        'label'    => esc_html__( 'Page Layout', 'edumodo' ),
                        'section'  => 'edumodo_section_page',
                        'priority' => 10,
                        'default'  => 'no-sidebar',
                        'choices'     => [
                            'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                            'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                            'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                        ],
                    ] );
                    # start region bbpress
                        if(class_exists( 'bbPress' )):
                            /**
                             * bbPress home layout
                             */
                            Kirki::add_field( 'edumodo_bbpress_layout', [
                                'type'     => 'radio-image',
                                'settings' => 'edumodo_bbpress_layout',
                                'label'    => esc_html__( 'bbPress Layout', 'edumodo' ),
                                'section'  => 'edumodo_section_page',
                                'priority' => 10,
                                'default'  => 'no-sidebar',
                                'choices'     => [
                                    'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                                    'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                                    'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                                ],
                            ] );
                            /**
                             * buddypress Activity home layout
                             */
                            Kirki::add_field( 'edumodo_buddyPress_activity_home_layout', [
                                'type'     => 'radio-image',
                                'settings' => 'edumodo_buddyPress_activity_home_layout',
                                'label'    => esc_html__( 'BuddyPress Activity Home Layout', 'edumodo' ),
                                'section'  => 'edumodo_section_page',
                                'priority' => 10,
                                'default'  => 'no-sidebar',
                                'choices'     => [
                                    'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                                    'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                                    'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                                ],
                            ] );
                            /**
                             * buddypress Group home layout
                             */
                            Kirki::add_field( 'edumodo_buddyPress_group_home_layout', [
                                'type'     => 'radio-image',
                                'settings' => 'edumodo_buddyPress_group_home_layout',
                                'label'    => esc_html__( 'BuddyPress Group Home Layout', 'edumodo' ),
                                'section'  => 'edumodo_section_page',
                                'priority' => 10,
                                'default'  => 'no-sidebar',
                                'choices'     => [
                                    'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                                    'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                                    'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                                ],
                            ] );
                            /**
                             * buddypress Group single layout
                             */
                            Kirki::add_field( 'edumodo_buddyPress_group_single_layout', [
                                'type'     => 'radio-image',
                                'settings' => 'edumodo_buddyPress_group_single_layout',
                                'label'    => esc_html__( 'BuddyPress Group Single Layout', 'edumodo' ),
                                'section'  => 'edumodo_section_page',
                                'priority' => 10,
                                'default'  => 'no-sidebar',
                                'choices'     => [
                                    'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                                    'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                                    'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                                ],
                            ] );
                            /**
                             * buddypress member home layout
                             */
                            Kirki::add_field( 'edumodo_buddyPress_member_home_layout', [
                                'type'     => 'radio-image',
                                'settings' => 'edumodo_buddyPress_member_home_layout',
                                'label'    => esc_html__( 'BuddyPress Member Home Layout', 'edumodo' ),
                                'section'  => 'edumodo_section_page',
                                'priority' => 10,
                                'default'  => 'no-sidebar',
                                'choices'     => [
                                    'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                                    'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                                    'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                                ],
                            ] );
                            /**
                             * buddypress member single layout
                             */
                            Kirki::add_field( 'edumodo_buddyPress_member_single_layout', [
                                'type'     => 'radio-image',
                                'settings' => 'edumodo_buddyPress_member_single_layout',
                                'label'    => esc_html__( 'BuddyPress Member Single Layout', 'edumodo' ),
                                'section'  => 'edumodo_section_page',
                                'priority' => 10,
                                'default'  => 'no-sidebar',
                                'choices'     => [
                                    'left-sidebar'   => get_template_directory_uri() . '/assets/images/left-sidebar.png',
                                    'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
                                    'right-sidebar'  => get_template_directory_uri() . '/assets/images/right-sidebar.png',
                                ],
                            ] );
                        endif;
                    # end region bbpress
            #   end of layout region 


        }
    }
?>