<?php

if ( ! function_exists( 'ginevra_core_add_ginevra_switch_header_meta' ) ) {
	/**
	 * Function that add additional header layout meta box options
	 *
	 * @param object $page
	 */
	function ginevra_core_add_ginevra_switch_header_meta( $page ) {
		$section = $page->add_section_element(
			array(
				'name'       => 'qodef_ginevra_switch_header_section',
				'title'      => esc_html__( 'Ginevra Switch Header', 'ginevra-core' ),
				'dependency' => array(
					'show' => array(
						'qodef_header_layout' => array(
							'values' => 'ginevra-switch',
							'default_value' => ''
						)
					)
				)
			)
		);

        $section->add_field_element(
            array(
                'field_type'    => 'select',
                'name'          => 'qodef_ginevra_switch_header_in_grid',
                'title'         => esc_html__( 'Content in Grid', 'ginevra-core' ),
                'description'   => esc_html__( 'Set content to be in grid', 'ginevra-core' ),
                'default_value' => '',
                'options'       => ginevra_core_get_select_type_options_pool( 'no_yes' ),
            )
        );

		$section->add_field_element(
			array(
				'field_type'  => 'text',
				'name'        => 'qodef_ginevra_switch_header_height',
				'title'       => esc_html__( 'Header Height', 'ginevra-core' ),
				'description' => esc_html__( 'Enter header height', 'ginevra-core' ),
				'args'        => array(
					'suffix' => esc_html__( 'px', 'ginevra-core' )
				)
			)
		);
		
		$section->add_field_element(
			array(
				'field_type'  => 'text',
				'name'        => 'qodef_ginevra_switch_header_side_padding',
				'title'       => esc_html__( 'Header Side Padding', 'ginevra-core' ),
				'description' => esc_html__( 'Enter side padding for header area', 'ginevra-core' ),
				'args'        => array(
					'suffix' => esc_html__( 'px or %', 'ginevra-core' )
				)
			)
		);

		$section->add_field_element(
			array(
				'field_type'  => 'color',
				'name'        => 'qodef_ginevra_switch_header_background_color',
				'title'       => esc_html__( 'Header Background Color', 'ginevra-core' ),
				'description' => esc_html__( 'Enter header background color', 'ginevra-core' )
			)
		);
		
		$section->add_field_element(
			array(
				'field_type'  => 'select',
				'name'        => 'qodef_ginevra_switch_header_enable_border',
				'title'       => esc_html__( 'Enable Header Border', 'ginevra-core' ),
				'default_value' => '',
				'options'       => ginevra_core_get_select_type_options_pool( 'no_yes' )
			)
		);

		$section->add_field_element(
			array(
				'field_type'  => 'color',
				'name'        => 'qodef_ginevra_switch_header_border_color',
				'title'       => esc_html__( 'Header Border Color', 'ginevra-core' ),
				'description' => esc_html__( 'Enter header border color', 'ginevra-core' ),
				'dependency' => array(
					'show' => array(
						'qodef_ginevra_switch_header_enable_border' => array(
							'values' => array( 'yes', '' ),
							'default_value' => ''
						)
					)
				)
			)
		);
	}
	
	add_action( 'ginevra_core_action_after_page_header_meta_map', 'ginevra_core_add_ginevra_switch_header_meta' );
}
