<?php 
    class Edumodo_Customizer_Archive_Lifter{
        private $panel_key;
        private $priority;
        private $text_domain = 'edumodo';
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->lifter_archive_kirki_config();
        }
        public function lifter_archive_kirki_config(){

            Kirki::add_section('edumodo_section_lifter_section', [
                'title' => esc_attr__('LifterLMS', $this->text_domain),
                'panel' => $this->panel_key,
                'priority' => $this->priority,
            ] );

                Kirki::add_field( 'edumodo_lifter_related_page_header_image', [
                    'type'        => 'image',
                    'settings'    => 'edumodo_lifter_related_page_header_image',
                    'label'       => esc_html__( 'Breadcrumb Background', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority'    => 10,
                    'active_callback' => [
                        [
                            'setting'  => 'edumodo_section_page_title_trigger',
                            'operator' => '==',
                            'value'    => 'on',
                        ]
                    ]
                ] );
                Kirki::add_field( 'edumodo_lifter_archive_custom_title', [
                    'type'     => 'text',
                    'settings' => 'edumodo_lifter_archive_custom_title',
                    'label'    => __( 'Custom Title', $this->text_domain ),
                    'section'  => 'edumodo_section_lifter_section',
                    'default'  => esc_html__('Archive',$this->text_domain),
                    'priority' => 10,
                ] );
                /** 
                 * Heading
                 */
                Kirki::add_field( 'edumodo__lifter_archive_column_control', [
                    'type'        => 'custom',
                    'settings'    => 'edumodo__lifter_archive_column_control',
                    'label'       => esc_html__( '', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; margin:0; text-transform:uppercase; margin-top:10px;">' . __( 'Column Control', $this->text_domain ) . '</h3>',
                    'priority'    => 10,
                ] );
                Kirki::add_field( 'edumodo_lifter_course_archive_column_count', [
                    'type'        => 'select',
                    'settings'    => 'edumodo_lifter_course_archive_column_count',
                    'label'       => esc_html__( 'Course', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '2',
                    'choices'     => [
                        '2'		=> esc_html__('2 Columns',$this->text_domain),
                        '3'		=> esc_html__('3 Columns',$this->text_domain),
                        '4'		=> esc_html__('4 Columns',$this->text_domain),
                        '5'		=> esc_html__('5 Columns',$this->text_domain),
                        '6'		=> esc_html__('6 Columns',$this->text_domain),
                    ],
                    'multiple'    => 0,
                ] );
                Kirki::add_field( 'edumodo__lifter_course_archive_column_gap', [
                    'type'        => 'slider',
                    'settings'    => 'edumodo__lifter_course_archive_column_gap',
                    'label'       => esc_html__( 'Column Gap', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => 20,
                    'choices'     => [
                        'min'  => 0,
                        'max'  => 100,
                        'step' => 1,
                    ],
                ] );
                /**
                 * Membership column
                 */
                Kirki::add_field( 'edumodo_lifter_membership_archive_column_count', [
                    'type'        => 'select',
                    'settings'    => 'edumodo_lifter_membership_archive_column_count',
                    'label'       => esc_html__( 'Membership', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '2',
                    'choices'     => [
                        '2'		=> esc_html__('2 Columns',$this->text_domain),
                        '3'		=> esc_html__('3 Columns',$this->text_domain),
                        '4'		=> esc_html__('4 Columns',$this->text_domain),
                        '5'		=> esc_html__('5 Columns',$this->text_domain),
                        '6'		=> esc_html__('6 Columns',$this->text_domain),
                    ],
                    'multiple'    => 0,
                ] );
                /**
                 * Archive typography and customization
                 */
                /** 
                 * Heading
                 */
                Kirki::add_field( 'edumodo__lifter_archive_heading_control', [
                    'type'        => 'custom',
                    'settings'    => 'edumodo__lifter_archive_heading_control',
                    'label'       => esc_html__( '', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; margin:0; text-transform:uppercase; margin-top:10px;">' . __( 'Price Control', $this->text_domain ) . '</h3>',
                    'priority'    => 10,
                ] );
                /** 
                 * price
                 */
                Kirki::add_field( 'edumodo__lifter_archive_meta_price', [
                    'type'        => 'toggle',
                    'settings'    => 'edumodo__lifter_archive_meta_price',
                    'label'       => esc_html__( 'Enable', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '1',
                    'priority'    => 10,
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_price_typo', [
                    'type'        => 'typography',
                    'settings'    => 'edumodo__lifter_archive_price_typo',
                    'label'       => esc_html__( 'Typography', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority'    => 10,
                    'transport'   => 'auto',
                    'default'     => [
                        'font-family'    => 'Roboto',
                        'variant'        => 'regular',
                        'color'			 => '#07294d',
                        'text-transform' => 'none',
                        'font-size'		 => '16px',
                        'line-height'	 => '1.1',
                        'letter-spacing' => '0',
                    ],
                    'output'      => [
                        [
                            'element' => '.lifter-archive-card  .course-price',
                        ],
                    ],
                    'active_callback' => [
                        [
                            'setting'  => 'edumodo__lifter_archive_meta_price',
                            'operator' => '==',
                            'value'    => true,
                        ]
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_price_spacing_bottom', [
                    'type'        => 'dimension',
                    'settings'    => 'edumodo__lifter_archive_price_spacing_bottom',
                    'label'       => esc_html__( 'Spacing Bottom', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '10px',
                    'active_callback' => [
                        [
                            'setting'  => 'edumodo__lifter_archive_meta_price',
                            'operator' => '==',
                            'value'    => true,
                        ]
                    ],
                ] );
                /** 
                 * Heading
                 */
                Kirki::add_field( 'edumodo__lifter_archive_title_control', [
                    'type'        => 'custom',
                    'settings'    => 'edumodo__lifter_archive_title_control',
                    'label'       => esc_html__( '', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; margin:0; text-transform:uppercase; margin-top:10px;">' . __( 'Title Control', $this->text_domain ) . '</h3>',
                    'priority'    => 10,
                ] );
                
                Kirki::add_field( 'edumodo__lifter_archive_title_typo', [
                    'type'        => 'typography',
                    'settings'    => 'edumodo__lifter_archive_title_typo',
                    'label'       => esc_html__( 'Typography', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority'    => 10,
                    'transport'   => 'auto',
                    'default'     => [
                        'font-family'    => 'Roboto',
                        'variant'        => 'regular',
                        'color'			 => '#07294d',
                        'text-transform' => 'none',
                        'font-size'		 => '16px',
                        'line-height'	 => '1.1',
                        'letter-spacing' => '0',
                    ],
                    'output'      => [
                        [
                            'element' => '.lifter-archive-card  .course-title',
                        ],
                    ],
                ] );
                /** 
                 * Heading
                 */
                Kirki::add_field( 'edumodo__lifter_archive_excerpt_control', [
                    'type'        => 'custom',
                    'settings'    => 'edumodo__lifter_archive_excerpt_control',
                    'label'       => esc_html__( '', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; margin:0; text-transform:uppercase; margin-top:10px;">' . __( 'Excerpt Control', $this->text_domain ) . '</h3>',
                    'priority'    => 10,
                ] );
                
                Kirki::add_field( 'edumodo__lifter_archive_excerpt_length', [
                    'type'        => 'number',
                    'settings' => 'edumodo__lifter_archive_excerpt_length',
                    'label'    => esc_html__( 'length', $this->text_domain ),
                    'section'  => 'edumodo_section_lifter_section',
                    'priority' => 10,
                    'default'     => 20,
                    'choices'     => [
                        'min'  => 0,
                        'max'  => 100,
                        'step' => 1,
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_excerpt_typo', [
                    'type'        => 'typography',
                    'settings'    => 'edumodo__lifter_archive_excerpt_typo',
                    'label'       => esc_html__( 'Typography', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority'    => 10,
                    'transport'   => 'auto',
                    'default'     => [
                        'font-family'    => 'Roboto',
                        'variant'        => 'regular',
                        'color'			 => '#07294d',
                        'text-transform' => 'none',
                        'font-size'		 => '16px',
                        'line-height'	 => '1.1',
                        'letter-spacing' => '0',
                    ],
                    'output'      => [
                        [
                            'element' => '.lifter-archive-card  .course-excerpt',
                        ],
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_excerpt_margin', [
                    'type'        => 'dimensions',
                    'settings'    => 'edumodo__lifter_archive_excerpt_margin',
                    'label'       => esc_html__( 'Spacing', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority' => 10,
                    'default'     => [
                        'top'  => '15px',
                        // 'right'  => '0px',
                        'bottom'  => '15px',
                        // 'left' => '0px',
                    ],
                ] );
                /** 
                 * Meta 
                 */
                Kirki::add_field( 'edumodo__lifter_archive_meta_control', [
                    'type'        => 'custom',
                    'settings'    => 'edumodo__lifter_archive_meta_control',
                    'label'       => esc_html__( '', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; margin:0; text-transform:uppercase; margin-top:10px;">' . __( 'Meta Control', $this->text_domain ) . '</h3>',
                    'priority'    => 10,
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_meta_enrolled_student', [
                    'type'        => 'toggle',
                    'settings'    => 'edumodo__lifter_archive_meta_enrolled_student',
                    'label'       => esc_html__( 'Enrolled Student', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '1',
                    'priority'    => 10,
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_meta_course_duration', [
                    'type'        => 'toggle',
                    'settings'    => 'edumodo__lifter_archive_meta_course_duration',
                    'label'       => esc_html__( 'Course Duration', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '1',
                    'priority'    => 10,
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_meta_typo', [
                    'type'        => 'typography',
                    'settings'    => 'edumodo__lifter_archive_meta_typo',
                    'label'       => esc_html__( 'Typography', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority'    => 10,
                    'transport'   => 'auto',
                    'default'     => [
                        'font-family'    => 'Roboto',
                        'variant'        => 'regular',
                        'color'			 => '#07294d',
                        'text-transform' => 'none',
                        'font-size'		 => '16px',
                        'line-height'	 => '1.1',
                        'letter-spacing' => '0',
                    ],
                    'output'      => [
                        [
                            'element' => '.lifter-archive-card  .course-meta',
                        ],
                    ],
                ] );
                /** 
                 * content
                 */
                Kirki::add_field( 'edumodo__lifter_archive_card_control', [
                    'type'        => 'custom',
                    'settings'    => 'edumodo__lifter_archive_card_control',
                    'label'       => esc_html__( '', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '<h3 style="border: solid 1px #b3b3b3; text-align: center; letter-spacing: 2px;padding:15px 10px; background:#cecece; margin:0; text-transform:uppercase; margin-top:10px;">' . __( 'Card Control', $this->text_domain ) . '</h3>',
                    'priority'    => 10,
                ] );
                Kirki::add_field( 'edumodo__lifter_course_archive_card_border_radius', [
                    'type'        => 'slider',
                    'settings'    => 'edumodo__lifter_course_archive_card_border_radius',
                    'label'       => esc_html__( 'Border Radius', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => 4,
                    'choices'     => [
                        'min'  => 0,
                        'max'  => 100,
                        'step' => 1,
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_content_spacing', [
                    'type'        => 'dimensions',
                    'settings'    => 'edumodo__lifter_archive_content_spacing',
                    'label'       => esc_html__( 'Spacing', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'priority' => 10,
                    'default'     => [
                        'top'  => '15px',
                        'right'  => '0px',
                        'bottom'  => '15px',
                        'left' => '0px',
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_content_background', [
                    'type'        => 'color',
                    'settings'    => 'edumodo__lifter_archive_content_background',
                    'label'       => __( 'Background', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '#f7f7f7',
                    'choices'     => [
                        'alpha' => true,
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_content_alignment', [
                    'type'     => 'radio-image',
                    'settings' => 'edumodo__lifter_archive_content_alignment',
                    'label'    => esc_html__( 'Alignment', $this->text_domain ),
                    'section'  => 'edumodo_section_lifter_section',
                    'priority' => 10,
                    'default'  => 'left',
                    'choices'     => [
                        'left'   => get_template_directory_uri() . '/assets/images/aleft.png',
                        'center' => get_template_directory_uri() . '/assets/images/acenter.png',
                        'right'  => get_template_directory_uri() . '/assets/images/aright.png',
                    ],
                ] );
                Kirki::add_field( 'edumodo__lifter_archive_pregressbar', [
                    'type'        => 'color',
                    'settings'    => 'edumodo__lifter_archive_pregressbar',
                    'label'       => __( 'Course Progress Bar', $this->text_domain ),
                    'section'     => 'edumodo_section_lifter_section',
                    'default'     => '##ecb101',
                    'choices'     => [
                        'alpha' => true,
                    ],
                ] );

        }
    }
?>