<?php
vc_map(
	array(
		"name" => esc_html__("CMS Contact info", 'haswell'),
	    "base" => "cms_contact_info",
	    "class" => "vc-cms-contact-info",
	    "category" => esc_html__("CmsSuperheroes Shortcodes", 'haswell'),
	    "params" => array(
	    	array(
	            "type" => "textfield",
	            "heading" => esc_html__("Title",'haswell'),
	            "param_name" => "title",
	            "value" => "",
	            "description" => esc_html__("Title Of Contact info",'haswell'),
	            "group" => esc_html__("General Settings", 'haswell')
	        ),
	        array(
	            'type' => 'textarea_html',
				'holder' => 'div',
	            "heading" => esc_html__("Description",'haswell'),
	            "param_name" => "content",
	            "value" => "",
	            "description" => esc_html__("Description Contact info",'haswell'),
	            "admin_label" => false,
	            "group" => esc_html__("General Settings", 'haswell')
	        ),
	        /* Start Items */
	        /* Start Icon */
	        array(
				'type' => 'dropdown',
		        'heading' => esc_html__( 'Icon library', 'haswell' ),
		        'value' => array(
		            esc_html__( 'Font Awesome', 'haswell' ) => 'fontawesome',
		            esc_html__( 'Linea Icons', 'haswell' ) => 'lineaicon',
		            esc_html__( 'Glyphicons', 'haswell' ) => 'glyphicon',
		            esc_html__( 'Elegant Icon', 'haswell' ) => 'elegant',
		        ),
		        'param_name' => 'icon_type',
		        'description' => esc_html__( 'Select icon library.', 'haswell' ),
		        "group" => esc_html__("General Settings", 'haswell')
			),
			array(
				'type' => 'iconpicker',
		        'heading' => esc_html__( 'Icon', 'haswell' ),
		        'param_name' => 'icon_fontawesome',
		        'value' => '',
		        'settings' => array(
		            'emptyIcon' => true, // default true, display an "EMPTY" icon?
		            'type' => 'fontawesome',
		            'iconsPerPage' => 200, // default 100, how many icons per/page to display
		        ),
		        'dependency' => array(
		            'element' => 'icon_type',
		            'value' => 'fontawesome',
		        ),
		        'description' => esc_html__( 'Select icon from library.', 'haswell' ),
		        "group" => esc_html__("General Settings", 'haswell')
			),
	        array(
				'type' => 'iconpicker',
		        'heading' => esc_html__( 'Icon', 'haswell' ),
		        'param_name' => 'icon_lineaicon',
		        'value' => '',
		        'settings' => array(
		            'emptyIcon' => true, // default true, display an "EMPTY" icon?
		            'type' => 'lineaicon',
		            'iconsPerPage' => 200, // default 100, how many icons per/page to display
		        ),
		        'dependency' => array(
		            'element' => 'icon_type',
		            'value' => 'lineaicon',
		        ),
		        'description' => esc_html__( 'Select icon from library.', 'haswell' ),
				"group" => esc_html__("General Settings", 'haswell')
			),
			array(
				'type' => 'iconpicker',
		        'heading' => esc_html__( 'Icon', 'haswell' ),
		        'param_name' => 'icon_glyphicon',
		        'value' => '',
		        'settings' => array(
		            'emptyIcon' => true, // default true, display an "EMPTY" icon?
		            'type' => 'glyphicon',
		            'iconsPerPage' => 200, // default 100, how many icons per/page to display
		        ),
		        'dependency' => array(
		            'element' => 'icon_type',
		            'value' => 'glyphicon',
		        ),
		        'description' => esc_html__( 'Select icon from library.', 'haswell' ),
				"group" => esc_html__("General Settings", 'haswell')
			),
			array(
				'type' => 'iconpicker',
		        'heading' => esc_html__( 'Icon', 'haswell' ),
		        'param_name' => 'icon_elegant',
		        'value' => '',
		        'settings' => array(
		            'emptyIcon' => true, // default true, display an "EMPTY" icon?
		            'type' => 'elegant',
		            'iconsPerPage' => 200, // default 100, how many icons per/page to display
		        ),
		        'dependency' => array(
		            'element' => 'icon_type',
		            'value' => 'elegant',
		        ),
		        'description' => esc_html__( 'Select icon from library.', 'haswell' ),
				"group" => esc_html__("General Settings", 'haswell')
			),
			
			array(
		        "type" => "dropdown",
		        "class" => "",
		        "heading" => esc_html__("Animation Delay Time", 'haswell'),
		        "param_name" => "css_animation_delay",
		        "value" => array(
		            'None' => '0ms',
		            '200ms' => '200ms',
		            '400ms' => '400ms',
		            '600ms' => '600ms',
		            '800ms' => '800ms',
		            '1000ms' => '1000ms',
		        ),
		        "description" => esc_html__('Animation Delay Time', 'haswell'),
		        "group" => esc_html__("General Settings", 'haswell')
		    ),
	        array(
	            "type" => "textfield",
	            "heading" => esc_html__("Extra Class",'haswell'),
	            "param_name" => "class",
	            "value" => "",
	            "description" => '',
	            "group" => esc_html__("Template", 'haswell')
	        ),
	    	array(
	            "type" => "cms_template",
	            "param_name" => "cms_template",
	            "admin_label" => true,
	            "heading" => esc_html__("Shortcode Template",'haswell'),
	            "shortcode" => "cms_contact_info",
	            "group" => esc_html__("Template", 'haswell'),
	        )
		)
	)
);
class WPBakeryShortCode_cms_contact_info extends CmsShortCode{
	protected function content($atts, $content = null){
		$atts_extra = shortcode_atts(array(
			'title' => '',
			'icon_type' => 'fontawesome',
			'icon_fontawesome' => '',
			'icon_openiconic' => '',
			'icon_typicons' => '',
			'icon_entypoicons' => '',
			'icon_linecons' => '',
			'icon_entypo' => '',
			'icon_pe7stroke' => '',
			'cms_template' => 'cms_contact_info.php',
			'class' => '',
			    ), $atts);
		$atts = array_merge($atts_extra,$atts);
		$atts['icon_type'] = isset($atts['icon_type'])?$atts['icon_type']:'fontawesome';
		$atts['description'] = isset($atts['description'])?$atts['description']:'';
		$atts['title'] = isset($atts['title'])?$atts['title']:'';
		switch ($atts['icon_type']) {
			case 'pe7stroke':
				wp_enqueue_style('cms-icon-pe7stroke', CMS_CSS. 'Pe-icon-7-stroke.css');
				break;
			case 'rticon':
				wp_enqueue_style('cms-icon-rticon', CMS_CSS. 'rticon.css');
				break;
			default:
				vc_icon_element_fonts_enqueue( $atts['icon_type'] );
				break;
		}
        $html_id = cmsHtmlID('cms-contact-info');
        $atts['template'] = 'template-'.str_replace('.php','',$atts['cms_template']). ' '. $atts['class'];
        $atts['html_id'] = $html_id;
		return parent::content($atts, $content);
	}
}