<?php

// COLOR SCHEME
if ( is_file( dirname(__FILE__) . '/../../../../plugins/bold-page-builder/content_elements_misc/misc.php' ) ) {
	require_once( dirname(__FILE__) . '/../../../../plugins/bold-page-builder/content_elements_misc/misc.php' );
}
if ( function_exists('bt_bb_get_color_scheme_param_array') ) {
	$color_scheme_arr = bt_bb_get_color_scheme_param_array();
} else {
	$color_scheme_arr = array();
}

// BUTTONS - icon_color_scheme, style

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_button', 'style' );
}
if ( function_exists( 'bt_bb_add_params' ) ) {
	$color_scheme_arr = bt_bb_get_color_scheme_param_array();
		
	bt_bb_add_params( 'bt_bb_button', array(
		array( 'param_name' => 'style', 'type' => 'dropdown', 'heading' => esc_html__( 'Style', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Outline', 'konstrakt' ) => 'outline',
				esc_html__( 'Filled', 'konstrakt' ) => 'filled',
				esc_html__( 'Clean', 'konstrakt' ) => 'clean',
				esc_html__( 'Underlined', 'konstrakt' ) => 'underlined',
				esc_html__( 'With Huge Icon', 'konstrakt' ) => 'with_huge_icon'
			)
		),
		array( 'param_name' => 'icon_color_scheme', 'type' => 'dropdown', 'heading' => esc_html__( 'Icon Color Scheme', 'konstrakt' ), 'value' => $color_scheme_arr, 'preview' => true, 'group' => esc_html__( 'Design', 'konstrakt' ) ),
	));
}

function konstrakt_bt_bb_button_class( $class, $atts ) {
	if ( isset( $atts['icon_color_scheme'] ) && $atts['icon_color_scheme'] != '' ) {
		$class[] = 'bt_bb_icon_color_scheme_' . bt_bb_get_color_scheme_id( $atts['icon_color_scheme'] );
	}
	return $class;
}


function konstrakt_bt_bb_button_style( $style, $atts ) {
	if ( isset( $atts['icon_color_scheme'] ) && $atts['icon_color_scheme'] != '' ) {
	
		$icon_color_scheme_id = NULL;
		if ( is_numeric ( $atts['icon_color_scheme'] ) ) {
			$icon_color_scheme_id = $atts['icon_color_scheme'];
		} else if ( $atts['icon_color_scheme'] != '' ) {
			$icon_color_scheme_id = bt_bb_get_color_scheme_id( $atts['icon_color_scheme'] );
		}
		$icon_color_scheme_colors = bt_bb_get_color_scheme_colors_by_id( $icon_color_scheme_id - 1 );
		if ( $icon_color_scheme_colors ) $style .= '; --icon-primary-color:' . $icon_color_scheme_colors[0] . '; --icon-secondary-color:' . $icon_color_scheme_colors[1] . ';';
	}
	return $style;
}


add_filter( 'bt_bb_button_class', 'konstrakt_bt_bb_button_class', 10, 2 );
add_filter( 'bt_bb_button_style', 'konstrakt_bt_bb_button_style', 10, 2 );


// COLUMN

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_column', 'padding' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_column', array(
		array( 'param_name' => 'padding', 'type' => 'dropdown', 'heading' => esc_html__( 'Padding', 'konstrakt' ), 'preview' => true,
			'responsive_override' => true, 
			'value' => array(
				esc_html__( 'Normal', 'konstrakt' ) 		=> 'normal',
				esc_html__( 'Double', 'konstrakt' ) 		=> 'double',
				esc_html__( 'Text Indent', 'konstrakt' ) 	=> 'text_indent',
				esc_html__( '0px', 'konstrakt' ) 			=> '0',
				esc_html__( '5px', 'konstrakt' ) 			=> '5',
				esc_html__( '10px', 'konstrakt' ) 		=> '10',
				esc_html__( '15px', 'konstrakt' ) 		=> '15',
				esc_html__( '20px', 'konstrakt' ) 		=> '20',
				esc_html__( '25px', 'konstrakt' ) 		=> '25',
				esc_html__( '30px', 'konstrakt' ) 		=> '30',
				esc_html__( '35px', 'konstrakt' ) 		=> '35',
				esc_html__( '40px', 'konstrakt' ) 		=> '40',
				esc_html__( '45px', 'konstrakt' ) 		=> '45',
				esc_html__( '50px', 'konstrakt' ) 		=> '50',
				esc_html__( '60px', 'konstrakt' ) 		=> '60',
				esc_html__( '70px', 'konstrakt' ) 		=> '70',
				esc_html__( '80px', 'konstrakt' ) 		=> '80',
				esc_html__( '90px', 'konstrakt' ) 		=> '90',
				esc_html__( '100px', 'konstrakt' ) 		=> '100',
				esc_html__( '110px', 'konstrakt' ) 		=> '110',
				esc_html__( '120px', 'konstrakt' ) 		=> '120',
				esc_html__( '130px', 'konstrakt' ) 		=> '130',
				esc_html__( '140px', 'konstrakt' ) 		=> '140',
				esc_html__( '150px', 'konstrakt' ) 		=> '150'
			)
		),
		array( 'param_name' => 'top_border', 'type' => 'checkbox', 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'top_border' ), 'group' => esc_html__( 'Design', 'konstrakt' ), 'heading' => esc_html__( 'Top Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'bottom_border', 'type' => 'checkbox', 'group' => esc_html__( 'Design', 'konstrakt' ), 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'bottom_border' ), 'heading' => esc_html__( 'Bottom Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'left_border', 'type' => 'checkbox', 'group' => esc_html__( 'Design', 'konstrakt' ), 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'left_border' ), 'heading' => esc_html__( 'Left Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'right_border', 'type' => 'checkbox', 'group' => esc_html__( 'Design', 'konstrakt' ), 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'right_border' ), 'heading' => esc_html__( 'Right Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'border_color', 'type' => 'dropdown', 'heading' => esc_html__( 'Border color', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Black transparent', 'konstrakt' ) 		=> '',
				esc_html__( 'White transparent', 'konstrakt' ) 		=> 'white_transparent',
				esc_html__( 'Black', 'konstrakt' ) 					=> 'black',
				esc_html__( 'White', 'konstrakt' ) 					=> 'white',
				esc_html__( 'Accent', 'konstrakt' ) 					=> 'accent',
				esc_html__( 'Alternate', 'konstrakt' ) 				=> 'alternate'
			)
		),
		array( 'param_name' => 'border_width', 'type' => 'textfield', 'heading' => esc_html__( 'Border width', 'konstrakt' ), 'description' => esc_html__( 'Enter value in numbers, it will be calculater as pixels, e.g. 5 will mean 5px. Maximum value is 20.', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ) ),
	));
}

