<?php
/**
 * leatherhouse Header.
 *
 * @package leatherhouse
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'leatherhouse_Customize_Page_Header_Option' ) ) :

	class leatherhouse_Customize_Page_Header_Option extends leatherhouse_Customize_Base_Option {


		public function elements() {

			return array(

				'leatherhouse_page_header_heading'          => array(
					'setting' => array(),
					'control' => array(
						'type'     => 'parent_heading',
						'priority' => 1,
						'label'    => esc_html__( 'Page Header/Breadcrumb', 'leather-house' ),
						'section'  => 'leatherhouse_theme_breadcrumb',
					),
				),

				'leatherhouse_page_header_disabled'         => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'     => 'toggle',
						'priority' => 5,
						'label'    => esc_html__( 'Page Header Enable/Disable', 'leather-house' ),
						// 'description'    => esc_html__( 'Note: If you Disable Page Header then also disable Menu Overlap Setting. GO To Theme Options > Menu Settings and disable Menu Overlap.', 'leather-house' ),
						'section'  => 'leatherhouse_theme_breadcrumb',
					),
				),

				'leatherhouse_page_header_effect'           => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'            => 'toggle',
						'priority'        => 5,
						'label'           => esc_html__( 'Enable Water Effect on Breadcrumb?', 'leather-house' ),
						// 'description'    => esc_html__( 'Note: If you Disable Page Header then also disable Menu Overlap Setting. GO To Theme Options > Menu Settings and disable Menu Overlap.', 'leather-house' ),
						'section'         => 'leatherhouse_theme_breadcrumb',
						'active_callback' => 'leatherhouse_page_header_effect',
					),
				),

				'leatherhouse_page_header_background_color' => array(
					'setting' => array(
						'default'           => 'rgba(0,0,0,0.69)',
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_alpha_color' ),
					),
					'control' => array(
						'type'            => 'color',
						'priority'        => 7,
						'label'           => esc_html__( 'Page Header/Breadcrumb Color', 'leather-house' ),
						'section'         => 'leatherhouse_theme_breadcrumb',
						'choices'         => array(
							'alpha' => true,
						),
						'active_callback' => 'leatherhouse_page_header_background_color',
					),
				),

				'leatherhouse_custom_logo_size'             => array(
					'setting' => array(
						'default'           => array(
							'slider' => 200,
							'suffix' => 'px',
						),
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_slider' ),
					),
					'control' => array(
						'type'        => 'slider',
						'priority'    => 55,
						'label'       => esc_html__( 'Logo Width', 'leather-house' ),
						'section'     => 'title_tagline',
						'input_attrs' => array(
							'min'  => 0,
							'max'  => 600,
							'step' => 2,
						),
					),
				),

			);

		}

	}

	new leatherhouse_Customize_Page_Header_Option();

endif;

function leatherhouse_page_header_background_color( $control ) {
	return true === ( $control->manager->get_setting( 'leatherhouse_page_header_disabled' )->value() == true );
}
function leatherhouse_page_header_effect( $control ) {
	return true === ( $control->manager->get_setting( 'leatherhouse_page_header_disabled' )->value() == true );
}
function leatherhouse_breadcrumb_height( $control ) {
	return true === ( $control->manager->get_setting( 'leatherhouse_page_header_disabled' )->value() == true );
}
function leatherhouse_breadcrumb_bg_img( $control ) {
	return true === ( $control->manager->get_setting( 'leatherhouse_page_header_disabled' )->value() == true );
}
function leatherhouse_breadcrumb_back_attach( $control ) {
	return true === ( $control->manager->get_setting( 'leatherhouse_page_header_disabled' )->value() == true );
}
