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

	global $variations;
	$variations['Black'] = 'black';
	$variations['White'] = 'white';

	global $dt_animation_types;

	vc_map( array(
		"name" => esc_html__( "Button", 'dental-core' ),
		"base" => "dt_sc_button",
		"icon" => "dt_sc_button",
		"category" => DT_VC_CATEGORY,
		"params" => array(

			// Button Text
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Text', 'dental-core' ),
				'param_name' => 'title',
				'value' => esc_html__( 'Text on the button', 'dental-core' ),
			),

			// Button Link
			array(
				'type' => 'vc_link',
				'heading' => esc_html__( 'URL (Link)', 'dental-core' ),
				'param_name' => 'link',
				'description' => esc_html__( 'Add link to button', 'dental-core' ),
			),

			// Button Size
			array(
				'type' => 'dropdown',
				'heading' => esc_html__( 'Size', 'dental-core' ),
				'description' => esc_html__( 'Select button display size', 'dental-core' ),
				'param_name' => 'size',
				'value' => array(
					esc_html__( 'Small', 'dental-core' ) => 'small',
					esc_html__( 'Medium', 'dental-core' ) => 'medium',
					esc_html__( 'Large', 'dental-core' ) => 'large',
					esc_html__( 'Xlarge', 'dental-core' ) => 'xlarge',
				),
				'std' => 'small'
			),

			// Content Color			
			array(
				"type" => "colorpicker",
      			"heading" => esc_html__( "Text color", 'dental-core' ),
      			"param_name" => "textcolor",
      			"description" => esc_html__( "Select text color", 'dental-core' ),
      		),

			array(
				"type" => "textfield",
      			"heading" => esc_html__( "Text size", 'dental-core' ),
      			"param_name" => "textsize",
      			"description" => esc_html__( "Select text size ( eg: 10px or 1.5em )", 'dental-core' ),
      		),      		

      		// Custom Font
      		array(
      			'type' => 'checkbox',
				'heading' => esc_html__( 'Use theme default font family?', 'dental-core' ),
				'param_name' => 'use_theme_fonts',
				'value' => array( esc_html__( 'Yes', 'dental-core' ) => 'yes'  ),
				'std' => 'yes',
				'description' => esc_html__( 'Use font family from the theme.', 'dental-core' ),
			),

			array(
				'type' => 'google_fonts',
				'param_name' => 'google_fonts',
				'group' => esc_html__('Typography','dental-core'),
				'value' => 'font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal',
				'settings' => array(
					'fields' => array(
						'font_family_description' => esc_html__( 'Select font family.', 'dental-core' ),
						'font_style_description' => esc_html__( 'Select font styling.', 'dental-core' ),
					),
				),
				'dependency' => array(
					'element' => 'use_theme_fonts',
					'value_not_equal_to' => 'yes',
				),
			),


      		// Variation
      		array(
      			'type' => 'dropdown',
      			'heading' => esc_html__( 'Background Color', 'dental-core' ),
      			'admin_label' => true,
      			'param_name' => 'color',
      			'value' => $variations,
      			'description' => esc_html__( 'Select button background color', 'dental-core' ),
      		),

			// BG Color			
			array(
				"type" => "colorpicker",
      			"heading" => esc_html__( "Custom Background color", 'dental-core' ),
      			"param_name" => "bgcolor",
      			"description" => esc_html__( "Select button background color", 'dental-core' ),
				'dependency' => array( 'element' => 'color', 'value' =>'-' )
      		),      		      					

			// Button Style
			array(
				'type' => 'dropdown',
				'heading' => esc_html__( 'Style', 'dental-core' ),
				'description' => esc_html__( 'Select button display style', 'dental-core' ),
				'param_name' => 'style',
				'value' => array(
					esc_html__( 'None', 'dental-core') => '',
					esc_html__( 'Bordered', 'dental-core' ) => 'bordered',
					esc_html__( 'Filled', 'dental-core' ) => 'filled',
					esc_html__( 'Filled Rounded Corner', 'dental-core' ) => 'filled rounded-corner',
					esc_html__( 'Rounded Corner', 'dental-core' ) => 'rounded-corner',
					esc_html__( 'Rounded Border', 'dental-core' ) => 'rounded-border',
					esc_html__( 'Fully Rounded Border', 'dental-core' ) => 'fully-rounded-border',
					esc_html__( 'Fully Rounded Corner', 'dental-core' ) => 'filled fully-rounded-corner',
				),				
			),

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

			// Icon Alignment
			array(
				'type' => 'dropdown',
				'heading' => esc_html__( 'Icon Alignment', 'dental-core' ),
				'description' => esc_html__( 'Select icon alignment', 'dental-core' ),
				'param_name' => 'iconalign',
				'value' => array(
					esc_html__( 'Left', 'dental-core' ) => 'icon-left with-icon',
					esc_html__( 'Right', 'dental-core' ) => 'icon-right with-icon',
				),
				'dependency' => array( 'element' => 'icon_type', 'value' => array( 'fontawesome', 'css_class' ) ),
				'std' => ''
			),

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

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

			// Button Animation
			array(
				'type' => 'dropdown',
				'heading' => esc_html__( 'Animation', 'dental-core' ),
				'description' => esc_html__( 'Select button animation', 'dental-core' ),
				'param_name' => 'animation',
				'value' => $dt_animation_types
			),			

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

			// Custom CSS
			array(
				'type' => 'css_editor',
				'heading' => esc_html__( 'CSS box', 'dental-core' ),
				'param_name' => 'css',
				'group' => esc_html__( 'Design Options', 'dental-core' )
			),
		)
	) );
} ?>