function konstrakt_bt_bb_column_class( $class, $atts ) {
	if ( isset( $atts['top_border'] ) && $atts['top_border'] != '' ) {
		$class[] = "bt_bb_top_border";
	}
	if ( isset( $atts['bottom_border'] ) && $atts['bottom_border'] != '' ) {
		$class[] = "bt_bb_bottom_border";
	}
	if ( isset( $atts['left_border'] ) && $atts['left_border'] != '' ) {
		$class[] = "bt_bb_left_border";
	}
	if ( isset( $atts['right_border'] ) && $atts['right_border'] != '' ) {
		$class[] = "bt_bb_right_border";
	}
	if ( isset( $atts['border_color'] ) && $atts['border_color'] != '' ) {
		$class[] = 'bt_bb_border_color' . '_' . $atts['border_color'];
	}
	if ( isset( $atts['border_width'] ) && $atts['border_width'] != '' ) {
		$class[] = 'bt_bb_border_width' . '_' . $atts['border_width'];
	}
	return $class;
}
add_filter( 'bt_bb_column_class', 'konstrakt_bt_bb_column_class', 10, 2 );

// COLUMN INNER

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_column_inner', 'padding' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_column_inner', array(
		array( 'param_name' => 'padding', 'type' => 'dropdown', 'heading' => esc_html__( 'Padding', 'konstrakt' ), 'preview' => true,
			'responsive_override' => true,
			'value' => array(
				esc_html__( 'Normal', 'konstrakt' ) 		=> 'normal',
				esc_html__( 'Double', 'konstrakt' ) 		=> 'double',
				esc_html__( 'Text Indent', 'konstrakt' ) 	=> 'text_indent',
				esc_html__( '0px', 'konstrakt' ) 			=> '0',
				esc_html__( '5px', 'konstrakt' ) 			=> '5',
				esc_html__( '10px', 'konstrakt' ) 		=> '10',
				esc_html__( '15px', 'konstrakt' ) 		=> '15',
				esc_html__( '20px', 'konstrakt' ) 		=> '20',
				esc_html__( '25px', 'konstrakt' ) 		=> '25',
				esc_html__( '30px', 'konstrakt' ) 		=> '30',
				esc_html__( '35px', 'konstrakt' ) 		=> '35',
				esc_html__( '40px', 'konstrakt' ) 		=> '40',
				esc_html__( '45px', 'konstrakt' ) 		=> '45',
				esc_html__( '50px', 'konstrakt' ) 		=> '50',
				esc_html__( '60px', 'konstrakt' ) 		=> '60',
				esc_html__( '70px', 'konstrakt' ) 		=> '70',
				esc_html__( '80px', 'konstrakt' ) 		=> '80',
				esc_html__( '90px', 'konstrakt' ) 		=> '90',
				esc_html__( '100px', 'konstrakt' ) 		=> '100',
				esc_html__( '110px', 'konstrakt' ) 		=> '110',
				esc_html__( '120px', 'konstrakt' ) 		=> '120',
				esc_html__( '130px', 'konstrakt' ) 		=> '130',
				esc_html__( '140px', 'konstrakt' ) 		=> '140',
				esc_html__( '150px', 'konstrakt' ) 		=> '150'
			)
		),
		array( 'param_name' => 'top_border', 'type' => 'checkbox', 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'top_border' ), 'group' => esc_html__( 'Design', 'konstrakt' ), 'heading' => esc_html__( 'Top Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'bottom_border', 'type' => 'checkbox', 'group' => esc_html__( 'Design', 'konstrakt' ), 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'bottom_border' ), 'heading' => esc_html__( 'Bottom Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'left_border', 'type' => 'checkbox', 'group' => esc_html__( 'Design', 'konstrakt' ), 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'left_border' ), 'heading' => esc_html__( 'Left Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'right_border', 'type' => 'checkbox', 'group' => esc_html__( 'Design', 'konstrakt' ), 'value' => array( esc_html__( 'Yes', 'konstrakt' ) => 'right_border' ), 'heading' => esc_html__( 'Right Border', 'konstrakt' ), 'preview' => true ),
		array( 'param_name' => 'border_color', 'type' => 'dropdown', 'heading' => esc_html__( 'Border color', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Light', 'konstrakt' ) 		=> '',
				esc_html__( 'Dark', 'konstrakt' ) 		=> 'dark',
				esc_html__( 'Accent', 'konstrakt' ) 		=> 'accent'
			)
		),
		array( 'param_name' => 'border_width', 'type' => 'textfield', 'heading' => esc_html__( 'Border width', 'konstrakt' ), 'description' => esc_html__( 'E.g. 5px or 1em', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ) ),
	));
}

