<?php

namespace WooSwatches\Modules;

use WooSwatches\Base\Module;

final class General_Settings extends Module {

	public function default_settings() {
		return array(
			'enable_tooltip' 		=> true,
			
			'color_field_style' 	=> 'style_one',
			'color_shape_style' 	=> 'rounded_shape',

			'image_field_style' 	=> 'style_one',
			'image_shape_style' 	=> 'rounded_shape',

			'button_field_style' 	=> 'style_one',
			'button_shape_style' 	=> 'rounded_shape',

			'dropdown_to_button' 	=> false
		);
	}

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

	function validate_settings( $settings ) {

		$settings['enable_tooltip']     = wp_validate_boolean( $settings['enable_tooltip'] );

		$settings['color_field_style'] 	= sanitize_key( $settings['color_field_style'] );
		$settings['color_shape_style'] 	= sanitize_key( $settings['color_shape_style'] );

		$settings['image_field_style'] 	= sanitize_key( $settings['image_field_style'] );
		$settings['image_shape_style'] 	= sanitize_key( $settings['image_shape_style'] );

		$settings['button_field_style'] = sanitize_key( $settings['button_field_style'] );
		$settings['button_shape_style'] = sanitize_key( $settings['button_shape_style'] );
		
		$settings['dropdown_to_button'] = wp_validate_boolean( $settings['dropdown_to_button'] );
		
		return $settings;
	}

}
