<?php

if ( ! function_exists( 'ginevra_core_add_ginevra_switch_header_global_option' ) ) {
	/**
	 * This function set header type value for global header option map
	 */
	function ginevra_core_add_ginevra_switch_header_global_option( $header_layout_options ) {
		$header_layout_options['ginevra-switch'] = array(
			'image' => GINEVRA_CORE_HEADER_LAYOUTS_URL_PATH . '/ginevra-switch/assets/img/ginevra-switch-header.png',
			'label' => esc_html__( 'Ginevra Switch', 'ginevra-core' )
		);

		return $header_layout_options;
	}

	add_filter( 'ginevra_core_filter_header_layout_option', 'ginevra_core_add_ginevra_switch_header_global_option' );
}

if ( ! function_exists( 'ginevra_core_register_ginevra_switch_header_layout' ) ) {
	/**
	 * Function which add header layout into global list
	 *
	 * @param array $header_layouts
	 *
	 * @return array
	 */
	function ginevra_core_register_ginevra_switch_header_layout( $header_layouts ) {
		$header_layout = array(
			'ginevra-switch' => 'GinevraSwitchHeader'
		);

		$header_layouts = array_merge( $header_layouts, $header_layout );

		return $header_layouts;
	}

	add_filter( 'ginevra_core_filter_register_header_layouts', 'ginevra_core_register_ginevra_switch_header_layout');
}


if ( ! function_exists( 'ginevra_core_register_ginevra_switch_menu' ) ) {
	/**
	 * Function which add additional main menu navigation into global list
	 *
	 * @param array $menus
	 *
	 * @return array
	 */
	function ginevra_core_register_ginevra_switch_menu( $menus ) {
		$menus['ginevra-switch-menu-navigation'] = esc_html__( 'Ginevra Switch Navigation', 'ginevra-core' );
		
		return $menus;
	}
	
	add_filter( 'ginevra_filter_register_navigation_menus', 'ginevra_core_register_ginevra_switch_menu' );
}

if ( ! function_exists( 'ginevra_core_ginevra_switch_header_hide_scroll_appearance' ) ) {
	/**
	 * Function that set dependency option value for specific module layout
	 *
	 * @param array $options
	 *
	 * @return array
	 */
	function ginevra_core_ginevra_switch_header_hide_scroll_appearance( $options ) {
		$options[] = 'ginevra-switch';
		
		return $options;
	}
	
	add_filter( 'ginevra_core_filter_header_scroll_appearance_hide_option', 'ginevra_core_ginevra_switch_header_hide_scroll_appearance' );
}