function konstrakt_bt_bb_column_inner_class( $class, $atts ) {
	if ( isset( $atts['top_border'] ) && $atts['top_border'] != '' ) {
		$class[] = "bt_bb_top_border";
	}
	if ( isset( $atts['bottom_border'] ) && $atts['bottom_border'] != '' ) {
		$class[] = "bt_bb_bottom_border";
	}
	if ( isset( $atts['left_border'] ) && $atts['left_border'] != '' ) {
		$class[] = "bt_bb_left_border";
	}
	if ( isset( $atts['right_border'] ) && $atts['right_border'] != '' ) {
		$class[] = "bt_bb_right_border";
	}
	if ( isset( $atts['border_color'] ) && $atts['border_color'] != '' ) {
		$class[] = 'bt_bb_border_color' . '_' . $atts['border_color'];
	}
	if ( isset( $atts['border_width'] ) && $atts['border_width'] != '' ) {
		$class[] = 'bt_bb_border_width' . '_' . $atts['border_width'];
	}
	return $class;
}
add_filter( 'bt_bb_column_inner_class', 'konstrakt_bt_bb_column_inner_class', 10, 2 );


// SERVICE - FONT WIGHT,SHAPE, HEADLINES FONT SIZE 

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_service', 'shape' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_service', array(		
		array( 'param_name' => 'shape', 'type' => 'dropdown', 'heading' => esc_html__( 'Shape', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Circle', 'konstrakt' ) => 'circle',
				esc_html__( 'Square', 'konstrakt' ) => 'square',
				esc_html__( 'Rounded Square', 'konstrakt' ) => 'round',
				esc_html__( 'Hexagon', 'konstrakt' ) => 'hexagon',
				esc_html__( 'Hexagon Rounded', 'konstrakt' ) => 'hexagon-rounded'
			)
		),
		array( 'param_name' => 'font_weight', 'type' => 'dropdown', 'heading' => esc_html__( 'Font weight', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Default', 'konstrakt' ) => '',
				esc_html__( 'Normal', 'konstrakt' ) => 'normal',
				esc_html__( 'Bold', 'konstrakt' ) => 'bold',
				esc_html__( 'Bolder', 'konstrakt' ) => 'bolder',
				esc_html__( 'Lighter', 'konstrakt' ) => 'lighter',
				esc_html__( 'Light', 'konstrakt' ) => 'light',
				esc_html__( 'Thin', 'konstrakt' ) => 'thin',
				esc_html__( 'Font weight 100', 'konstrakt' ) => '100',
				esc_html__( 'Font weight 200', 'konstrakt' ) => '200',
				esc_html__( 'Font weight 300', 'konstrakt' ) => '300',
				esc_html__( 'Font weight 400', 'konstrakt' ) => '400',
				esc_html__( 'Font weight 500', 'konstrakt' ) => '500',
				esc_html__( 'Font weight 600', 'konstrakt' ) => '600',
				esc_html__( 'Font weight 700', 'konstrakt' ) => '700',
				esc_html__( 'Font weight 800', 'konstrakt' ) => '800',
				esc_html__( 'Font weight 900', 'konstrakt' ) => '900',
			)
		),
		array( 'param_name' => 'size_headline', 'type' => 'dropdown', 'heading' => esc_html__( 'Headline Size', 'konstrakt' ), 'description' => 'Predefined heading sizes','group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Inherit', 'konstrakt' ) => 'inherit',
				esc_html__( 'Extra Small', 'konstrakt' ) => 'extrasmall',
				esc_html__( 'Small', 'konstrakt' ) => 'small',
				esc_html__( 'Medium', 'konstrakt' ) => 'medium',
				esc_html__( 'Normal', 'konstrakt' ) => 'normal',
				esc_html__( 'Large', 'konstrakt' ) => 'large',
				esc_html__( 'Extra large', 'konstrakt' ) => 'extralarge',
				esc_html__( 'Huge', 'konstrakt' ) => 'huge'
			)
		),
	));
}

