<?php
/**
 * Customizer settings: colors
 *
 * @package Multi
 */

if ( ! defined( 'ABSPATH' ) ) {
	die;
}

/**
 * Customizer settings for colors section (modifies existing WP colors section)
 */
class Multimagazine_Customize_Colors {

	/**
	 * Registers the section and fires the extension hook.
	 *
	 * @param WP_Customize_Manager $wp_customize Customizer manager instance.
	 */
	public static function register_section( $wp_customize ) {
		$wp_customize->get_section( 'colors' )->priority              = 59;
		$wp_customize->get_control( 'header_textcolor' )->priority    = 125;
		$wp_customize->get_control( 'header_textcolor' )->label       = __( 'Header text color', 'multimagazine' );
		$wp_customize->get_control( 'background_color' )->priority    = 11;
		$wp_customize->get_control( 'background_color' )->label       = __( 'Background color', 'multimagazine' );
		$wp_customize->get_control( 'background_color' )->description = __( 'For', 'multimagazine' ) . ' <strong>' . __( 'boxed', 'multimagazine' ) . '</strong> ' . __( 'layout only.', 'multimagazine' );
		do_action( 'multimagazine_customize_colors', $wp_customize );
	}

	/**
	 * Registers the main color setting.
	 */
	public static function register_main_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_main_color', 'colors', __( 'Main color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the accent color setting.
	 */
	public static function register_accent_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_accent_color', 'colors', __( 'Accent color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the content bg color setting.
	 */
	public static function register_content_bg_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_content_bg_color', 'colors', __( 'Content background color', 'multimagazine' ), __( 'For main content background (boxed and wide layout) . ', 'multimagazine' ), 'postMessage' );
	}

	/**
	 * Registers the border color setting.
	 */
	public static function register_border_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_border_color', 'colors', __( 'Borders color', 'multimagazine' ), __( 'Default color for borders of any elements that have them, separators and other lines', 'multimagazine' ), 'postMessage' );
	}

	/**
	 * Registers the selection color setting.
	 */
	public static function register_selection_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_selection_color', 'colors', __( 'Selection background color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the selection textcolor setting.
	 */
	public static function register_selection_textcolor() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_selection_textcolor', 'colors', __( 'Selection text color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Adds the text colors heading.
	 */
	public static function register_text_colors_heading() {
		multimagazine_add_heading( 'multi_text_color_title', 'colors', __( 'Text colors', 'multimagazine' ) );
	}

	/**
	 * Registers the text color setting.
	 */
	public static function register_text_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_text_color', 'colors', __( 'Main text color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the secondary text color setting.
	 */
	public static function register_secondary_text_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_secondary_text_color', 'colors', __( 'Additional text color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the quote text color setting.
	 */
	public static function register_quote_text_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_quote_text_color', 'colors', __( 'Blockquote text color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the content main headings color setting.
	 */
	public static function register_content_main_headings_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_content_main_headings_color', 'colors', __( 'Content main headings color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the content subheadings color setting.
	 */
	public static function register_content_subheadings_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_content_subheadings_color', 'colors', __( 'Content subheadings color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the content special headings color setting.
	 */
	public static function register_content_special_headings_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_content_special_headings_color', 'colors', __( 'Content special headings color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Adds the links heading.
	 */
	public static function register_links_heading() {
		multimagazine_add_heading( 'multi_links_color_title', 'colors', __( 'Links', 'multimagazine' ) );
	}

	/**
	 * Registers the link color setting.
	 */
	public static function register_link_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_link_color', 'colors', __( 'Link color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the link hover color setting.
	 */
	public static function register_link_hover_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_link_hover_color', 'colors', __( 'Link hover color', 'multimagazine' ), __( 'Dafeult: Main color', 'multimagazine' ), 'postMessage' );
	}

	/**
	 * Registers the content link color setting.
	 */
	public static function register_content_link_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_content_link_color', 'colors', __( 'Content link color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the content link hover color setting.
	 */
	public static function register_content_link_hover_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_setting( 'multi_content_link_hover_color', 'colors', __( 'Content link hover color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the slider arrow color setting.
	 */
	public static function register_slider_arrow_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_alpha_setting( 'multi_slider_arrow_color', 'colors', __( 'Slider navigation arrows color', 'multimagazine' ), '', 'postMessage' );
	}

	/**
	 * Registers the slider arrow hover color setting.
	 */
	public static function register_slider_arrow_hover_color() {
		global $multimagazine_customize;
		$multimagazine_customize->color_alpha_setting( 'multi_slider_arrow_hover_color', 'colors', __( 'Slider navigation arrows hover color', 'multimagazine' ), '', 'postMessage' );
	}
}

add_action( 'customize_register', array( 'Multimagazine_Customize_Colors', 'register_section' ) );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_main_color' ), 10 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_accent_color' ), 15 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_content_bg_color' ), 20 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_border_color' ), 25 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_selection_color' ), 30 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_selection_textcolor' ), 35 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_text_colors_heading' ), 40 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_text_color' ), 45 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_secondary_text_color' ), 50 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_quote_text_color' ), 55 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_content_main_headings_color' ), 60 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_content_subheadings_color' ), 65 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_content_special_headings_color' ), 70 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_links_heading' ), 75 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_link_color' ), 80 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_link_hover_color' ), 85 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_content_link_color' ), 90 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_content_link_hover_color' ), 95 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_slider_arrow_color' ), 100 );
add_action( 'multimagazine_customize_colors', array( 'Multimagazine_Customize_Colors', 'register_slider_arrow_hover_color' ), 105 );
