<?php add_action( 'vc_before_init', 'dt_sc_icon_heading_vc_map' );
function dt_sc_icon_heading_vc_map() {

	vc_map( array(
		"name" => esc_html__( "Icon Heading", 'dental-core' ),
		"base" => 'dt_sc_icon_heading',
		"icon" => 'dt_sc_icon_heading',
		"category" => DT_VC_CATEGORY,
		"params" => array(

			# Heading Tag
			array(
				'type' => 'dropdown',
				'heading' => esc_html__('Heading tag','dental-core'),
				'param_name' => 'tag',
				'value' => array(
					'H1' => 'h1',
					'H2' => 'h2',
					'H3' => 'h3',
					'H4' => 'h4',
					'H5' => 'h5',
					'H6' => 'h6'
				),
				'std' => 'h2',
			),

      		# Title
      		array(
      			"type" => "textfield",
      			"heading" => esc_html__( "Title", 'dental-core' ),
      			"param_name" => "title"
      		),

      		# Sub Title
      		array(
      			"type" => "textfield",
      			"heading" => esc_html__( "Sub Title", 'dental-core' ),
      			"param_name" => "subtitle"
      		),
			
			# Align
			array(
				'type' => 'dropdown',
				'heading' => esc_html__('Alignment', 'dental-core'),
				'param_name' => 'align',
				'value' => array( 'Left' => 'alignleft', 'Center' => 'aligncenter', 'Right' => 'alignright' ),
				'std' => 'aligncenter'
			),

      		# Icon Type
      		array(
      			'type' => 'dropdown',
      			'heading' => esc_html__('Icon Type','dental-core'),
      			'param_name' => 'icon_type',
      			'value' => array( 
                              esc_html__('Image','dental-core') => 'image',
                              esc_html__('Font Awesome', 'dental-core' ) => 'fontawesome' ,
                              esc_html__('Class','dental-core') => 'css_class',
                              esc_html__('None','dental-core') => 'none' ),
      			'std' => 'fontawesome'
      		),

      		# Font Awesome
			array(
				'type' => 'iconpicker',
				'heading' => esc_html__( 'Font Awesome', 'dental-core' ),
				'param_name' => 'icon',
				'value' => 'fa fa-info-circle',
				'settings' => array( 'emptyIcon' => false, 'iconsPerPage' => 4000 ),
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'fontawesome',
				),
				'description' => esc_html__( 'Select icon from library', 'dental-core' ),
			),

			# Custom Image
			array(
				'type' => 'attach_image',
				'heading' => esc_html__( 'Image', 'dental-core' ),
				'param_name' => 'iconurl',
				'description' => esc_html__( 'Select image from media library', 'dental-core' ),
				'dependency' => array( 'element' => 'icon_type', 'value' => 'image' )
			),

			# Custom Class
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Custom class', 'dental-core' ),
				'param_name' => 'icon_css_class',
				'value' => '',
				'dependency' => array(
					'element' => 'icon_type',
					'value' => 'css_class',
				)
			),

			# Extra class name
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Extra class name', 'dental-core' ),
				'param_name' => 'class',
				'description' => esc_html__( 'Style particular element differently - add a class name and refer to it in custom CSS', 'dental-core' )
      		)
		)
	) );
}?>