function konstrakt_bt_bb_service_class( $class, $atts ) {
	if ( isset( $atts['font_weight'] ) && $atts['font_weight'] != '' ) {
		$class[] = 'bt_bb_font_weight_' . $atts['font_weight'];
	}
	if ( isset( $atts['size_headline'] ) && $atts['size_headline'] != '' ) {
		$class[] = 'bt_bb_size_headline_' . $atts['size_headline'] ;
	}
	return $class;
}
add_filter( 'bt_bb_service_class', 'konstrakt_bt_bb_service_class', 10, 2 );

// ICON - edited: shape
if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_icon', 'shape' );
}
if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_icon', array(
		array( 'param_name' => 'vertical_position', 'type' => 'dropdown', 'heading' => esc_html__( 'Vertical position', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Default', 'konstrakt' ) => '',
				esc_html__( 'Half above', 'konstrakt' ) => 'half_above',
				esc_html__( 'Full above', 'konstrakt' ) => 'full_above'
			)
		),
		array( 'param_name' => 'shape', 'type' => 'dropdown', 'heading' => esc_html__( 'Shape', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Circle', 'konstrakt' ) => 'circle',
				esc_html__( 'Square', 'konstrakt' ) => 'square',
				esc_html__( 'Rounded Square', 'konstrakt' ) => 'round',
				esc_html__( 'Hexagon', 'konstrakt' ) => 'hexagon',
				esc_html__( 'Hexagon Rounded', 'konstrakt' ) => 'hexagon-rounded'
			)
		),
	));
}

function konstrakt_bt_bb_icon_class( $class, $atts ) {
	if ( isset( $atts['vertical_position'] ) && $atts['vertical_position'] != '' ) {
		$class[] = 'bt_bb_vertical_position' . '_' . $atts['vertical_position'];
	}
	return $class;
}
add_filter( 'bt_bb_icon_class', 'konstrakt_bt_bb_icon_class', 10, 2 );

// HEADLINE 

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_headline', 'font_weight' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_headline', array(		
		array( 'param_name' => 'font_weight', 'type' => 'dropdown', 'heading' => esc_html__( 'Font weight', 'konstrakt' ), 'group' => esc_html__( 'Font', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Default', 'konstrakt' ) => '',
				esc_html__( 'Normal', 'konstrakt' ) => 'normal',
				esc_html__( 'Bold', 'konstrakt' ) => 'bold',
				esc_html__( 'Bolder', 'konstrakt' ) => 'bolder',
				esc_html__( 'Lighter', 'konstrakt' ) => 'lighter',
				esc_html__( 'Light', 'konstrakt' ) => 'light',
				esc_html__( 'Thin', 'konstrakt' ) => 'thin',
				esc_html__( 'Font weight 100', 'konstrakt' ) => '100',
				esc_html__( 'Font weight 200', 'konstrakt' ) => '200',
				esc_html__( 'Font weight 300', 'konstrakt' ) => '300',
				esc_html__( 'Font weight 400', 'konstrakt' ) => '400',
				esc_html__( 'Font weight 500', 'konstrakt' ) => '500',
				esc_html__( 'Font weight 600', 'konstrakt' ) => '600',
				esc_html__( 'Font weight 700', 'konstrakt' ) => '700',
				esc_html__( 'Font weight 800', 'konstrakt' ) => '800',
				esc_html__( 'Font weight 900', 'konstrakt' ) => '900',
			)
		),
	));
}

// CONTENT SLIDER - new: overflow, active_dot_color, inactive_dot_color, slider_arrows_default_state_style

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_content_slider', array(	
		array( 'param_name' => 'overflow', 'type' => 'dropdown', 'heading' => esc_html__( 'Overflow elements', 'konstrakt' ), 
			'value' => array(
				esc_html__( 'No', 'konstrakt' ) => 'no',
				esc_html__( 'Yes', 'konstrakt' ) => 'yes'
			)
		),
		array( 'param_name' => 'active_dot_color', 'type' => 'dropdown', 'heading' => esc_html__( 'Active dot color', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Accent', 'konstrakt' ) => 'accent',
				esc_html__( 'Alternate', 'konstrakt' ) => 'alternate'
			)
		),
		array( 'param_name' => 'inactive_dot_color', 'type' => 'dropdown', 'heading' => esc_html__( 'Inactive dot color', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Light font', 'konstrakt' ) => 'light_font',
				esc_html__( 'Dark font', 'konstrakt' ) => 'dark_font',
				esc_html__( 'Transparent light font', 'konstrakt' ) => 'transparent_light_font',
				esc_html__( 'Transparent dark font', 'konstrakt' ) => 'transparent_dark_font'
			)
		),
		array( 'param_name' => 'slider_arrows_default_state_style', 'type' => 'dropdown', 'heading' => esc_html__( 'Slider arrows default state style', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Dark font on light background', 'konstrakt' ) => 'dark_font_light_bg',
				esc_html__( 'Light font on dark background', 'konstrakt' ) => 'light_font_dark_bg',
				esc_html__( 'Dark font on transparent background', 'konstrakt' ) => 'dark_font_transparent_bg',
				esc_html__( 'Light font on transparent background', 'konstrakt' ) => 'light_font_transparent_bg'
			)
		),
	));
}

