<?php
/**
 * An example file demonstrating how to add all controls.
 *
 * @package     Kirki
 * @category    Core
 * @author      Aristeides Stathopoulos
 * @copyright   Copyright (c) 2017, Aristeides Stathopoulos
 * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
 * @since       3.0.12
 */
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
// Do not proceed if Kirki does not exist.
if ( ! class_exists( 'Kirki' ) ) {
	return;
}
/**
 * First of all, add the config.
 *
 * @link https://aristath.github.io/kirki/docs/getting-started/config.html
 */
Kirki::add_config(
	'kirki_demo', array(
		'capability'  => 'edit_theme_options',
		'option_type' => 'theme_mod',
	)
);
/**
 * Add a panel.
 *
 * @link https://aristath.github.io/kirki/docs/getting-started/panels.html
 */
Kirki::add_panel(
	'triptip_options_panel', array(
		'priority'    => 10,
		'title'       => esc_attr__( 'Triptip Options Panel', 'triptip' ),
		'description' => esc_attr__( 'Config Your Theme Options Here.', 'triptip' ),
	)
);
/**
 * Add Sections.
 *
 * We'll be doing things a bit differently here, just to demonstrate an example.
 * We're going to define 1 section per control-type just to keep things clean and separate.
 *
 * @link https://aristath.github.io/kirki/docs/getting-started/sections.html
 */
$sections = array(
	'body'      => array( esc_attr__( 'Main Body Style', 'triptip' ), '' ),
	'header'      => array( esc_attr__( 'Header Settings', 'triptip' ), '' ),
	'blog'      => array( esc_attr__( 'BLog Settings', 'triptip' ), '' ),
	'portfolio'      => array( esc_attr__( 'Portfolio Settings', 'triptip' ), '' ),
	'copyright'      => array( esc_attr__( 'Footer Settings', 'triptip' ), '' ),
	'typo'      => array( esc_attr__( 'Typography Settings', 'triptip' ), '' ),
	
	
);
foreach ( $sections as $section_id => $section ) {
	$section_args = array(
		'title'       => $section[0],
		'description' => $section[1],
		'panel'       => 'triptip_options_panel',
	);
	if ( isset( $section[2] ) ) {
		$section_args['type'] = $section[2];
	}
	Kirki::add_section( str_replace( '-', '_', $section_id ) . '_section', $section_args );
}
/**
 * A proxy function. Automatically passes-on the config-id.
 *
 * @param array $args The field arguments.
 */
function my_config_kirki_add_field( $args ) {
	Kirki::add_field( 'kirki_demo', $args );
}
/**
 * Background Control.
 *
 * @todo Triggers change on load.
 */
/**BLOG CONTROLS**/



my_config_kirki_add_field(
	array(
		'type'        => 'color',
		'settings'    => 'main_color',
		'label'       => esc_attr__( 'Chose Main Color', 'triptip' ),
		'description' => esc_attr__( 'Chose your Main Color Style.', 'triptip' ),
		'section'     => 'body_section',
		'default'     => '#fb646f',
		
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'dimensions',
		'settings'    => 'logo_dimensions',
		'label'       => esc_attr__( 'Logo Dimension Control', 'triptip' ),
		'section'     => 'body_section',
		'default'     => [
			'max-width'  => '100px',
		],
		'choices'     => [
			'labels' => [
				
				'max-width'  => esc_html__( 'Max Width', 'triptip' ),
			],
		],
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'blog_title',
		'label'       => esc_attr__( 'Blog Heading Title', 'triptip' ),
		'description' => esc_attr__( 'insert your blog default title', 'triptip' ),
		'section'     => 'blog_section',
		'default'     => esc_html__('Our Blog','triptip'),
	)
);
my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'sub_title',
		'label'       => esc_attr__( 'Blog Sub Title', 'triptip' ),
		'description' => esc_attr__( 'insert your blog default title', 'triptip' ),
		'section'     => 'blog_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'switch',
		'settings'    => 'post_author',
		'label'       => esc_attr__( 'Turn On Post Author Section', 'triptip' ),
		'description' => esc_attr__( 'Turn On/Off Post Author Section Here', 'triptip' ),
		'section'     => 'blog_section',
		'default'     => false,
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'switch',
		'settings'    => 'post_navi',
		'label'       => esc_attr__( 'Turn On Post Navigation Section', 'triptip' ),
		'description' => esc_attr__( 'Turn On/Off Post Navigation Section Here', 'triptip' ),
		'section'     => 'blog_section',
		'default'     => false,
	)
);


