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

	global $variations;

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

			# Types
      		array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Types', 'dental-core' ),
      			'param_name' => 'type',
      			'value' => array( 
      				esc_html__('Type 1','dental-core') => 'type1',		esc_html__('Type 2','dental-core') => 'type2',		esc_html__('Type 3','dental-core') => 'type3',
      				esc_html__('Type 4','dental-core') => 'type4',		esc_html__('Type 5','dental-core') => 'type5',		esc_html__('Type 6','dental-core') => 'type6',
      				esc_html__('Type 7','dental-core') => 'type7',		esc_html__('Type 8','dental-core') => 'type8',		esc_html__('Type 9','dental-core') => 'type9',
      				esc_html__('Type 10','dental-core') => 'type10',		esc_html__('Type 11','dental-core') => 'type11',      esc_html__('Type 12','dental-core') => 'type12',
                    esc_html__('Type 13','dental-core') => 'type13',      esc_html__('Type 14','dental-core') => 'type14'
      			),
      			'description' => esc_html__( 'Select icon box type', 'dental-core' ),
      			'std' => 'type1',
      			'admin_label' => true
      		),

      		# 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"
      		),

      		# 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' )
			),

			# Hover Image
			array(
				'type' => 'attach_image',
				'heading' => esc_html__( 'Hover Image', 'dental-core' ),
				'param_name' => 'hoverurl',
				'description' => esc_html__( 'Select hover 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',
				  )
			),      		

      		# Color
      		array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Color', 'dental-core' ),
      			'param_name' => 'color',
      			'value' => $variations,
				'dependency' => array('element' => 'type','value' => 'type14')
      		),

      		# URL
      		array(
      			'type' => 'vc_link',
      			'heading' => esc_html__( 'URL (Link)', 'dental-core' ),
      			'param_name' => 'link',
      			'description' => esc_html__( 'Add link to icon box', 'dental-core' )
      		),

      		# Content
      		array(
      			'type' => 'textarea_html',
      			'heading' => esc_html__( 'Content', 'dental-core' ),
      			'param_name' => 'content',
      			'value' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi hendrerit elit turpis, a porttitor tellus sollicitudin at. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>'
      		),

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

                  array(
                        'type' => 'textarea',
                        'heading' => "Inline styles",
                        'param_name' => 'addstyles',
                        'description' => esc_html__( 'Enter inline styles for this iconbox', 'dental-core' )
                  )      		
		)
	) );
}?>