function konstrakt_bt_bb_content_slider_class( $class, $atts ) {
	if ( isset( $atts['overflow'] ) && $atts['overflow'] != '' ) {
		$class[] = 'bt_bb_overflow_' . $atts['overflow'];
	}
	if ( isset( $atts['active_dot_color'] ) && $atts['active_dot_color'] != '' ) {
		$class[] = 'bt_bb_active_dot' . '_' . $atts['active_dot_color'];
	}
	if ( isset( $atts['inactive_dot_color'] ) && $atts['inactive_dot_color'] != '' ) {
		$class[] = 'bt_bb_inactive_dot' . '_' . $atts['inactive_dot_color'];
	}
	if ( isset( $atts['slider_arrows_default_state_style'] ) && $atts['slider_arrows_default_state_style'] != '' ) {
		$class[] = 'bt_bb_slider_arrows' . '_' . $atts['slider_arrows_default_state_style'];
	}	
	
	return $class;
}
add_filter( 'bt_bb_content_slider_class', 'konstrakt_bt_bb_content_slider_class', 10, 2 );


// IMAGE SLIDER - new: overflow

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_slider', 'show_arrows' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_slider', array(		
		array( 'param_name' => 'overflow', 'type' => 'dropdown', 'heading' => esc_html__( 'Overflow elements', 'konstrakt' ), 
			'value' => array(
				esc_html__( 'No', 'konstrakt' ) => 'no',
				esc_html__( 'Yes', 'konstrakt' ) => 'yes'
			)
		),
		array( 'param_name' => 'active_dot_color', 'type' => 'dropdown', 'heading' => esc_html__( 'Active dot color', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Accent', 'konstrakt' ) => 'accent',
				esc_html__( 'Alternate', 'konstrakt' ) => 'alternate'
			)
		),
		array( 'param_name' => 'inactive_dot_color', 'type' => 'dropdown', 'heading' => esc_html__( 'Inactive dot color', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Light font', 'konstrakt' ) => 'light_font',
				esc_html__( 'Dark font', 'konstrakt' ) => 'dark_font',
				esc_html__( 'Transparent light font', 'konstrakt' ) => 'transparent_light_font',
				esc_html__( 'Transparent dark font', 'konstrakt' ) => 'transparent_dark_font'
			)
		),
		array( 'param_name' => 'slider_arrows_default_state_style', 'type' => 'dropdown', 'heading' => esc_html__( 'Slider arrows default state style', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Dark font on light background', 'konstrakt' ) => 'dark_font_light_bg',
				esc_html__( 'Light font on dark background', 'konstrakt' ) => 'light_font_dark_bg',
				esc_html__( 'Dark font on transparent background', 'konstrakt' ) => 'dark_font_transparent_bg',
				esc_html__( 'Light font on transparent background', 'konstrakt' ) => 'light_font_transparent_bg'
			)
		),
		array( 'param_name' => 'show_arrows', 'default' => 'show', 'type' => 'dropdown', 'heading' => esc_html__( 'Navigation arrows', 'konstrakt' ),
			'value' => array(
				esc_html__( 'Small', 'konstrakt' ) => 'small',
				esc_html__( 'Normal', 'konstrakt' ) => 'normal',
				esc_html__( 'Large', 'konstrakt' ) => 'large',
				esc_html__( 'Hide', 'konstrakt' ) => 'hide'
			)
		),
	));
}

function konstrakt_bt_bb_slider_class( $class, $atts ) {
	if ( isset( $atts['overflow'] ) && $atts['overflow'] != '' ) {
		$class[] = 'bt_bb_overflow_' . $atts['overflow'];
	}
	if ( isset( $atts['active_dot_color'] ) && $atts['active_dot_color'] != '' ) {
		$class[] = 'bt_bb_active_dot' . '_' . $atts['active_dot_color'];
	}
	if ( isset( $atts['inactive_dot_color'] ) && $atts['inactive_dot_color'] != '' ) {
		$class[] = 'bt_bb_inactive_dot' . '_' . $atts['inactive_dot_color'];
	}
	if ( isset( $atts['slider_arrows_default_state_style'] ) && $atts['slider_arrows_default_state_style'] != '' ) {
		$class[] = 'bt_bb_slider_arrows' . '_' . $atts['slider_arrows_default_state_style'];
	}	
	
	return $class;
}
add_filter( 'bt_bb_slider_class', 'konstrakt_bt_bb_slider_class', 10, 2 );

