<?php
/*
 * Templatation.com
 *
 * Social Accordion for VC
 *
 */

// Parent Element
function tt_lc_job_position_fn_vc() {
	vc_map( 
		array(
			"icon" => 'tt-vc-block',
		    'name'                    => esc_html__( 'Job position ' , 'logiscargo' ),
		    'base'                    => 'tt_lc_job_position_shortcode',
		    'description'             => esc_html__( 'Create job position accordion', 'logiscargo' ),
		    'as_parent'               => array('only' => 'tt_lc_job_position_content_shortcode'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)
		    'content_element'         => true,
		    "js_view" => 'VcColumnView',
			"category" => esc_html__('Logiscargo', 'logiscargo'),
			)
	);
}
add_action( 'vc_before_init', 'tt_lc_job_position_fn_vc' );

// Nested Element
function tt_lc_job_position_content_fn_vc() {
	
	vc_map(
		array(
			"icon" => 'tt-vc-block',
		    'name'            => esc_html__('Job position content', 'logiscargo'),
		    'base'            => 'tt_lc_job_position_content_shortcode',
		    'description'     => esc_html__( 'Job position content', 'logiscargo' ),
			"category" => esc_html__('Logiscargo', 'logiscargo'),
		    'content_element' => true,
		    'as_child'        => array('only' => 'tt_lc_job_position_shortcode'), // Use only|except attributes to limit parent (separate multiple values with comma)
		    'params'          => array(
		    	array(
		    		"type" => "textfield",
		    		"heading" => esc_html__("Title", 'logiscargo'),
		    		"param_name" => "title",
				    'description'     => esc_html__( 'Enter title for accordion.', 'logiscargo' ),
					'admin_label' => true,
		    	),
				array(
					"type" => "textfield",
					"heading" => esc_html__("Location/Type", 'logiscargo'),
					"param_name" => "location",
					'description'     => esc_html__( 'Enter location information.', 'logiscargo' ),

				),
				array(
					"type" => "textfield",
					"heading" => esc_html__("End date", 'logiscargo'),
					"param_name" => "date",
					'description'     => esc_html__( 'Enter last date', 'logiscargo' ),
				),
				array(
					"type" => "textfield",
					"heading" => esc_html__("Download box title", 'logiscargo'),
					"param_name" => "d_title",
					'description'     => esc_html__( 'Enter title for Download box.', 'logiscargo' ),
				),
				array(
					"type" => "textarea",
					"heading" => esc_html__("Download description", 'logiscargo'),
					"param_name" => "description",
					'description'     => esc_html__( 'Enter title for Download box.', 'logiscargo' ),
				),
				array(
					"type" => "textfield",
					"heading" => esc_html__("Button text", 'logiscargo'),
					"param_name" => "btn_text",
					'description'     => esc_html__( 'Enter button text', 'logiscargo' ),

				),
				array(
					"type" => "textfield",
					"heading" => esc_html__("Link", 'logiscargo'),
					"param_name" => "link",
					'description'     => esc_html__( 'Enter link', 'logiscargo' ),
				),
	            array(
	            	"type" => "textarea_html",
	            	"heading" => esc_html__("Job info", 'logiscargo'),
				    'description'     => esc_html__( 'Enter content for accordion.', 'logiscargo' ),
	            	"param_name" => "content"
	            ),
				array(
					'type'       => 'checkbox',
					'heading'    => esc_html__( 'Check this to make item active', 'logiscargo' ),
					'param_name' => 'active',
					'value'      => array( esc_html__( 'Yes, please', 'logiscargo' ) => 'yes' ),
				),
			),
		) 
	);
}
add_action( 'vc_before_init', 'tt_lc_job_position_content_fn_vc' );

// A must for container functionality, replace Wbc_Item with your base name from mapping for parent container
if(class_exists('WPBakeryShortCodesContainer')){
    class WPBakeryShortCode_tt_lc_job_position_shortcode extends WPBakeryShortCodesContainer {

    }
}

// Replace Wbc_Inner_Item with your base name from mapping for nested element
if(class_exists('WPBakeryShortCode')){
    class WPBakeryShortCode_tt_lc_job_position_content_shortcode extends WPBakeryShortCode {

    }
}