<?php

if ( ! function_exists( 'aalto_edge_footer_options_map' ) ) {
	function aalto_edge_footer_options_map() {
		
		aalto_edge_add_admin_page(
			array(
				'slug'  => '_footer_page',
				'title' => esc_html__( 'Footer', 'aalto' ),
				'icon'  => 'fa fa-sort-amount-asc'
			)
		);
		
		$footer_panel = aalto_edge_add_admin_panel(
			array(
				'title' => esc_html__( 'Footer', 'aalto' ),
				'name'  => 'footer',
				'page'  => '_footer_page'
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'type'          => 'yesno',
				'name'          => 'footer_in_grid',
				'default_value' => 'yes',
				'label'         => esc_html__( 'Footer in Grid', 'aalto' ),
				'description'   => esc_html__( 'Enabling this option will place Footer content in grid', 'aalto' ),
				'parent'        => $footer_panel,
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'type'          => 'yesno',
				'name'          => 'show_footer_top',
				'default_value' => 'yes',
				'label'         => esc_html__( 'Show Footer Top', 'aalto' ),
				'description'   => esc_html__( 'Enabling this option will show Footer Top area', 'aalto' ),
				'args'          => array(
					'dependence'             => true,
					'dependence_hide_on_yes' => '',
					'dependence_show_on_yes' => '#edgtf_show_footer_top_container'
				),
				'parent'        => $footer_panel,
			)
		);
		
		$show_footer_top_container = aalto_edge_add_admin_container(
			array(
				'name'            => 'show_footer_top_container',
				'hidden_property' => 'show_footer_top',
				'hidden_value'    => 'no',
				'parent'          => $footer_panel
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'type'          => 'select',
				'name'          => 'footer_top_columns',
				'parent'        => $show_footer_top_container,
				'default_value' => '4',
				'label'         => esc_html__( 'Footer Top Columns', 'aalto' ),
				'description'   => esc_html__( 'Choose number of columns for Footer Top area', 'aalto' ),
				'options'       => array(
					'1' => '1',
					'2' => '2',
					'3' => '3',
					'4' => '4'
				)
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'type'          => 'select',
				'name'          => 'footer_top_columns_alignment',
				'default_value' => 'left',
				'label'         => esc_html__( 'Footer Top Columns Alignment', 'aalto' ),
				'description'   => esc_html__( 'Text Alignment in Footer Columns', 'aalto' ),
				'options'       => array(
					''       => esc_html__( 'Default', 'aalto' ),
					'left'   => esc_html__( 'Left', 'aalto' ),
					'center' => esc_html__( 'Center', 'aalto' ),
					'right'  => esc_html__( 'Right', 'aalto' )
				),
				'parent'        => $show_footer_top_container,
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'name'        => 'footer_top_background_color',
				'type'        => 'color',
				'label'       => esc_html__( 'Background Color', 'aalto' ),
				'description' => esc_html__( 'Set background color for top footer area', 'aalto' ),
				'parent'      => $show_footer_top_container
			)
		);

		aalto_edge_add_admin_field(
			array(
				'name'        => 'footer_top_background_image',
				'type'        => 'image',
				'label'       => esc_html__( 'Footer Top Background Image', 'aalto' ),
				'description' => esc_html__( 'Choose an image to be used as a footer top background image', 'aalto' ),
				'parent'      => $show_footer_top_container
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'type'          => 'yesno',
				'name'          => 'show_footer_bottom',
				'default_value' => 'yes',
				'label'         => esc_html__( 'Show Footer Bottom', 'aalto' ),
				'description'   => esc_html__( 'Enabling this option will show Footer Bottom area', 'aalto' ),
				'args'          => array(
					'dependence'             => true,
					'dependence_hide_on_yes' => '',
					'dependence_show_on_yes' => '#edgtf_show_footer_bottom_container'
				),
				'parent'        => $footer_panel,
			)
		);
		
		$show_footer_bottom_container = aalto_edge_add_admin_container(
			array(
				'name'            => 'show_footer_bottom_container',
				'hidden_property' => 'show_footer_bottom',
				'hidden_value'    => 'no',
				'parent'          => $footer_panel
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'type'          => 'select',
				'name'          => 'footer_bottom_columns',
				'default_value' => '2',
				'label'         => esc_html__( 'Footer Bottom Columns', 'aalto' ),
				'description'   => esc_html__( 'Choose number of columns for Footer Bottom area', 'aalto' ),
				'options'       => array(
					'1' => '1',
					'2' => '2',
					'3' => '3'
				),
				'parent'        => $show_footer_bottom_container,
			)
		);
		
		aalto_edge_add_admin_field(
			array(
				'name'        => 'footer_bottom_background_color',
				'type'        => 'color',
				'label'       => esc_html__( 'Background Color', 'aalto' ),
				'description' => esc_html__( 'Set background color for bottom footer area', 'aalto' ),
				'parent'      => $show_footer_bottom_container
			)
		);

		aalto_edge_add_admin_field(
			array(
				'name'        => 'footer_bottom_background_image',
				'type'        => 'image',
				'label'       => esc_html__( 'Footer Bottom Background Image', 'aalto' ),
				'description' => esc_html__( 'Choose an image to be used as a footer bottom background image', 'aalto' ),
				'parent'      => $show_footer_bottom_container
			)
		);
	}
	
	add_action( 'aalto_edge_options_map', 'aalto_edge_footer_options_map', 11 );
}