// SEPARATOR - SPACING

if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_separator', 'top_spacing' );
}
if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_separator', 'bottom_spacing' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_separator', array(
		array( 'param_name' => 'top_spacing', 'type' => 'dropdown', 'heading' => esc_html__( 'Top spacing', 'konstrakt' ), 'weight' => 0, 'preview' => true,
			'responsive_override' => true,
			'value' => array(
				esc_html__( 'No spacing', 'konstrakt' ) 	=> '',
				esc_html__( 'Extra small', 'konstrakt' ) 	=> 'extra_small',
				esc_html__( 'Small', 'konstrakt' ) 		=> 'small',		
				esc_html__( 'Normal', 'konstrakt' ) 		=> 'normal',
				esc_html__( 'Medium', 'konstrakt' )	 	=> 'medium',
				esc_html__( 'Large', 'konstrakt' ) 		=> 'large',
				esc_html__( 'Extra large', 'konstrakt' ) 	=> 'extra_large',
				esc_html__( '5px', 'konstrakt' ) 			=> '5',
				esc_html__( '10px', 'konstrakt' ) 		=> '10',
				esc_html__( '15px', 'konstrakt' ) 		=> '15',
				esc_html__( '20px', 'konstrakt' ) 		=> '20',
				esc_html__( '25px', 'konstrakt' ) 		=> '25',
				esc_html__( '30px', 'konstrakt' ) 		=> '30',
				esc_html__( '35px', 'konstrakt' ) 		=> '35',
				esc_html__( '40px', 'konstrakt' ) 		=> '40',
				esc_html__( '45px', 'konstrakt' ) 		=> '45',
				esc_html__( '50px', 'konstrakt' ) 		=> '50',
				esc_html__( '60px', 'konstrakt' )			=> '60',
				esc_html__( '70px', 'konstrakt' ) 		=> '70',
				esc_html__( '80px', 'konstrakt' ) 		=> '80',
				esc_html__( '90px', 'konstrakt' ) 		=> '90',
				esc_html__( '100px', 'konstrakt' ) 		=> '100',
				esc_html__( '110px', 'konstrakt' ) 		=> '110',
				esc_html__( '120px', 'konstrakt' ) 		=> '120',
				esc_html__( '130px', 'konstrakt' ) 		=> '130',
				esc_html__( '140px', 'konstrakt' ) 		=> '140',
				esc_html__( '150px', 'konstrakt' ) 		=> '150'
			)
		),
		array( 'param_name' => 'bottom_spacing', 'type' => 'dropdown', 'heading' => esc_html__( 'Bottom spacing', 'konstrakt' ), 'weight' => 1, 'preview' => true,
			'responsive_override' => true,
			'value' => array(
				esc_html__( 'No spacing', 'konstrakt' ) 		=> '',
				esc_html__( 'Extra small', 'konstrakt' ) 		=> 'extra_small',
				esc_html__( 'Small', 'konstrakt' ) 			=> 'small',		
				esc_html__( 'Normal', 'konstrakt' ) 			=> 'normal',
				esc_html__( 'Medium', 'konstrakt' ) 			=> 'medium',
				esc_html__( 'Large', 'konstrakt' ) 			=> 'large',
				esc_html__( 'Extra large', 'konstrakt' ) 		=> 'extra_large',
				esc_html__( '5px', 'konstrakt' ) 				=> '5',
				esc_html__( '10px', 'konstrakt' ) 			=> '10',
				esc_html__( '15px', 'konstrakt' ) 			=> '15',
				esc_html__( '20px', 'konstrakt' ) 			=> '20',
				esc_html__( '25px', 'konstrakt' ) 			=> '25',
				esc_html__( '30px', 'konstrakt' ) 			=> '30',
				esc_html__( '35px', 'konstrakt' ) 			=> '35',
				esc_html__( '40px', 'konstrakt' ) 			=> '40',
				esc_html__( '45px', 'konstrakt' ) 			=> '45',
				esc_html__( '50px', 'konstrakt' ) 			=> '50',
				esc_html__( '60px', 'konstrakt' ) 			=> '60',
				esc_html__( '70px', 'konstrakt' ) 			=> '70',
				esc_html__( '80px', 'konstrakt' ) 			=> '80',
				esc_html__( '90px', 'konstrakt' ) 			=> '90',
				esc_html__( '100px', 'konstrakt' ) 			=> '100',
				esc_html__( '110px', 'konstrakt' ) 			=> '110',
				esc_html__( '120px', 'konstrakt' ) 			=> '120',
				esc_html__( '130px', 'konstrakt' ) 			=> '130',
				esc_html__( '140px', 'konstrakt' ) 			=> '140',
				esc_html__( '150px', 'konstrakt' ) 			=> '150'
			)
		),
		array( 'param_name' => 'color', 'type' => 'dropdown', 'heading' => esc_html__( 'Border color', 'konstrakt' ), 'preview' => true,
			'value' => array(
				esc_html__( 'Default', 'konstrakt' ) 			=> '',
				esc_html__( 'Dark transparent color', 'konstrakt' ) 		=> 'dark_transparent',
				esc_html__( 'Light transparent color', 'konstrakt' ) 		=> 'light_transparent',
				esc_html__( 'Dark color', 'konstrakt' ) 		=> 'dark',
				esc_html__( 'Light color', 'konstrakt' ) 		=> 'light',
				esc_html__( 'Accent color', 'konstrakt' ) 	=> 'accent',
				esc_html__( 'Gray color', 'konstrakt' ) 		=> 'gray'
			)
		),
	));
}

