<?php
/*
Plugin Name: EventoZilla - Event Calendar - Addon For Visual Composer
Description: A Visual Composer Addon which will allow you to insert an advanced events calendar on your page.
Version: 1.4.1
Author: Lambert Group
Author URI: https://1.envato.market/OZ5Zr
Text Domain: lbg-eventzillabakery
*/

$eventzilla_addon_rand_id=rand(10,999999);

if ( ! defined( 'ABSPATH' ) ) {
	die( '-1' );
}


function eventzilla_addon_vc_map_dependencies() {
	if ( ! defined( 'WPB_VC_VERSION' ) ) {
		$plugin_data = get_plugin_data(__FILE__);
        echo '<div class="updated">
          <p>'.sprintf(__('<strong>%s</strong> requires <strong><a href="https://bit.ly/vcomposer" target="_blank">Visual Composer</a></strong> plugin to be installed and activated on your site.', 'lbg-eventzillabakery'), $plugin_data['Name']).'</p>
        </div>';
	}
}
add_action( 'admin_notices', 'eventzilla_addon_vc_map_dependencies' );


function eventzilla_addon_vc_map_init() {
	//categories start
	global $wpdb;
	global $eventzilla_addon_rand_id;



	//Create New Param Type 'eventzilla_attach_media'
			//add_shortcode_param
			vc_add_shortcode_param( 'eventzilla_attach_media', 'eventzilla_addon_attach_media_callback', plugins_url() . '/lbg_eventozilla_addon_visual_composer/assets/new_param_type/attach_media.js');
			function eventzilla_addon_attach_media_callback( $settings, $value ) {
				return '<div class="my_param_block">'
				.'<input id="' . esc_attr( $settings['param_name'] ) . '" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb-textinput ' . esc_attr( $settings['param_name'] ) . ' ' .              esc_attr( $settings['type'] ) . '_field" type="text" value="' . esc_attr( $value ) . '"/>' .
				'<input name="upload_' . esc_attr( $settings['param_name'] ) . '_button" type="button" id="upload_' . esc_attr( $settings['param_name'] ) . '_button" value="Upload File"/> '.'</div>'; // This is html markup that will be outputted in content elements edit form
			}

			//Create New Param Type 'eventzilla_date_picker'
					vc_add_shortcode_param( 'eventzilla_date_picker', 'eventzilla_date_picker_callback', plugins_url() . '/lbg_eventozilla_addon_visual_composer/assets/new_param_type/eventzilla_date_picker.js');
					function eventzilla_date_picker_callback( $settings, $value ) {
						return '<div class="my_param_block">'
						.'<input id="' . esc_attr( $settings['param_name'] ) . '" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb-textinput lbg_w70 ' . esc_attr( $settings['param_name'] ) . ' ' .              esc_attr( $settings['type'] ) . '_field" type="text" value="' . esc_attr( $value ) . '" />'.'</div>'; // This is html markup that will be outputted in content elements edit form
					}


					vc_add_shortcode_param( 'eventzilla_slider', 'eventzilla_slider_callback', plugins_url() . '/lbg_eventozilla_addon_visual_composer/assets/new_param_type/eventzilla_slider.js');
					function eventzilla_slider_callback( $settings, $value ) {
						return '<div class="my_param_block">'
						.'<input id="' . esc_attr( $settings['param_name'] ) . '" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb-textinput lbg_w70 ' . esc_attr( $settings['param_name'] ) . ' ' .              esc_attr( $settings['type'] ) . '_field" type="text" value="' . esc_attr( $value ) . '" />'.'<div id="' . esc_attr( $settings['param_name'] ) . '-slider-range-min" class="lbg_w200"></div>'.'</div>'; // This is html markup that will be outputted in content elements edit form
					}




	vc_map( array(
		'name' => __( 'EventZilla Settings', 'lbg-eventzillabakery' ),
		'base' => 'eventzilla',
		"icon" => plugins_url('assets/images/eventzilla_icon.png', __FILE__), // or css class name which you can reffer in your css file later. Example: "vc_extend_my_class"
		"category" => __('LBG Multimedia Addons', 'lbg-eventzillabakery' ),
		"description" => __("Advanced events calendar", 'lbg-eventzillabakery'), //vc_extend
		'show_settings_on_create' => true,
		'is_container' => true,
		'admin_enqueue_js'        => preg_replace( '/\s/', '%20', plugins_url( 'assets/eventzilla.js', __FILE__ ) ),
		// This will load extra js file in backend (when you edit page with VC)
		// use preg replace to be sure that "space" will not break logic
		'admin_enqueue_css'       => preg_replace( '/\s/', '%20', plugins_url( 'assets/eventzilla.css', __FILE__ ) ),
		// This will load extra css file in backend (when you edit page with VC)
		'params' => array(
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Calendar ID', 'lbg-eventzillabakery' ),
				'param_name' => 'id',
				'value' => esc_html__( "".esc_attr($eventzilla_addon_rand_id)."", "lbg-eventzillabakery" ),
				'description' => esc_html__( "It is automaticaly generated and it has to be unique. You can leave it just like it is.", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Calendar Width', 'lbg-eventzillabakery' ),
				'param_name' => 'width', //width
				'value' => esc_html__( "720", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Center Calendar', 'lbg-eventzillabakery' ),
				'param_name' => 'centerplugin', //centerPlugin
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
				 ),
				'description' => esc_html__( "Center the calendar", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "Search" Text', 'lbg-eventzillabakery' ),
				'param_name' => 'searchinputtext', //searchInputText
				'value' => esc_html__( "search...", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Vertical Padding', 'lbg-eventzillabakery' ),
				'param_name' => 'eventslistverticalpadding', //eventsListVerticalPadding
				'value' => esc_html__( "20", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Horizontal Padding', 'lbg-eventzillabakery' ),
				'param_name' => 'eventslisthorizontalpadding', //eventsListHorizontalPadding
				'value' => esc_html__( "10", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Title Left Margin', 'lbg-eventzillabakery' ),
				'param_name' => 'eventtitleleftmargin', //eventTitleLeftMargin
				'value' => esc_html__( "15", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Title Font Size', 'lbg-eventzillabakery' ),
				'param_name' => 'eventtitlefontsize', //eventTitleFontSize
				'value' => esc_html__( "27", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event First Date Font Size', 'lbg-eventzillabakery' ),
				'param_name' => 'eventfirstdatefontsize', //eventFirstDateFontSize
				'value' => esc_html__( "92", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Second Date Font Size', 'lbg-eventzillabakery' ),
				'param_name' => 'eventseconddatefontsize', //eventSecondDateFontSize
				'value' => esc_html__( "20", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Second Date Month Font Size', 'lbg-eventzillabakery' ),
				'param_name' => 'eventseconddatemonthfontsize', //eventSecondDateMonthFontSize
				'value' => esc_html__( "13", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Show The Month First In The Date', 'lbg-eventzillabakery' ),
				'param_name' => 'showmonthfirstfordate', //showMonthFirstForDate
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
				 )
			),
			array(
				'group' => 'General',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Show End Date', 'lbg-eventzillabakery' ),
				'param_name' => 'showenddate', //showEndDate
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
				 )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Initial Details Font Size', 'lbg-eventzillabakery' ),
				'param_name' => 'eventinitialdetailsfontsize', //eventInitialDetailsFontSize
				'value' => esc_html__( "14", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Bottom Border Color", "lbg-eventzillabakery" ),
				'param_name' => 'eventbottombordercolor', //eventBottomBorderColor
				'value' => '#CCCCCC',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Background Color - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventbackgroundcolor_odd', //eventBackgroundColor_odd
				'value' => '#ffffff',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Background Color - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventbackgroundcolor_even', //eventBackgroundColor_even
				'value' => '#ebebeb',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Background for Day Color (Vertical Text) - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventbgdaycolor_odd', //eventBgDayColor_odd
				'value' => '#da0000',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Background for Day Color (Vertical Text) - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventbgdaycolor_even', //eventBgDayColor_even
				'value' => '#000000',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Date Color - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventdatecolor_odd', //eventDateColor_odd
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Date Color - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventdatecolor_even', //eventDateColor_even
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Title Color - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventtitlecolor_odd', //eventTitleColor_odd
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Title Color - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventtitlecolor_even', //eventTitleColor_even
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Initial Details Color - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventinitialdetailscolor_odd', //eventInitialDetailsColor_odd
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Initial Details Color - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'eventinitialdetailscolor_even', //eventInitialDetailsColor_even
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Dress Code', 'lbg-eventzillabakery' ),
				'param_name' => 'dresscode', //dressCode
				'value' => esc_html__( "Dress code", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Dress Code Font Size', 'lbg-eventzillabakery' ),
				'param_name' => 'dresscodefontsize', //dressCodeFontSize
				'value' => esc_html__( "13", "lbg-eventzillabakery" )
			),
			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Dress Code Color - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'dresscodecolor_odd', //dressCodeColor_odd
				'value' => '#808080',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Dress Code Color - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'dresscodecolor_even', //dressCodeColor_even
				'value' => '#808080',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Social Icons Color - For Odd Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'socialiconscolor_odd', //socialIconsColor_odd
				'value' => '#000000',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Social Icons Color - For Even Item in the Events List", "lbg-eventzillabakery" ),
				'param_name' => 'socialiconscolor_even', //socialIconsColor_even
				'value' => '#FFFFFF',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'January Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_jan', //shortmonth_Jan
				'value' => esc_html__( "Jan", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'February Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_feb', //shortmonth_Feb
				'value' => esc_html__( "Feb", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'March Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_mar', //shortmonth_Mar
				'value' => esc_html__( "Mar", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'April Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_apr', //shortmonth_Apr
				'value' => esc_html__( "Apr", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'May Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_may', //shortmonth_May
				'value' => esc_html__( "May", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'June Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_jun', //shortmonth_Jun
				'value' => esc_html__( "Jun", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'July Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_jul', //shortmonth_Jul
				'value' => esc_html__( "Jul", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'August Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_aug', //shortmonth_Aug
				'value' => esc_html__( "Aug", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'September Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_sep', //shortmonth_Sep
				'value' => esc_html__( "Sep", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'October Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_oct', //shortmonth_Oct
				'value' => esc_html__( "Oct", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'November Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_nov', //shortmonth_Nov
				'value' => esc_html__( "Nov", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'December Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_dec', //shortmonth_Dec
				'value' => esc_html__( "Dec", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'December Abbreviation', 'lbg-eventzillabakery' ),
				'param_name' => 'shortmonth_dec', //shortmonth_Dec
				'value' => esc_html__( "Dec", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Sunday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_sunday', //longdays_Sunday
				'value' => esc_html__( "Sunday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Monday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_monday', //longdays_Monday
				'value' => esc_html__( "Monday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Tuesday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_tuesday', //longdays_Tuesday
				'value' => esc_html__( "Tuesday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Wednesday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_wednesday', //longdays_Wednesday
				'value' => esc_html__( "Wednesday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Thursday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_thursday', //longdays_Thursday
				'value' => esc_html__( "Thursday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Friday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_friday', //longdays_Friday
				'value' => esc_html__( "Friday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Saturday', 'lbg-eventzillabakery' ),
				'param_name' => 'longdays_saturday', //longdays_Saturday
				'value' => esc_html__( "Saturday", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Sunday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'sunday_color', //Sunday_color
				'value' => '#fff000',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Monday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'monday_color', //Monday_color
				'value' => '#00ffe0',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Tuesday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'tuesday_color', //Tuesday_color
				'value' => '#ff780a',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Wednesday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'wednesday_color', //Wednesday_color
				'value' => '#c96bb6',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Thursday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'thursday_color', //Thursday_color
				'value' => '#00ff36',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Friday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'friday_color', //Friday_color
				'value' => '#ff00a8',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Saturday (Vertical Text) Background Color", "lbg-eventzillabakery" ),
				'param_name' => 'saturday_color', //Saturday_color
				'value' => '#008aff',
				'description' => esc_html__( "If the 'Event Background for Day Color (Vertical Text)' is defined this parameter will be ignored.", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Event Days (Vertical Text) Color", "lbg-eventzillabakery" ),
				'param_name' => 'eventdayscolor', //eventDaysColor
				'value' => '#FFFFFF',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Use 24 Hours Format', 'lbg-eventzillabakery' ),
				'param_name' => 'use24hoursformat', //use24HoursFormat
				'value'       => array(
					'No'   => 'false',
					'Yes'   => 'true'
				  )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate: No Events Available', 'lbg-eventzillabakery' ),
				'param_name' => 'noeventsavailabletext', //noEventsAvailableText
				'value' => esc_html__( "No event available for this month", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate: Cancelled', 'lbg-eventzillabakery' ),
				'param_name' => 'eventcancelledtext', //noEventsAvailableText
				'value' => esc_html__( "Cancelled", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "Buy Now" Text', 'lbg-eventzillabakery' ),
				'param_name' => 'booknowtext', //bookNowText
				'value' => esc_html__( "Book Now", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'General',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Book Now Link Target', 'lbg-eventzillabakery' ),
				'param_name' => 'booknowlinktarget', //bookNowLinkTarget
				'value'       => array(
					'_self'   => '_self',
					'_blank'   => '_blank'
					)
			),

			array(
				'group' => 'General',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "Ended" Text', 'lbg-eventzillabakery' ),
				'param_name' => 'endedtext', //endedText
				'value' => esc_html__( "Ended", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),


			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Show Full Calendar On Left', 'lbg-eventzillabakery' ),
				'param_name' => 'fullcalendaronleft', //fullCalendarOnLeft
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
					)
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side/Top Months Area Color", "lbg-eventzillabakery" ),
				'param_name' => 'months_area_color', //months_area_color
				'value' => '#ffffff',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Days Color", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendardayscolor', //leftSideCalendarDaysColor
				'value' => '#707275',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Past Month Days Color", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendarpastmonthdayscolor', //leftSideCalendarPastMonthDaysColor
				'value' => '#aaaaaa',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Next Month Days Color", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendarnextmonthdayscolor', //leftSideCalendarNextMonthDaysColor
				'value' => '#aaaaaa',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Current Day Colo", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendarcurrentdaycolor', //leftSideCalendarCurrentDayColor
				'value' => '#00ffe0',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Event Days Color", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendareventdayscolor', //leftSideCalendarEventDaysColor
				'value' => '#0000CC',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Event Days Bg Color", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendareventdaysbgcolor', //leftSideCalendarEventDaysBgColor
				'value' => '#00ffe0',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Left Side Calendar Days Name Color", "lbg-eventzillabakery" ),
				'param_name' => 'leftsidecalendardaysnamecolor', //leftSideCalendarDaysNameColor
				'value' => '#000000',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Year Color", "lbg-eventzillabakery" ),
				'param_name' => 'yearcolor', //yearColor
				'value' => '#a3a3a3',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Month Color", "lbg-eventzillabakery" ),
				'param_name' => 'monthcolor', //monthColor
				'value' => '#444444',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Month Year Line Separator Color", "lbg-eventzillabakery" ),
				'param_name' => 'monthyearlineseparatorcolor', //monthYearLineSeparatorColor
				'value' => '#da0000',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Left Side or Top Calendar',
				'type' => 'colorpicker',
				'heading' => esc_html__( "Months Next Prev Arrows Color", "lbg-eventzillabakery" ),
				'param_name' => 'monthsnextprevarrowscolor', //monthsNextPrevArrowsColor
				'value' => '#d1d1d1',
				'description' => esc_html__( "Choose the color", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Details Area',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "Details" Title', 'lbg-eventzillabakery' ),
				'param_name' => 'detailstitle', //detailsTitle
				'value' => esc_html__( "Details", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Details Area',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "When Where" Title', 'lbg-eventzillabakery' ),
				'param_name' => 'whenwheretitle', //whenWhereTitle
				'value' => esc_html__( "When & Where", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Details Area',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "Organizer" Title', 'lbg-eventzillabakery' ),
				'param_name' => 'organizertitle', //organizerTitle
				'value' => esc_html__( "Organizer", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Details Area',
				'type' => 'textfield',
				'heading' => esc_html__( 'Translate "More Details" Title', 'lbg-eventzillabakery' ),
				'param_name' => 'organizertitle', //organizerTitle
				'value' => esc_html__( "Organizer", "lbg-eventzillabakery" ),
				'description' => esc_html__( "if your website uses other language than English", "lbg-eventzillabakery" )
			),

			array(
				'group' => 'Details Area',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Show Facebook But', 'lbg-eventzillabakery' ),
				'param_name' => 'showfacebookbut', //showFacebookBut
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
					)
			),

			array(
				'group' => 'Details Area',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Show Twitter But', 'lbg-eventzillabakery' ),
				'param_name' => 'showtwitterbut', //showTwitterBut
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
					)
			),

			array(
				'group' => 'Details Area',
				'type' => 'dropdown',
				'heading' => esc_html__( 'Show Pinterest But', 'lbg-eventzillabakery' ),
				'param_name' => 'showpinterestbut', //showPinterestBut
				'value'       => array(
					'Yes'   => 'true',
					'No'   => 'false'
					)
			),


		),
		'custom_markup' => '
	<div class="wpb_accordion_holder wpb_holder clearfix vc_container_for_children">
	%content%
	</div>
	<div class="tab_controls lbg_add_playlist_item">
		<a class="add_tab vc_add_playlist_item" title="' . esc_html__( 'Add New Event', 'lbg-eventzillabakery' ) . '"><span class="vc_playlist_item_vc_icon"></span>' . esc_html__( 'Add New Event', 'lbg-eventzillabakery' ) . '</a>
	</div>
	',
		'default_content' => '
		[eventzilla_playlist_item title="' . __( 'Event Title  1', 'lbg-eventzillabakery' ) . '"][/eventzilla_playlist_item]
	',
		'js_view' => 'VcEventZillaView'
	) );

	vc_map( array(
		'name' => esc_html__( 'Event Item', 'lbg-eventzillabakery' ),
		'base' => 'eventzilla_playlist_item',
		'allowed_container_element' => 'vc_row',
		'is_container' => true,
		'content_element' => false,
		'admin_enqueue_js'        => preg_replace( '/\s/', '%20', plugins_url( 'assets/playlist_item.js', __FILE__ ) ),
		// This will load extra js file in backend (when you edit page with VC)
		// use preg replace to be sure that "space" will not break logic

		'admin_enqueue_css'       => preg_replace( '/\s/', '%20', plugins_url( 'assets/playlist_item.css', __FILE__ ) ),
		// This will load extra css file in backend (when you edit page with VC)
		'params' => array(
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Title', 'lbg-eventzillabakery' ),
				'param_name' => 'title'
			),
			array(
				'type' => 'eventzilla_date_picker',
				'heading' => esc_html__( 'Event Start Date', 'lbg-eventzillabakery' ),
				'param_name' => 'xstartdate', //xstartdate
				'value' => esc_html__( "".date('n')."/".date('j')."/".date('Y'), "lbg-eventzillabakery" ),
				'description' => esc_html__( "MONTH/DAY/YEAR - Select the date when the event will start", "lbg-eventzillabakery" )
			),
			array(
				'type' => 'eventzilla_slider',
				'heading' => esc_html__( 'Event Start Date - Hours', 'lbg-eventzillabakery' ),
				'param_name' => 'xstartdate_hours', //beginDate_hours
				'value' => esc_html__( "0", "lbg-eventzillabakery" ),
				'description' => esc_html__( "values between 0-23", "lbg-eventzillabakery" )
			),
			array(
				'type' => 'eventzilla_slider',
				'heading' => esc_html__( 'Event Start Date - Minutes', 'lbg-eventzillabakery' ),
				'param_name' => 'xstartdate_minutes', //beginDate_hours
				'value' => esc_html__( "0", "lbg-eventzillabakery" ),
				'description' => esc_html__( "values between 0-59", "lbg-eventzillabakery" )
			),
			array(
				'type' => 'eventzilla_date_picker',
				'heading' => esc_html__( 'Event End Date', 'lbg-eventzillabakery' ),
				'param_name' => 'xenddate', //xenddate
				'value' => esc_html__( "".date('n')."/".date('j')."/".date('Y'), "lbg-eventzillabakery" ),
				'description' => esc_html__( "MONTH/DAY/YEAR - Select the date when the event will end", "lbg-eventzillabakery" )
			),
			array(
				'type' => 'eventzilla_slider',
				'heading' => esc_html__( 'Event End Date - Hours', 'lbg-eventzillabakery' ),
				'param_name' => 'xenddate_hours', //beginDate_hours
				'value' => esc_html__( "0", "lbg-eventzillabakery" ),
				'description' => esc_html__( "values between 0-23", "lbg-eventzillabakery" )
			),
			array(
				'type' => 'eventzilla_slider',
				'heading' => esc_html__( 'Event End Date - Minutes', 'lbg-eventzillabakery' ),
				'param_name' => 'xenddate_minutes', //beginDate_hours
				'value' => esc_html__( "0", "lbg-eventzillabakery" ),
				'description' => esc_html__( "values between 0-59", "lbg-eventzillabakery" )
			),
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Event Address', 'lbg-eventzillabakery' ),
				'param_name' => 'xaddress'
			),
			array(
				'type' => 'attach_image',
				'heading' => esc_html__( 'Event Main Image', 'lbg-eventzillabakery' ),
				'param_name' => 'xmainimage',
				'description' => esc_html__( 'Select an image from Media Library', 'lbg-eventzillabakery' )

			),
			array(
				'type' => 'textarea',
				'heading' => esc_html__( 'Event Details', 'lbg-eventzillabakery' ),
				'param_name' => 'xdetails'
			),
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Book Now Link', 'lbg-eventzillabakery' ),
				'param_name' => 'xbooknowlink'
			),
			array(
				'type' => 'attach_image',
				'heading' => esc_html__( 'Event Organizer Logo', 'lbg-eventzillabakery' ),
				'param_name' => 'xorganizer_logo',
				'description' => esc_html__( 'Select an image from Media Library', 'lbg-eventzillabakery' )
			),
			array(
				'type' => 'textarea',
				'heading' => esc_html__( 'Event Organizer Info', 'lbg-eventzillabakery' ),
				'param_name' => 'xorganizer_info'
			),
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'The url to the event page', 'lbg-eventzillabakery' ),
				'param_name' => 'xmoreinfolink',
				'description' => esc_html__( 'Used for sharing', 'lbg-eventzillabakery' )
			),
			array(
				'type' => 'textfield',
				'heading' => esc_html__( 'Dress Code', 'lbg-eventzillabakery' ),
				'param_name' => 'xdresscode'
			),
			array(
				'type' => 'checkbox',
				'heading' => __( 'Event Cancelled', 'lbg-eventzillabakery' ),
				'param_name' => 'xcancelled'
			),
		),
		'js_view' => 'VcPlaylistItemView'
	) );





	if ( class_exists( "WPBakeryShortCode" ) ) {
		$eventzilla_addon_path = trailingslashit(dirname(__FILE__));
		include_once($eventzilla_addon_path . 'vc_contentadmin/eventzilla-accordion.php');
		include_once($eventzilla_addon_path . 'vc_contentadmin/eventzilla-accordion-tab.php');


	} // End Class

}

add_action('vc_before_init', 'eventzilla_addon_vc_map_init');



function eventzilla_addon_enqueue_scripts_and_styles() {
		if (!is_admin()) { //loads js & css in front-end
		wp_enqueue_style('dcalendar-css', plugins_url('evento/css/dcalendar.picker.css', __FILE__));
		wp_enqueue_style('lbg-evento-site-css', plugins_url('evento/css/lbg_evento.css', __FILE__));

		wp_enqueue_script('jquery');

		wp_enqueue_script('jquery-ui-core');
		wp_enqueue_script('jquery-ui-slider');
		wp_enqueue_script('jquery-effects-core');

		wp_register_script('lbg-evento-26e31fe740', plugins_url('evento/js/26e31fe740.js', __FILE__),array('jquery'),false,false);
		wp_enqueue_script('lbg-evento-26e31fe740');

		wp_register_script('lbg-evento', plugins_url('evento/js/lbg_evento.js', __FILE__),array('jquery'),false,false);
		wp_enqueue_script('lbg-evento');

		wp_register_script('dcalendar', plugins_url('evento/js/dcalendar.picker.js', __FILE__),array('jquery'),false,false);
		wp_enqueue_script('dcalendar');
	}
}
add_action( 'init', 'eventzilla_addon_enqueue_scripts_and_styles' );


function eventzilla_addon_enqueue_admin_scripts_and_styles() {
	//load scripts in admin
	wp_enqueue_style('lbg-vc-jquery-ui-custom_css', plugins_url('assets/jquery-ui.css', __FILE__));

	wp_enqueue_script('jquery-ui-slider');
	wp_enqueue_script('jquery-ui-datepicker');
}
add_action( 'admin_enqueue_scripts', 'eventzilla_addon_enqueue_admin_scripts_and_styles' );



if (!function_exists('eventzilla_addon_unstrip_array')) {
	//stripslashes for an entire array
	function eventzilla_addon_unstrip_array($array){
		if (is_array($array)) {
			foreach($array as &$val){
				if(is_array($val)){
					$val = unstrip_array($val);
				} else {
					$val = stripslashes($val);

				}
			}
		}
		return $array;
	}
}




//the shortcodes
add_shortcode( 'eventzilla_playlist_item', 'eventzilla_playlist_item_func' );
function eventzilla_playlist_item_func( $atts, $content = null ) { // New function parameter $content is added!
	global $wpdb;



	$the_xmainimage = array('');
	if ( array_key_exists('xmainimage', $atts) && $atts["xmainimage"]!='' ) {
			$the_xmainimage=wp_get_attachment_image_src($atts["xmainimage"], "large");
	}

	$the_xorganizer_logo = array('');
	if ( array_key_exists('xorganizer_logo', $atts) && $atts["xorganizer_logo"]!='' ) {
			$the_xorganizer_logo=wp_get_attachment_image_src($atts["xorganizer_logo"], "large");
	}


	$aux_content='<ul>
	<li class="xtitle">'.(( array_key_exists("title", $atts) && $atts["title"]!='' )?esc_attr($atts["title"]):"").'</li>
  <li class="xstartdate">'.(( array_key_exists("xstartdate", $atts) && $atts["xstartdate"]!='' )?esc_attr($atts["xstartdate"]):date("m/d/Y"));
	$aux_content.='-'.(( array_key_exists("xstartdate_hours", $atts) && $atts["xstartdate_hours"]!='' )?esc_attr($atts["xstartdate_hours"]):0).':'.(( array_key_exists("xstartdate_minutes", $atts) && $atts["xstartdate_minutes"]!='' )?esc_attr($atts["xstartdate_minutes"]):0).'</li>';
	$aux_content.='<li class="xenddate">'.(( array_key_exists("xenddate", $atts) && $atts["xenddate"]!='' )?esc_attr($atts["xenddate"]):date("m/d/Y"));
	$aux_content.='-'.(( array_key_exists("xenddate_hours", $atts) && $atts["xenddate_hours"]!='' )?esc_attr($atts["xenddate_hours"]):0).':'.(( array_key_exists("xenddate_minutes", $atts) && $atts["xenddate_minutes"]!='' )?esc_attr($atts["xenddate_minutes"]):0).'</li>';
	$aux_content.='<li class="xaddress">'.(( array_key_exists("xaddress", $atts) && $atts["xaddress"]!='' )?esc_attr($atts["xaddress"]):"").'</li>
	<li class="xmainimage">'.esc_attr($the_xmainimage[0]).'</li>
  <li class="xdetails">'.(( array_key_exists("xdetails", $atts) && $atts["xdetails"]!='' )?esc_attr($atts["xdetails"]):"").'</li>
	<li class="xbooknowlink">'.(( array_key_exists("xbooknowlink", $atts) && $atts["xbooknowlink"]!='' )?esc_attr($atts["xbooknowlink"]):"").'</li>
	<li class="xorganizer_logo">'.esc_attr($the_xorganizer_logo[0]).'</li>
	<li class="xorganizer_info">'.(( array_key_exists("xorganizer_info", $atts) && $atts["xorganizer_info"]!='' )?esc_attr($atts["xorganizer_info"]):"").'</li>
	<li class="xmoreinfolink">'.(( array_key_exists("xmoreinfolink", $atts) && $atts["xmoreinfolink"]!='' )?esc_attr($atts["xmoreinfolink"]):"").'</li>
	<li class="xdresscode">'.(( array_key_exists("xdresscode", $atts) && $atts["xdresscode"]!='' )?esc_attr($atts["xdresscode"]):"").'</li>
	<li class="xcancelled">'.(( array_key_exists("xcancelled", $atts) && $atts["xcancelled"]!='' )?"1":"0").'</li>
                   </ul>';
	return str_replace("\r\n", '', $aux_content);
}


add_shortcode( 'eventzilla', 'eventzilla_func' );
	function eventzilla_func( $atts, $content = null ) { // New function parameter $content is added!
		global $eventzilla_addon_rand_id;
		$initial_vals_arr=array(
			'id' => $eventzilla_addon_rand_id,
			'width' => 720,
			'months_area_color' => '#ffffff',
			'centerplugin' => 'true',
			'eventslistverticalpadding' => 20,
			'eventslisthorizontalpadding' => 10,
		  'eventtitleleftmargin' => 15,
			'eventfirstdatefontsize' => 92,
			'eventseconddatefontsize' => 20,
			'eventseconddatemonthfontsize' => 13,
			'showmonthfirstfordate' => 'true',
			'showenddate' => 'true',
			'eventtitlefontsize' => 27,
			'eventinitialdetailsfontsize' => 14,
			'eventbottombordercolor' => '#cccccc',
			'eventbackgroundcolor_odd' => '#ffffff',
			'eventbackgroundcolor_even' => '#ebebeb',
			'eventbgdaycolor_odd' => '#da0000',
			'eventbgdaycolor_even' => '#000000',
			'eventdatecolor_odd' => '#444444',
			'eventdatecolor_even' => '#444444',
			'eventtitlecolor_odd' => '#444444',
			'eventtitlecolor_even' => '#444444',
			'eventinitialdetailscolor_odd' => '#444444',
			'eventinitialdetailscolor_even' => '#444444',
			'dresscode' => 'Dress code',
			'dresscodefontsize' => 13,
			'dresscodecolor_odd' => '#808080',
			'dresscodecolor_even' => '#808080',
			'socialiconscolor_odd' => '#000000',
			'socialiconscolor_even' => '#ffffff',
			'shortmonth_jan' => 'Jan',
			'shortmonth_feb' => 'Feb',
			'shortmonth_mar' => 'Mar',
			'shortmonth_apr' => 'Apr',
			'shortmonth_may' => 'May',
			'shortmonth_jun' => 'Jun',
			'shortmonth_jul' => 'Jul',
			'shortmonth_aug' => 'Aug',
			'shortmonth_sep' => 'Sep',
			'shortmonth_oct' => 'Oct',
			'shortmonth_nov' => 'Nov',
			'shortmonth_dec' => 'Dec',
			'longdays_sunday' => 'Sunday',
			'longdays_monday' => 'Monday',
			'longdays_tuesday' => 'Tuesday',
			'longdays_wednesday' => 'Wednesday',
			'longdays_thursday' => 'Thursday',
			'longdays_friday' => 'Friday',
			'longdays_saturday' => 'Saturday',
			'sunday_color' => '#fff000',
			'monday_color' => '#00ffe0',
			'tuesday_color' => '#ff780a',
			'wednesday_color' => '#c96bb6',
			'thursday_color' => '#00ff36',
			'friday_color' => '#ff00a8',
			'saturday_color' => '#008aff',
			'eventdayscolor' => '#ffffff',
			'use24hoursformat' => 'false',
			'noeventsavailabletext' => 'No event available for this month',
			'eventcancelledtext' => 'Cancelled',
			'fullcalendaronleft' => 'true',
			'leftsidecalendardayscolor' => '#707275',
			'leftsidecalendarpastmonthdayscolor' => '#aaaaaa',
			'leftsidecalendarnextmonthdayscolor' => '#aaaaaa',
			'leftsidecalendarcurrentdaycolor' => '#00ffe0',
			'leftsidecalendareventdayscolor' => '#0000cc',
			'leftsidecalendareventdaysbgcolor' => '#00ffe0',
			'leftsidecalendardaysnamecolor' => '#000000',
			'yearcolor' => '#a3a3a3',
			'monthcolor' => '#444444',
			'monthyearlineseparatorcolor' => '#da0000',
			'monthsnextprevarrowscolor' => '#d1d1d1',
			'detailstitle' => 'Details',
			'whenwheretitle' => 'When & Where',
			'organizertitle' => 'Organizer',
			'moredetailstext' => 'more details here',
			'moredetailstarget' => '_blank',
			'showfacebookbut' => 'true',
			'showtwitterbut' => 'true',
			'showpinterestbut' => 'true',
			'searchinputtext' => 'search...',
			'booknowtext' => 'Book Now',
			'booknowlinktarget' => '_self',
			'endedtext' => 'Ended'
		);

	   extract( shortcode_atts( $initial_vals_arr, $atts ) );
	   foreach ($initial_vals_arr as $key => $value) {
			if (!isset($atts[$key])) {
				$atts[$key]=$value;
			}
		}

		$currentY=date("Y");
		$currentM=date("n");
		$currentD=date("j");
		$currentH=date("H");
		$currentMin=date("i");
		$currentS=date("s");

	$playlist_str='';
	$playlist_str=do_shortcode( $content );


	$aux_content='';

	$aux_content.='<script>
		jQuery(function() {
			setTimeout(function(){
			jQuery("#lbg_evento_'.esc_js($atts["id"]).'").lbg_evento({
				nowDate:"'.esc_js($currentY).'/'.esc_js($currentM).'/'.esc_js($currentD).'-'.esc_js($currentH).':'.esc_js($currentMin).'",
				width:'.esc_js($atts["width"]).',
				months_area_color:"'.esc_js($atts["months_area_color"]).'",
				centerPlugin:'.esc_js($atts["centerplugin"]).',
				eventsListVerticalPadding:'.esc_js($atts["eventslistverticalpadding"]).',
				eventsListHorizontalPadding:'.esc_js($atts["eventslisthorizontalpadding"]).',
				eventTitleLeftMargin:'.esc_js($atts["eventtitleleftmargin"]).',
				eventFirstDateFontSize:'.esc_js($atts["eventfirstdatefontsize"]).',
				eventSecondDateFontSize:'.esc_js($atts["eventseconddatefontsize"]).',
				eventSecondDateMonthFontSize:'.esc_js($atts["eventseconddatemonthfontsize"]).',
				showMonthFirstForDate:'.esc_js($atts["showmonthfirstfordate"]).',
				showEndDate:'.esc_js($atts["showenddate"]).',
				eventTitleFontSize:'.esc_js($atts["eventtitlefontsize"]).',
				eventInitialDetailsFontSize:'.esc_js($atts["eventinitialdetailsfontsize"]).',
				eventBottomBorderColor:"'.esc_js($atts["eventbottombordercolor"]).'",
				eventBackgroundColor_odd:"'.esc_js($atts["eventbackgroundcolor_odd"]).'",
				eventBackgroundColor_even:"'.esc_js($atts["eventbackgroundcolor_even"]).'",
				eventBgDayColor_odd:"'.esc_js($atts["eventbgdaycolor_odd"]).'",
				eventBgDayColor_even:"'.esc_js($atts["eventbgdaycolor_even"]).'",
				eventDateColor_odd:"'.esc_js($atts["eventdatecolor_odd"]).'",
				eventDateColor_even:"'.esc_js($atts["eventdatecolor_even"]).'",
				eventTitleColor_odd:"'.esc_js($atts["eventtitlecolor_odd"]).'",
				eventTitleColor_even:"'.esc_js($atts["eventtitlecolor_even"]).'",
				eventInitialDetailsColor_odd:"'.esc_js($atts["eventinitialdetailscolor_odd"]).'",
				eventInitialDetailsColor_even:"'.esc_js($atts["eventinitialdetailscolor_even"]).'",
				dressCode:"'.esc_js($atts["dresscode"]).'",
				dressCodeFontSize:'.esc_js($atts["dresscodefontsize"]).',
				dressCodeColor_odd:"'.esc_js($atts["dresscodecolor_odd"]).'",
				dressCodeColor_even:"'.esc_js($atts["dresscodecolor_even"]).'",
				socialIconsColor_odd:"'.esc_js($atts["socialiconscolor_odd"]).'",
				socialIconsColor_even:"'.esc_js($atts["socialiconscolor_even"]).'",
				shortmonth_arr:["'.esc_js($atts["shortmonth_jan"]).'", "'.esc_js($atts["shortmonth_feb"]).'", "'.esc_js($atts["shortmonth_mar"]).'", "'.esc_js($atts["shortmonth_apr"]).'", "'.esc_js($atts["shortmonth_may"]).'", "'.esc_js($atts["shortmonth_jun"]).'", "'.esc_js($atts["shortmonth_jul"]).'", "'.esc_js($atts["shortmonth_aug"]).'", "'.esc_js($atts["shortmonth_sep"]).'", "'.esc_js($atts["shortmonth_oct"]).'", "'.esc_js($atts["shortmonth_nov"]).'", "'.esc_js($atts["shortmonth_dec"]).'"],
				longdays_arr:["'.esc_js($atts["longdays_sunday"]).'", "'.esc_js($atts["longdays_monday"]).'", "'.esc_js($atts["longdays_tuesday"]).'", "'.esc_js($atts["longdays_wednesday"]).'", "'.esc_js($atts["longdays_thursday"]).'", "'.esc_js($atts["longdays_friday"]).'", "'.esc_js($atts["longdays_saturday"]).'"],
				eventDaysBgColors_arr:["'.esc_js($atts["sunday_color"]).'", "'.esc_js($atts["monday_color"]).'", "'.esc_js($atts["tuesday_color"]).'", "'.esc_js($atts["wednesday_color"]).'", "'.esc_js($atts["thursday_color"]).'", "'.esc_js($atts["friday_color"]).'", "'.esc_js($atts["saturday_color"]).'"],
				eventDaysColor:"'.esc_js($atts["eventdayscolor"]).'",
				use24HoursFormat:'.esc_js($atts["use24hoursformat"]).',
				noEventsAvailableText:"'.esc_js($atts["noeventsavailabletext"]).'",
				eventCancelledText:"'.esc_js($atts["eventcancelledtext"]).'",
				fullCalendarOnLeft:'.esc_js($atts["fullcalendaronleft"]).',
				leftSideCalendarDaysColor:"'.esc_js($atts["leftsidecalendardayscolor"]).'",
				leftSideCalendarPastMonthDaysColor:"'.esc_js($atts["leftsidecalendarpastmonthdayscolor"]).'",
				leftSideCalendarNextMonthDaysColor:"'.esc_js($atts["leftsidecalendarnextmonthdayscolor"]).'",
				leftSideCalendarCurrentDayColor:"'.esc_js($atts["leftsidecalendarcurrentdaycolor"]).'",
				leftSideCalendarEventDaysColor:"'.esc_js($atts["leftsidecalendareventdayscolor"]).'",
				leftSideCalendarEventDaysBgColor:"'.esc_js($atts["leftsidecalendareventdaysbgcolor"]).'",
				leftSideCalendarDaysNameColor:"'.esc_js($atts["leftsidecalendardaysnamecolor"]).'",
				yearColor:"'.esc_js($atts["yearcolor"]).'",
				monthColor:"'.esc_js($atts["monthcolor"]).'",
				monthYearLineSeparatorColor:"'.esc_js($atts["monthyearlineseparatorcolor"]).'",
				monthsNextPrevArrowsColor:"'.esc_js($atts["monthsnextprevarrowscolor"]).'",
				detailsTitle:"'.esc_js($atts["detailstitle"]).'",
				whenWhereTitle:"'.esc_js($atts["whenwheretitle"]).'",
				organizerTitle:"'.esc_js($atts["organizertitle"]).'",
				moreDetailsText:"'.esc_js($atts["moredetailstext"]).'",
				moreDetailsTarget:"'.esc_js($atts["moredetailstarget"]).'",
				showFacebookBut:'.esc_js($atts["showfacebookbut"]).',
				showTwitterBut:'.esc_js($atts["showtwitterbut"]).',
				showPinterestBut:'.esc_js($atts["showpinterestbut"]).',
				searchInputText:"'.esc_js($atts["searchinputtext"]).'",
				bookNowText:"'.esc_js($atts["booknowtext"]).'",
				bookNowLinkTarget:"'.esc_js($atts["booknowlinktarget"]).'",
				endedText:"'.esc_js($atts["endedtext"]).'"
			});
}, 100);
		});
	</script>
    <div id="lbg_evento_'.esc_attr($atts["id"]).'">
                <div class="lbg_xeventslist">'.$playlist_str.' </div>
    </div>
		<br style="clear:both;">';

	return str_replace("\r\n", '', $aux_content);

	}

?>
