<?php

namespace WooSwatches\Modules;

use WooSwatches\Base\Module;

final class Style_Settings extends Module {

	public function __construct() {
		parent::__construct();
	}

	public function default_settings() {
		return array(
			'tick_color'  => '',
			'cross_color' => '',

			'bg_color' => '',
			'bg_color_selected' => '',
			'bg_color_disabled' => '',
			'bg_color_selected_disabled' => '',

			'br_color' => '',
			'br_color_selected' => '',
			'br_color_disabled' => '',
			'br_color_selected_disabled' => '',

			'text_color' => '',
			'text_color_selected' => '',
			'text_color_disabled' => '',
			'text_color_selected_disabled' => '',

			'width'       => '24',
			'height'      => '24',
			'font_size'   => '15',
		);
	}

	function validate_settings( $settings ) {

		$settings['tick_color']                   = sanitize_text_field( $settings['tick_color'] );
		$settings['cross_color']                  = sanitize_text_field( $settings['cross_color'] );

		$settings['bg_color']                     = sanitize_text_field( $settings['bg_color'] );
		$settings['bg_color_selected']            = sanitize_text_field( $settings['bg_color_selected'] );
		$settings['bg_color_disabled']            = sanitize_text_field( $settings['bg_color_disabled'] );
		$settings['bg_color_selected_disabled']   = sanitize_text_field( $settings['bg_color_selected_disabled'] );

		$settings['br_color']                     = sanitize_text_field( $settings['br_color'] );
		$settings['br_color_selected']            = sanitize_text_field( $settings['br_color_selected'] );
		$settings['br_color_disabled']            = sanitize_text_field( $settings['br_color_disabled'] );
		$settings['br_color_selected_disabled']   = sanitize_text_field( $settings['br_color_selected_disabled'] );

		$settings['text_color']                   = sanitize_text_field( $settings['text_color'] );
		$settings['text_color_selected']          = sanitize_text_field( $settings['text_color_selected'] );
		$settings['text_color_disabled']          = sanitize_text_field( $settings['text_color_disabled'] );
		$settings['text_color_selected_disabled'] = sanitize_text_field( $settings['text_color_selected_disabled'] );

		$settings['width']                        = sanitize_text_field( $settings['width'] );
		$settings['height']                       = sanitize_text_field( $settings['height'] );
		$settings['font_size']                    = sanitize_text_field( $settings['font_size'] );

		return $settings;
	}

}