function konstrakt_bt_bb_separator_class( $class, $atts ) {
	if ( isset( $atts['color'] ) && $atts['color'] != '' ) {
		$class[] = 'bt_bb_color' . '_' . $atts['color'];
	}
	return $class;
}
add_filter( 'bt_bb_separator_class', 'konstrakt_bt_bb_separator_class', 10, 2 );


// SECTION


if ( function_exists( 'bt_bb_remove_params' ) ) {
	bt_bb_remove_params( 'bt_bb_section', 'background_overlay' );
}

if ( function_exists( 'bt_bb_add_params' ) ) {
	bt_bb_add_params( 'bt_bb_section', array(
		array( 'param_name' => 'allow_content_outside', 'type' => 'dropdown', 'heading' => esc_html__( 'Top & Bottom Coverage Images position', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'No (content to be underneath top and bottom covering image)', 'konstrakt' ) => 'no',
				esc_html__( 'Yes (content will cover both covering images)', 'konstrakt' ) => 'yes'
			)
		),
		array( 'param_name' => 'negative_margin', 'type' => 'dropdown', 'heading' => esc_html__( 'Negative top margin', 'konstrakt' ),'responsive_override' => true, 
				'group' => esc_html__( 'Design', 'konstrakt' ),
			'value' => array(
				esc_html__( 'No margin', 'konstrakt' ) 	=> '',
				esc_html__( 'Small', 'konstrakt' ) 		=> 'small',		
				esc_html__( 'Normal', 'konstrakt' ) 		=> 'normal',
				esc_html__( 'Medium', 'konstrakt' ) 		=> 'medium',
				esc_html__( 'Large', 'konstrakt' ) 		=> 'large',
				esc_html__( 'Extra large', 'konstrakt' ) 	=> 'extra_large',
				esc_html__( '5px', 'konstrakt' ) 			=> '5',
				esc_html__( '10px', 'konstrakt' ) 		=> '10',
				esc_html__( '15px', 'konstrakt' ) 		=> '15',
				esc_html__( '20px', 'konstrakt' ) 		=> '20',
				esc_html__( '25px', 'konstrakt' ) 		=> '25',
				esc_html__( '30px', 'konstrakt' ) 		=> '30',
				esc_html__( '35px', 'konstrakt' ) 		=> '35',
				esc_html__( '40px', 'konstrakt' ) 		=> '40',
				esc_html__( '45px', 'konstrakt' ) 		=> '45',
				esc_html__( '50px', 'konstrakt' ) 		=> '50',
				esc_html__( '55px', 'konstrakt' ) 		=> '55',
				esc_html__( '60px', 'konstrakt' ) 		=> '60',
				esc_html__( '65px', 'konstrakt' ) 		=> '65',
				esc_html__( '70px', 'konstrakt' ) 		=> '70',
				esc_html__( '75px', 'konstrakt' ) 		=> '75',
				esc_html__( '80px', 'konstrakt' ) 		=> '80',
				esc_html__( '85px', 'konstrakt' ) 		=> '85',
				esc_html__( '90px', 'konstrakt' ) 		=> '90',
				esc_html__( '95px', 'konstrakt' ) 		=> '95',
				esc_html__( '100px', 'konstrakt' ) 		=> '100'
			)
		),
		array( 'param_name' => 'background_overlay', 'type' => 'dropdown', 'heading' => esc_html__( 'Background overlay', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ), 
			'value' => array(
				esc_html__( 'No overlay', 'konstrakt' )			=> '',
				esc_html__( 'Light stripes', 'konstrakt' )		=> 'light_stripes',
				esc_html__( 'Dark stripes', 'konstrakt' )			=> 'dark_stripes',
				esc_html__( 'Light solid', 'konstrakt' )			=> 'light_solid',
				esc_html__( 'Dark solid', 'konstrakt' )			=> 'dark_solid',
				esc_html__( 'Accent solid', 'konstrakt' )			=> 'accent_solid',
				esc_html__( 'Alternate solid', 'konstrakt' )		=> 'alternate_solid',
				esc_html__( 'Light gradient', 'konstrakt' )		=> 'light_gradient',
				esc_html__( 'Dark gradient', 'konstrakt' )		 => 'dark_gradient'
			)
		),
		array( 'param_name' => 'background_position', 'type' => 'textfield', 'heading' => esc_html__( 'Background position in keywords (e.g. left, right, top, bottom, center) or in pixels / percentage - ineffective if parallax is used', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ) ),
		array( 'param_name' => 'background_size', 'type' => 'textfield', 'heading' => esc_html__( 'Background size (e.g. auto, cover, contain, initial, inherit or size in pixels - ineffective if parallax is used', 'konstrakt' ), 'group' => esc_html__( 'Design', 'konstrakt' ) ),		
	));
}

