<?php

if ( ! function_exists( 'calla_elated_get_hide_dep_for_header_centered_meta_boxes' ) ) {
	function calla_elated_get_hide_dep_for_header_centered_meta_boxes() {
		$hide_dep_options = apply_filters( 'calla_elated_header_centered_hide_meta_boxes', $hide_dep_options = array() );
		
		return $hide_dep_options;
	}
}

if ( ! function_exists( 'calla_elated_header_centered_logo_meta_map' ) ) {
	function calla_elated_header_centered_logo_meta_map( $parent ) {
		$hide_dep_options = calla_elated_get_hide_dep_for_header_centered_meta_boxes();
		
		calla_elated_create_meta_box_field(
			array(
				'parent'          => $parent,
				'type'            => 'text',
				'name'            => 'eltdf_logo_wrapper_padding_header_centered_meta',
				'default_value'   => '',
				'label'           => esc_html__( 'Logo Padding', 'calla' ),
				'description'     => esc_html__( 'Insert padding in format: 0px 0px 1px 0px', 'calla' ),
				'args'            => array(
					'col_width' => 3
				),
				'dependency' => array(
					'hide' => array(
						'eltdf_header_type_meta'  => $hide_dep_options
					)
				)
			)
		);
	}
	
	add_action( 'calla_elated_header_logo_area_additional_meta_boxes_map', 'calla_elated_header_centered_logo_meta_map', 10, 1 );
}

if ( ! function_exists( 'calla_elated_header_centered_meta_map' ) ) {
	function calla_elated_header_centered_meta_map( $parent ) {
		$hide_dep_options = calla_elated_get_hide_dep_for_header_centered_meta_boxes();
		
		$header_centered_container = calla_elated_add_admin_container_no_style(
			array(
				'type'            => 'container',
				'name'            => 'header_centered_container',
				'parent'          => $parent,
				'dependency' => array(
					'hide' => array(
						'eltdf_header_type_meta'  => $hide_dep_options
					)
				)
			)
		);
		
		calla_elated_add_admin_section_title(
			array(
				'parent' => $header_centered_container,
				'name'   => 'header_centered_style',
				'title'  => esc_html__( 'Header Centered', 'calla' )
			)
		);
		
		$calla_custom_sidebars = calla_elated_get_custom_sidebars();
		if ( count( $calla_custom_sidebars ) > 0 ) {
			calla_elated_create_meta_box_field(
				array(
					'name'        => 'eltdf_custom_header_centered_left_widget_meta',
					'type'        => 'selectblank',
					'label'       => esc_html__( 'Choose Custom Widget Area for Header Centered Left Widget Area', 'calla' ),
					'description' => esc_html__( 'Choose custom widget area to display in header centered on the left side of the menu"', 'calla' ),
					'parent'      => $header_centered_container,
					'options'     => $calla_custom_sidebars
				)
			);

			calla_elated_create_meta_box_field(
				array(
					'name'        => 'eltdf_custom_header_centered_right_widget_meta',
					'type'        => 'selectblank',
					'label'       => esc_html__( 'Choose Custom Widget Area for Header Centered Right Widget Area', 'calla' ),
					'description' => esc_html__( 'Choose custom widget area to display in header centered on the right side of the menu"', 'calla' ),
					'parent'      => $header_centered_container,
					'options'     => $calla_custom_sidebars
				)
			);
		}
	}
	
	add_action( 'calla_elated_additional_header_area_meta_boxes_map', 'calla_elated_header_centered_meta_map', 10, 1 );
}