my_config_kirki_add_field(
	array(
		'type'        => 'select',
		'settings'    => 'header_layout',
		'label'       => esc_attr__( 'Header Style', 'triptip' ),
		'description' => esc_attr__( 'Set your default Header Style.', 'triptip' ),
		'section'     => 'header_section',
		'default'     => '1',
		'placeholder' => esc_attr__( 'Select an option', 'triptip' ),
		'choices'     => array(
			'1' => esc_html__( 'Default', 'triptip' ),
            '2' => esc_html__( 'Transparent Header', 'triptip' ),
            '3' => esc_html__( 'White Conatiner', 'triptip' ),
            '4' => esc_html__( 'Light Fullwidth', 'triptip' ),
			
		),
	)
);
my_config_kirki_add_field(
	array(
		'type'        => 'select',
		'settings'    => 'listing_layout',
		'label'       => esc_attr__( 'Listing Archive Style', 'triptip' ),
		'description' => esc_attr__( 'Set your default Listing Archive Style.', 'triptip' ),
		'section'     => 'body_section',
		'default'     => 'fullmap',
		'placeholder' => esc_attr__( 'Select an option', 'triptip' ),
		'choices'     => array(
			'fullmap' => esc_html__( 'Full Map Grid', 'triptip' ),
            'fullmaplist' => esc_html__( 'Full Map List', 'triptip' ),
            'bycat' => esc_html__( 'By Category', 'triptip' ),
            'sidebarmap' => esc_html__( 'Sidebar Map', 'triptip' ),
		),
	)
);


/**Single Ad**/

my_config_kirki_add_field(
	array(
		'type'        => 'select',
		'settings'    => 'footer_layout',
		'label'       => esc_attr__( 'Footer Style', 'triptip' ),
		'description' => esc_attr__( 'Set your default Footer Style.', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '1',
		'placeholder' => esc_attr__( 'Select an option', 'triptip' ),
		'choices'     => array(
			'1' => esc_html__( 'Default', 'triptip' ),
            '2' => esc_html__( 'Dark Background', 'triptip' ),
			
		),
	)
);



my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'facebook_url',
		'label'       => esc_attr__( 'Facebook', 'triptip' ),
		'description' => esc_attr__( 'insert your facebook url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'twitter_url',
		'label'       => esc_attr__( 'Twitter', 'triptip' ),
		'description' => esc_attr__( 'insert your twitter url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);
my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'youtube_url',
		'label'       => esc_attr__( 'Youtube', 'triptip' ),
		'description' => esc_attr__( 'insert your google+ url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'vimeo_url',
		'label'       => esc_attr__( 'Vimeo', 'triptip' ),
		'description' => esc_attr__( 'insert your Vimeo url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'instagram_url',
		'label'       => esc_attr__( 'Instagram', 'triptip' ),
		'description' => esc_attr__( 'insert your instagram url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'linkedin_url',
		'label'       => esc_attr__( 'Linkedin', 'triptip' ),
		'description' => esc_attr__( 'insert your linkedin url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'pinterest_url',
		'label'       => esc_attr__( 'Pinterest', 'triptip' ),
		'description' => esc_attr__( 'insert your pinterest url', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => '',
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'copyright',
		'label'       => esc_attr__( 'Copyright', 'triptip' ),
		'description' => esc_attr__( 'insert your Copyright text', 'triptip' ),
		'section'     => 'copyright_section',
		'default'     => esc_html__('&copy; Copyright By Nunforest 2019','triptip'),
	)
);
/****/
my_config_kirki_add_field(
	array(
		'type'        => 'typography',
		'settings'    => 'paragraph_typo',
		'label'       => esc_attr__( 'Paragraph Typography', 'triptip' ),
		'section'     => 'typo_section',
		'default'     => array(
			'font-family'    => 'Lato',
			'font-size'      => '16px',
			'line-height'    => '26px',
			'variant'    => 300,
			'color'          => '#888',

		),
		'priority'    => 10,
		'output'      => array(
			array(
				'element' => '.paragraph, p, .explore__form-advanced span, .explore__advertise-title, .sidebar__popular-list-desc, .sidebar__advertise-title, .other-posts__desc, .footer__subscribe-input',
			),
		),
	)
);

my_config_kirki_add_field(
	array(
		'type'        => 'typography',
		'settings'    => 'Body_typo',
		'label'       => esc_attr__( 'Body Typography', 'triptip' ),
		'section'     => 'typo_section',
		'default'     => array(
			'font-family'    => 'Poppins',
			'font-size'      => '16px',
			'line-height'    => '26px',
			'variant'    => 300,
			'color'          => '#888',

		),
		'priority'    => 10,
		'output'      => array(
			array(
				'element' => 'body',
			),
		),
	)
);



my_config_kirki_add_field(
	array(
		'type'        => 'text',
		'settings'    => 'map_api',
		'label'       => esc_attr__( 'Google Map API', 'triptip' ),
		'section'     => 'body_section',
		'default'     => '',
	)
);