add_filter( 'bt_bb_section_extra_responsive_data_override_param', function( $params ) {
	$p = 'negative_margin';
	if ( ! in_array( $p, $params ) ) {
		$params[] = $p;
	}
	return $params;
});

function konstrakt_bt_bb_section_class( $class, $atts ) {
	if ( isset( $atts['allow_content_outside'] ) && $atts['allow_content_outside'] == 'yes' ) {
		// $class[] = 'bt_bb_section_allow_content_outside_' . $atts['allow_content_outside'];
		$class[] = 'bt_bb_section_allow_content_outside';
	}
	return $class;
}

function konstrakt_bt_bb_section_style( $style, $atts ) {
	if ( isset( $atts['background_position'] ) && $atts['background_position'] != '' ) {	
		$background_position_style  = 'background-position:' . $atts['background_position'] . ';';
		if ( $background_position_style ) $style .= $background_position_style;
	}
	if ( isset( $atts['background_size'] ) && $atts['background_size'] != '' ) {	
		$background_size_style  = 'background-size:' . $atts['background_size'] . ';';
		if ( $background_size_style ) $style .= $background_size_style;
	}
	return $style;
}

add_filter( 'bt_bb_section_class', 'konstrakt_bt_bb_section_class', 10, 2 );
add_filter( 'bt_bb_section_style', 'konstrakt_bt_bb_section_style', 10, 2 );


function konstrakt_bt_bb_fe( $elements ) {

	$elements[ 'bt_bb_floating_element' ] = array(
		'edit_box_selector' => '',
		'params' => array(
			'background_image'	=> array( 'js_handler' => array( 'target_selector' => '', 'type' => 'background_image' ) ),
		),
	);
	$elements[ 'bt_bb_floating_image' ] = array(
		'edit_box_selector' => '',
		'params' => array(
			'image'				=>  array(),
		),
	);
	$elements[ 'bt_bb_progress_bar_advanced' ] = array(
		'edit_box_selector' => '',
		'ajax_trigger_scroll' => true,
		'params' => array(
			'type'        				=> array(),
			'percentage'        		=> array(),
			'duration'     	   			=> array(),
			'easing'       	 			=> array(),
			'text'        				=> array( 'js_handler' => array( 'target_selector' => '.bt_bb_progress_bar_advanced_text', 'type' => 'inner_html' ) ),
			'icon'      				=> array(),
			'url'						=> array( 'js_handler' => array( 'target_selector' => 'a', 'type' => 'attr', 'attr' => 'href' ) ),
			'target' 					=> array( 'js_handler' => array( 'target_selector' => 'a', 'type' => 'attr', 'attr' => 'target' ) ),
		),
	);
	$elements[ 'bt_bb_working_hours' ] = array(
		'edit_box_selector' => '',
		'params' => array( 
			'wh_content'    => array(),	
			'size'			=> array( 'js_handler' => array( 'target_selector' => '', 'type' => 'class' ) ),
		),
	);
	$elements[ 'bt_bb_headline_with_icon' ] = array(
		'edit_box_selector' => '',
		'params' => array(
			'headline'      		=> array( 'js_handler' => array( 'target_selector' => '.bt_bb_headline_with_icon_content span', 'type' => 'inner_html' ) ),			
			'superheadline' 		=> array( 'js_handler' => array( 'target_selector' => '.bt_bb_headline_with_icon_superheadline', 'type' => 'inner_html' ) ),
			'subheadline'   		=> array( 'js_handler' => array( 'target_selector' => '.bt_bb_headline_with_icon_subheadline', 'type' => 'inner_html' ) ),
			'icon'					=> array(),
			'icon_position'			=> array(),
			'icon_color_scheme'		=> array(),
			'font_weight'   		=> array( 'js_handler' => array( 'target_selector' => '', 'type' => 'class' ) ),
			'color_scheme'  		=> array( 'ajax_filter' => array( 'class' ) ),			
			'url'					=> array( 'js_handler' => array( 'target_selector' => 'a', 'type' => 'attr', 'attr' => 'href' ) ),
			'target' 				=> array( 'js_handler' => array( 'target_selector' => 'a', 'type' => 'attr', 'attr' => 'target' ) ),
		),
	);

	return $elements;
}
add_filter( 'bt_bb_fe_elements', 'konstrakt_bt_bb_fe' );