<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Frontpage Call to action
 *
 * @package pawfect
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'pawfect_Customize_Homepage_Cta_Option' ) ) :

	class pawfect_Customize_Homepage_Cta_Option extends pawfect_Customize_Base_Option {

		/**
		 * Arguments for options.
		 *
		 * @return array
		 */
		public function elements() {

			return array(

			    'pawfect_main_cta_heading'     => array(
					'setting' => array(),
					'control' => array(
						'type'    => 'heading',
				   		'priority'        => 1,
						'label'   => esc_html__( 'CallOut Options', 'pawfect' ),
						'section' => 'pawfect_theme_cta',
					),
				),
			
			    	
				'pawfect_cta_enabled'            => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
						'transport'         => 'postMessage',
					),
					'control' => array(
						'type'     => 'toggle',
						'priority' => 2,
						'label'    => esc_html__( 'Disable CTA Section', 'pawfect' ),
						'description' => esc_html__('Toggle ON to hide this section', 'pawfect'),
						'section'  => 'pawfect_theme_cta',
					),
				),
				
				'pawfect_cta_button_text' => array(
					'setting' => array(
						'default'           => 'Contact Us',
						'sanitize_callback' => 'sanitize_text_field',
					),
					'control' => array(
						'type'            => 'text',
						'priority'        => 10,
						'is_default_type' => true,
						'label'           => esc_html__( 'Button Text', 'pawfect' ),
						'section'         => 'pawfect_theme_cta',
						 'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_cta_disabled',
                            true
                        ],
					),
				),
				
				'pawfect_cta_button_link' => array(
					'setting' => array(
						'default'           => '#',
						'sanitize_callback' => 'sanitize_text_field',
					),
					'control' => array(
						'type'            => 'url',
						'priority'        => 10,
						'is_default_type' => true,
						'label'           => esc_html__( 'Button Link', 'pawfect' ),
						'section'         => 'pawfect_theme_cta',
						'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_cta_disabled',
                            true
                        ],
					),
				),

				'pawfect_cta_button_target' => array(
					'setting' => array(
						'default' => '_self',
						'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_radio'),
					),
					'control' => array(
						'type' => 'radio-switch',
						'priority' => 11,
						'label' => esc_html__('Button Link Target', 'pawfect'),
						'section' => 'pawfect_theme_cta',
						'choices' => array(
							'_self' => esc_html__('Same Tab', 'pawfect'),
							'_blank' => esc_html__('New Tab', 'pawfect'),
						),
						'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_cta_disabled',
                            true
                        ],
					),
				),

				// container
				'pawfect_cta_container_size'     => array(
					'setting' => array(
						'default'			=> 'container',
						'sanitize_callback'	=> array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'				=> 'radio',
						'priority'			=> 25,
						'is_default_type'	=> true,
						'label'				=> esc_html__( 'Cta Width', 'pawfect' ),
						'section'			=> 'pawfect_theme_cta',
						'choices'			=> array(
							'container'		=> esc_html__( 'Container', 'pawfect' ),
							'container-full'=> esc_html__( 'Container Full', 'pawfect' ),
						),
						'active_callback' => [
                            [ $this, 'is_control_value_active' ],
                            'pawfect_cta_enabled',
                            true
                        ],
					),
				),
				
			);

		}

	}

	//new pawfect_Customize_Homepage_Cta_Option();

endif;