<?php

function envy_chimp_vc_template($attr) {

	extract(
		shortcode_atts(array(
			'envy_form_title' => 'EnvyChimp',
			'envy_form_type'  => ''		  
		), $attr)
	);
		
	ob_start();
	
	if( ! $envy_form_title == '' )	: ?>
	    <h2 style="text-align: center;margin-bottom: 20px;"><?php echo esc_html__($envy_form_title); ?></h2>
	<?php endif;

	if( $envy_form_type == 'select_subscribe' ) :
        echo do_shortcode("[envy_chimp_subscribe_form]");
    elseif( $envy_form_type == 'select_login_signup' ) :
        echo do_shortcode("[envy_chimp_login_signup_form]");
    elseif( $envy_form_type == 'select_login' ) :
        echo do_shortcode("[envy_chimp_login_form]");
	elseif( $envy_form_type == 'select_signup' ) :
        echo do_shortcode("[envy_chimp_signup_form]");
	endif;	
			
	return ob_get_clean();		
}

add_shortcode('envy_chimp_vc_base', 'envy_chimp_vc_template');
