<?php
/**
 * Business Interface Base Colors section in Customizer.
 *
 * @package     Business Interface
 * @author      WPInterface Team
 * @since       1.0.0
 */

/**
 * Do not allow direct script access.
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'Business_Interface_Customizer_Colors' ) ) :
	/**
	 * Business Interface Colors section in Customizer.
	 */
	class Business_Interface_Customizer_Colors {

		/**
		 * Primary class constructor.
		 *
		 * @since 1.0.0
		 */
		public function __construct() {

			/**
			 * Registers our custom options in Customizer.
			 */
			add_filter( 'business_interface_customizer_options', array( $this, 'register_options' ) );
		}

		/**
		 * Registers our custom options in Customizer.
		 *
		 * @since 1.0.0
		 * @param array $options Array of customizer options.
		 */
		public function register_options( $options ) {

			// Section.
			$options['section']['business_interface_section_colors'] = array(
				'title'    => esc_html__( 'Base Colors', 'business-interface' ),
				'panel'    => 'business_interface_panel_general',
				'priority' => 20,
			);

			// Accent color.
			$options['setting']['business_interface_accent_color'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_color',
				'control'           => array(
					'type'        => 'business-interface-color',
					'label'       => esc_html__( 'Accent Color', 'business-interface' ),
					'description' => esc_html__( 'The accent color is used subtly throughout your site, to call attention to key elements.', 'business-interface' ),
					'section'     => 'business_interface_section_colors',
					'priority'    => 10,
					'opacity'     => false,
				),
			);

			// Body background heading.
			$options['setting']['business_interface_body_background_heading'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_toggle',
				'control'           => array(
					'type'     => 'business-interface-heading',
					'priority' => 40,
					'label'    => esc_html__( 'Body Background', 'business-interface' ),
					'section'  => 'business_interface_section_colors',
					'toggle'   => false,
				),
			);

			// Content background heading.
			$options['setting']['business_interface_content_colors_heading'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_toggle',
				'control'           => array(
					'type'     => 'business-interface-heading',
					'priority' => 50,
					'label'    => esc_html__( 'Content', 'business-interface' ),
					'section'  => 'business_interface_section_colors',
					'toggle'   => false,
				),
			);

			// Content text color.
			$options['setting']['business_interface_content_text_color'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_color',
				'control'           => array(
					'type'     => 'business-interface-color',
					'label'    => esc_html__( 'Text Color', 'business-interface' ),
					'section'  => 'business_interface_section_colors',
					'priority' => 50,
					'opacity'  => true,
				),
			);

			// Content text color.
			$options['setting']['business_interface_content_link_hover_color'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_color',
				'control'           => array(
					'type'        => 'business-interface-color',
					'label'       => esc_html__( 'Link Hover Color', 'business-interface' ),
					'description' => esc_html__( 'This only applies to entry content area, other links will use the accent color on hover.', 'business-interface' ),
					'section'     => 'business_interface_section_colors',
					'priority'    => 50,
					'opacity'     => true,
				),
			);

			// Headings color.
			$options['setting']['business_interface_headings_color'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_color',
				'control'           => array(
					'type'     => 'business-interface-color',
					'label'    => esc_html__( 'Headings Color', 'business-interface' ),
					'section'  => 'business_interface_section_colors',
					'priority' => 50,
					'opacity'  => true,
				),
			);

			// Content background color.
			$options['setting']['business_interface_boxed_content_background_color'] = array(
				'transport'         => 'postMessage',
				'sanitize_callback' => 'business_interface_sanitize_color',
				'control'           => array(
					'type'        => 'business-interface-color',
					'label'       => esc_html__( 'Boxed Content - Background Color', 'business-interface' ),
					'description' => esc_html__( 'Only used if Site Layout is Boxed or Boxed Content.', 'business-interface' ),
					'section'     => 'business_interface_section_colors',
					'priority'    => 50,
					'opacity'     => true,
				),
			);

			return $options;
		}

	}
endif;
new Business_Interface_Customizer_Colors();
