<?php
/**
 * Product Layout Options
 *
 * @package Code4rest
 */

namespace Code4rest;

use Code4rest\Theme_Customizer;
use function Code4rest\code4rest;

$settings = array(
	'info_llms_membership_title' => array(
		'control_type' => 'code4rest_title_control',
		'section'      => 'llms_membership_layout',
		'priority'     => 2,
		'label'        => esc_html__( 'Membership Title', 'code4rest' ),
		'settings'     => false,
	),
	'llms_membership_title' => array(
		'control_type' => 'code4rest_switch_control',
		'sanitize'     => 'code4rest_sanitize_toggle',
		'section'      => 'llms_membership_layout',
		'priority'     => 3,
		'default'      => code4rest()->default( 'llms_membership_title' ),
		'label'        => esc_html__( 'Show Membership Title?', 'code4rest' ),
		'transport'    => 'refresh',
	),
	'llms_membership_title_layout' => array(
		'control_type' => 'code4rest_radio_icon_control',
		'section'      => 'llms_membership_layout',
		'label'        => esc_html__( 'Membership Title Layout', 'code4rest' ),
		'transport'    => 'refresh',
		'priority'     => 4,
		'default'      => code4rest()->default( 'llms_membership_title_layout' ),
		'context'      => array(
			array(
				'setting'    => 'llms_membership_title',
				'operator'   => '=',
				'value'      => true,
			),
		),
		'input_attrs'  => array(
			'layout' => array(
				'normal' => array(
					'tooltip' => __( 'In Content', 'code4rest' ),
					'icon'    => 'incontent',
				),
				'above' => array(
					'tooltip' => __( 'Above Content', 'code4rest' ),
					'icon'    => 'abovecontent',
				),
			),
			'responsive' => false,
			'class'      => 'code4rest-two-col',
		),
	),
	'llms_membership_title_inner_layout' => array(
		'control_type' => 'code4rest_radio_icon_control',
		'section'      => 'llms_membership_layout',
		'priority'     => 4,
		'default'      => code4rest()->default( 'llms_membership_title_inner_layout' ),
		'label'        => esc_html__( 'Title Container Width', 'code4rest' ),
		'context'      => array(
			array(
				'setting'    => 'llms_membership_title',
				'operator'   => '=',
				'value'      => true,
			),
			array(
				'setting'    => 'llms_membership_title_layout',
				'operator'   => '=',
				'value'      => 'above',
			),
		),
		'live_method'     => array(
			array(
				'type'     => 'class',
				'selector' => '.llms_membership-hero-section',
				'pattern'  => 'entry-hero-layout-$',
				'key'      => '',
			),
		),
		'input_attrs'  => array(
			'layout' => array(
				'standard' => array(
					'tooltip' => __( 'Background Fullwidth, Content Contained', 'code4rest' ),
					'name'    => __( 'Standard', 'code4rest' ),
					'icon'    => '',
				),
				'fullwidth' => array(
					'tooltip' => __( 'Background & Content Fullwidth', 'code4rest' ),
					'name'    => __( 'Fullwidth', 'code4rest' ),
					'icon'    => '',
				),
				'contained' => array(
					'tooltip' => __( 'Background & Content Contained', 'code4rest' ),
					'name'    => __( 'Contained', 'code4rest' ),
					'icon'    => '',
				),
			),
			'responsive' => false,
		),
	),
	'llms_membership_title_align' => array(
		'control_type' => 'code4rest_radio_icon_control',
		'section'      => 'llms_membership_layout',
		'label'        => esc_html__( 'Membership Title Align', 'code4rest' ),
		'priority'     => 4,
		'default'      => code4rest()->default( 'llms_membership_title_align' ),
		'context'      => array(
			array(
				'setting'    => 'llms_membership_title',
				'operator'   => '=',
				'value'      => true,
			),
		),
		'live_method'     => array(
			array(
				'type'     => 'class',
				'selector' => '.llms_membership-title',
				'pattern'  => array(
					'desktop' => 'title-align-$',
					'tablet'  => 'title-tablet-align-$',
					'mobile'  => 'title-mobile-align-$',
				),
				'key'      => '',
			),
		),
		'input_attrs'  => array(
			'layout' => array(
				'left' => array(
					'tooltip'  => __( 'Left Align Title', 'code4rest' ),
					'dashicon' => 'editor-alignleft',
				),
				'center' => array(
					'tooltip'  => __( 'Center Align Title', 'code4rest' ),
					'dashicon' => 'editor-aligncenter',
				),
				'right' => array(
					'tooltip'  => __( 'Right Align Title', 'code4rest' ),
					'dashicon' => 'editor-alignright',
				),
			),
			'responsive' => true,
		),
	),
	'info_llms_membership_layout' => array(
		'control_type' => 'code4rest_title_control',
		'section'      => 'llms_membership_layout',
		'priority'     => 10,
		'label'        => esc_html__( 'Membership Layout', 'code4rest' ),
		'settings'     => false,
	),
	'llms_membership_layout' => array(
		'control_type' => 'code4rest_radio_icon_control',
		'section'      => 'llms_membership_layout',
		'label'        => esc_html__( 'Membership Layout', 'code4rest' ),
		'transport'    => 'refresh',
		'priority'     => 10,
		'default'      => code4rest()->default( 'llms_membership_layout' ),
		'input_attrs'  => array(
			'layout' => array(
				'normal' => array(
					'tooltip' => __( 'Normal', 'code4rest' ),
					'icon' => 'normal',
				),
				'narrow' => array(
					'tooltip' => __( 'Narrow', 'code4rest' ),
					'icon' => 'narrow',
				),
				'fullwidth' => array(
					'tooltip' => __( 'Fullwidth', 'code4rest' ),
					'icon' => 'fullwidth',
				),
				'left' => array(
					'tooltip' => __( 'Left Sidebar', 'code4rest' ),
					'icon' => 'leftsidebar',
				),
				'right' => array(
					'tooltip' => __( 'Right Sidebar', 'code4rest' ),
					'icon' => 'rightsidebar',
				),
			),
			'responsive' => false,
			'class'      => 'code4rest-three-col',
		),
	),
	'llms_membership_sidebar_id' => array(
		'control_type' => 'code4rest_select_control',
		'section'      => 'llms_membership_layout',
		'label'        => esc_html__( 'Membership Default Sidebar', 'code4rest' ),
		'transport'    => 'refresh',
		'priority'     => 10,
		'default'      => code4rest()->default( 'llms_membership_sidebar_id' ),
		'input_attrs'  => array(
			'options' => code4rest()->sidebar_options(),
		),
	),
	'llms_membership_content_style' => array(
		'control_type' => 'code4rest_radio_icon_control',
		'section'      => 'llms_membership_layout',
		'label'        => esc_html__( 'Content Style', 'code4rest' ),
		'priority'     => 10,
		'default'      => code4rest()->default( 'llms_membership_content_style' ),
		'live_method'     => array(
			array(
				'type'     => 'class',
				'selector' => 'body.single-llms_membership',
				'pattern'  => 'content-style-$',
				'key'      => '',
			),
		),
		'input_attrs'  => array(
			'layout' => array(
				'boxed' => array(
					'tooltip' => __( 'Boxed', 'code4rest' ),
					'icon' => 'boxed',
				),
				'unboxed' => array(
					'tooltip' => __( 'Unboxed', 'code4rest' ),
					'icon' => 'narrow',
				),
			),
			'responsive' => false,
			'class'      => 'code4rest-two-col',
		),
	),
	'llms_membership_vertical_padding' => array(
		'control_type' => 'code4rest_radio_icon_control',
		'section'      => 'llms_membership_layout',
		'label'        => esc_html__( 'Content Vertical Padding', 'code4rest' ),
		'priority'     => 10,
		'default'      => code4rest()->default( 'llms_membership_vertical_padding' ),
		'live_method'     => array(
			array(
				'type'     => 'class',
				'selector' => 'body.single-llms_membership',
				'pattern'  => 'content-vertical-padding-$',
				'key'      => '',
			),
		),
		'input_attrs'  => array(
			'layout' => array(
				'show' => array(
					'name' => __( 'Enable', 'code4rest' ),
				),
				'hide' => array(
					'name' => __( 'Disable', 'code4rest' ),
				),
				'top' => array(
					'name' => __( 'Top Only', 'code4rest' ),
				),
				'bottom' => array(
					'name' => __( 'Bottom Only', 'code4rest' ),
				),
			),
			'responsive' => false,
			'class'      => 'code4rest-two-grid',
		),
	),
);

Theme_Customizer::add_settings( $settings );

