<?php
/**
 * Topbar Options
 *
 * @package Construktly
 */

$wp_customize->add_section(
	'construktly_topbar_options',
	array(
		'panel' => 'construktly_theme_options',
		'title' => esc_html__( 'Topbar Options', 'construktly' ),
	)
);

// Topbar Section - Enable Section.
$wp_customize->add_setting(
	'construktly_enable_topbar_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'construktly_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Construktly_Toggle_Switch_Custom_Control(
		$wp_customize,
		'construktly_enable_topbar_section',
		array(
			'label'    => esc_html__( 'Enable Topbar', 'construktly' ),
			'section'  => 'construktly_topbar_options',
			'settings' => 'construktly_enable_topbar_section',
		)
	)
);

// Topbar Options - Contact Number.
$wp_customize->add_setting(
	'construktly_contact_number',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'construktly_contact_number',
	array(
		'label'           => esc_html__( 'Contact Number', 'construktly' ),
		'section'         => 'construktly_topbar_options',
		'settings'        => 'construktly_contact_number',
		'type'            => 'text',
		'active_callback' => 'construktly_is_topbar_enabled',
	)
);

// Topbar Options - Email Address.
$wp_customize->add_setting(
	'construktly_email_address',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'construktly_email_address',
	array(
		'label'           => esc_html__( 'Email Address', 'construktly' ),
		'section'         => 'construktly_topbar_options',
		'settings'        => 'construktly_email_address',
		'type'            => 'text',
		'active_callback' => 'construktly_is_topbar_enabled',
	)
);

// Topbar Options - Enable Search Form.
$wp_customize->add_setting(
	'construktly_enable_search_form',
	array(
		'sanitize_callback' => 'construktly_sanitize_switch',
		'default'           => true,
	)
);

$wp_customize->add_control(
	new Construktly_Toggle_Switch_Custom_Control(
		$wp_customize,
		'construktly_enable_search_form',
		array(
			'label'           => esc_html__( 'Enable Search Form', 'construktly' ),
			'section'         => 'construktly_topbar_options',
			'active_callback' => 'construktly_is_topbar_enabled',
		)
	)
);

// Topbar Options - Enable Social Menu.
$wp_customize->add_setting(
	'construktly_enable_social_menu',
	array(
		'sanitize_callback' => 'construktly_sanitize_switch',
		'default'           => true,
	)
);

$wp_customize->add_control(
	new Construktly_Toggle_Switch_Custom_Control(
		$wp_customize,
		'construktly_enable_social_menu',
		array(
			'label'           => esc_html__( 'Enable Social Menu', 'construktly' ),
			'section'         => 'construktly_topbar_options',
			'active_callback' => 'construktly_is_topbar_enabled',
		)
	)
);
