<?php
add_action('init', 'confin_project_kc_map', 99 );
function confin_project_kc_map() {

	if (function_exists('kc_add_map')){
	    kc_add_map(
	        array(
	            'reg_project' => array(
	                'name' => esc_html__('Confin Project','confin-core'),
	                'description' => esc_html__('Display single icon', 'confin-core'),
	                'icon' => 'cpicon cpicon kc-icon-flip',
	                'category' => ConfinLibrary::confin_kc_cat_name(),
	                'params' => array(
                  'Content' => array(
                   array(
                        'name' => 'project_style',
                        'label' => esc_html__('Project Style', 'confin-core'),
                        'type' => 'select',
                        'options' => array(
                          'list' => esc_html__( 'list Style', 'confin-core' ),
                          'slide' => esc_html__( 'Slider', 'confin-core' ),
                        ),
                        'admin_label' => true,
                    ),
                    array(
                        'name' => 'project_limit',
                        'label' => esc_html__( 'Project Limit','confin-core'),
                        'type' => 'text',
                        'description' => esc_html__('Write Project Limit ', 'confin-core'),
                        'relation' => array(
                          'parent'    => 'project_style',
                          'hide_when' => 'slide'
                        ),
                      ),
                     array(
                        'name' => 'carousel_items',
                        'label' => esc_html__( 'Project Slide Limit','confin-core'),
                        'type' => 'text',
                        'description' => esc_html__('Write Project Slide Limit ', 'confin-core'),
                        'relation' => array(
                          'parent'    => 'project_style',
                          'show_when' => 'slide'
                        ),
                      ),
                     array(
                        'name' => 'carousel_autoplay',
                        'label' => esc_html__('Carousel Autoplay','confin-core'),
                        'type' => 'toggle',
                        'admin_label' => true,
                        'description' => esc_html__('Turn On if you want to show Carousel Autoplay.', 'confin-core'),
                        'relation' => array(
                          'parent'    => 'project_style',
                          'show_when' => 'slide'
                        ),
                      ),
                    array(
                        'name' => 'particular_item',
                        'type' => 'autocomplete',
                        'label' => esc_html__( 'Particular Project', 'confin-core' ),
                        'options'       => array(
                          'multiple'      => true,
                          'post_type'     => 'project',
                        ),
                        'description' => esc_html__('Type Project Name, and select after auto detect', 'confin-core'),
                      ),
                    array(
                        'name' => 'project_order',
                        'label' => esc_html__( 'Orderby','confin-core'),
                        'type' => 'select',
                          'options' => array(
                            '' => esc_html__('Order','confin-core'),
                            'ASC' => esc_html__('Asending','confin-core'),
                            'DESC' => esc_html__('Desending','confin-core'),
                          ),
                        'admin_label' => true,
                        'description' => esc_html__('Select Project Orderby ', 'confin-core'),
                      ),
                    array(
                        'name' => 'project_orderby',
                        'label' => esc_html__( 'Order By','confin-core'),
                        'type' => 'select',
                          'options' => array(
                            'none' => esc_html__('None','confin-core'),
                            'ID' => esc_html__('ID','confin-core'),
                            'author' => esc_html__('Author','confin-core'),
                            'title' => esc_html__('Title','confin-core'),
                            'date' => esc_html__('Date','confin-core'),
                            'menu_order' => esc_html__('Menu order','confin-core'),
                          ),
                        'admin_label' => true,
                      ),
                      array(
                        "name"  => "short_content",
                        "type"        =>'text',
                        "label"     =>esc_html__('Content Length', 'confin-core'),
                      ),
                      array(
                        'name' => 'readmore_text',
                        'type' => 'text',
                        'label' => esc_html__( 'Readmore Text', 'confin-core' ),
                      ),
                      array(
                        'name' => 'pagination',
                        'type' => 'toggle',
                        'label' => esc_html__( 'Pagination', 'confin-core' ),
                      ),
                    ),
                    'Style' => array(
	                    array(
                        'name' => 'class',
                        'label' => esc_html__('Extra Class','confin-core'),
                        'type' => 'text',
                        'admin_label' => true,
                        'description' => esc_html__('Enter Extra Class for Titlte ..', 'confin-core')
                      ),
                      array(
                        'name' => 'title_color',
                        'label' => esc_html__('Title Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set color for title', 'confin-core')
                      ),
                      array(
                        'name' => 'title_size',
                        'label' => esc_html__('Title Size','confin-core'),
                        'type' => 'number_slider',
                        'options' => array(
                          'min' => 15,
                          'max' => 60,
                          'unit' => 'px',
                          'show_input' => true
                        ),
                        'description' => esc_html__('Enter font-size for title such as: 15px, 1em ..etc..', 'confin-core')
	                    ),
	                    array(
                        'name' => 'subtitle_color',
                        'label' => esc_html__('Sub Title Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set color for Sub title', 'confin-core')
	                    ),
                      array(
                        'name' => 'subtitle_size',
                        'label' => esc_html__('Sub Title Size','confin-core'),
                        'type' => 'number_slider',
                        'options' => array(
                          'min' => 15,
                          'max' => 60,
                          'unit' => 'px',
                          'show_input' => true
                        ),
                        'description' => esc_html__('Enter font-size for Sub title such as: 15px, 1em ..etc..', 'confin-core')
                      ),
                      array(
                        'name' => 'bg_color',
                        'label' => esc_html__('Project Background Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set color for Background', 'confin-core')
                      ),
                      array(
                        'name' => 'btn_bgcolor',
                        'label' => esc_html__('Project Slider Button Background Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set button Background color for Project Slider', 'confin-core')
                      ),
                      array(
                        'name' => 'btn_color',
                        'label' => esc_html__('Project Slider Button Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set button color for Project Slider', 'confin-core')
                      ),
		                )
	                )
	            ),  // End of elemnt kc_icon

	        )
	    ); // End add map

	} // End if

}
