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

  if (function_exists('kc_add_map')){
      kc_add_map(
          array(
              'reg_cta' => array(
                  'name' => esc_html__('Confin CTA','confin-core'),
                  'description' => esc_html__('Display single icon', 'confin-core'),
                  'icon' => 'cpicon kc-icon-call-action',
                  'category' => ConfinLibrary::confin_kc_cat_name(),
                  'params' => array(
                  'Content' => array(
                     array(
                          'name' => 'cta_style',
                          'label' => esc_html__('Slide Style', 'confin-core'),
                          'type' => 'select',
                          'options' => array(
                            'style_one' => esc_html__( 'Style One', 'confin-core' ),
                            'style_two' => esc_html__( 'Style Two', 'confin-core' ),
                          ),
                          'admin_label' => true,
                      ),
                      array(
                        'name' => 'title',
                        'label' => esc_html__( 'CTA Title','confin-core'),
                        'type' => 'textarea',
                        'admin_label' => true,
                        'description' => esc_html__('Write Contact Info  Title ', 'confin-core'),
                      ),
                      array(
                        'name' => 'desc',
                        'label' => esc_html__( 'CTA Description','confin-core'),
                        'type' => 'textarea',
                        'admin_label' => true,
                      ),
                    array(
                      'type'          => 'group',
                      'label'         => esc_html__('CTA Links', 'confin-core'),
                      'name'          => 'cta_links',
                      'options'       => array('add_text' => esc_html__('Add New Link', 'confin-core')),
                      'params' => array(
                        array(
                          'name' => 'link',
                          'label' => esc_html__( 'CTA Link','confin-core'),
                          'type' => 'text',
                          'admin_label' => true,
                          'description' => esc_html__('Write CTA Link ', 'confin-core'),
                        ),
                        array(
                          'name' => 'link_text',
                          'label' => esc_html__( 'CTA Link Text','confin-core'),
                          'type' => 'text',
                          'admin_label' => true,
                          'description' => esc_html__('Write CTA Link Text', 'confin-core'),
                        ),
                        array(
                          'name' => 'icon',
                          'label' => esc_html__( 'Icon','confin-core'),
                          'type' => 'icon_picker',
                          'admin_label' => true,
                        ),
                      )
                    ),
                    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')
                    ),
                    ),
                    'Style' => array(
                      array(
                        'name' => 'title_size',
                        'label' => esc_html__('Title Size','confin-core'),
                        'type' => 'number_slider',
                        'options' => array(
                          'min' => 16,
                          'max' => 60,
                          'unit' => 'px',
                          'show_input' => true
                        ),
                        'description' => esc_html__('Enter font-size for title such as: 15px, 1em ..etc..', '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' => 'desc_size',
                        'label' => esc_html__('Description Size','confin-core'),
                        'type' => 'number_slider',
                        'options' => array(
                          'min' => 16,
                          'max' => 60,
                          'unit' => 'px',
                          'show_input' => true
                        ),
                        'description' => esc_html__('Enter font-size for Description Title Size such as: 15px, 1em ..etc..', 'confin-core')
                      ),
                      array(
                        'name' => 'desc_color',
                        'label' => esc_html__('Description Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set color for Description', 'confin-core')
                      ),
                      array(
                        'name' => 'link_size',
                        'label' => esc_html__('Link Size','confin-core'),
                        'type' => 'number_slider',
                        'options' => array(
                          'min' => 16,
                          'max' => 60,
                          'unit' => 'px',
                          'show_input' => true
                        ),
                        'description' => esc_html__('Enter font-size for link such as: 15px, 1em ..etc..', 'confin-core')
                      ),
                      array(
                        'name' => 'link_color',
                        'label' => esc_html__('Link Color','confin-core'),
                        'type' => 'color_picker',
                        'admin_label' => true,
                        'description' => esc_html__('Set color for Button', 'confin-core')
                      ),
                    )
                  )
              ),  // End of elemnt kc_icon
          )
      ); // End add map
  } // End if
}
