<?php

if ( ! function_exists( 'ginevra_core_nav_menu_meta_options' ) ) {
	/**
	 * Function that add general options for this module
	 *
	 * @param object $page
	 */
	function ginevra_core_nav_menu_meta_options( $page ) {

		if ( $page ) {

			$section = $page->add_section_element(
				array(
					'name'  => 'qodef_nav_menu_section',
					'title' => esc_html__( 'Main Menu', 'ginevra-core' ),
                    'dependency' => array (
                        'hide' => array (
                            'qodef_header_layout' => array (
                                'values' => 'ginevra-switch',
                                'default_value' => ''
                            )
                        )
                    )
				)
			);

			$section->add_field_element(
				array(
					'field_type'  => 'text',
					'name'        => 'qodef_dropdown_top_position',
					'title'       => esc_html__( 'Dropdown Position', 'ginevra-core' ),
					'description' => esc_html__( 'Enter value in percentage of entire header height', 'ginevra-core' ),
                    'dependency' => array (
                        'hide' => array (
                            'qodef_header_layout' => array (
                                'values' => array('minimal', 'ginevra-switch'),
                                'default_value' => ''
                            )
                        )
                    )
				)
			);

            $section->add_field_element(
                array(
                    'field_type' => 'color',
                    'name'       => 'qodef_nav_1st_lvl_underline_color',
                    'title'      => esc_html__( 'Menu Underline Color', 'ginevra-core' ),
                    'dependency' => array (
                        'hide' => array (
                            'qodef_header_layout' => array (
                                'values' => 'minimal',
                                'default_value' => ''
                            )
                        )
                    )
                )
            );

            $section->add_field_element(
                array(
                    'field_type' => 'select',
                    'name'       => 'qodef_nav_1st_lvl_numbers',
                    'title'      => esc_html__( 'Numbers in front of the menu items', 'ginevra-core' ),
                    'options'    => ginevra_core_get_select_type_options_pool( 'no_yes', false ),
                    'description' => esc_html__( 'Enable the numbers in front of the menu items', 'ginevra-core' ),
                    'dependency' => array (
                        'show' => array (
                            'qodef_header_layout' => array (
                                'values' => 'minimal',
                                'default_value' => ''
                            )
                        )
                    )
                )
            );
		}
	}

	add_action( 'ginevra_core_action_after_page_header_meta_map', 'ginevra_core_nav_menu_meta_options' );
}
