<?php
/**
 * Template Post
 * @package MatrixAddons
 * @subpackage trainifyframework
 * @since 1.0.0
 */
$wp_customize->add_section(
    'template_page_options', 
    array(
        'title' => esc_html__('Page Options', 'trainify'),
        'panel' => 'site_template_options',
        'priority' => 30,
    )
);

/**
 * Enable Breadcrumbs
 *
 * @since 1.0.0
 */
$wp_customize->add_setting(
    'trainify_framework_enable_breadcrumbs_page', array(
        'sanitize_callback' => 'esc_attr',
        'default'           => 'enable',
    )
);
$wp_customize->add_control(
    new TrainifyFramework_Customize_Switch_Control(
        $wp_customize, 
        'trainify_framework_enable_breadcrumbs_page', 
        array(
            'label' => esc_html__('Enable Breadcrumbs?', 'trainify'),
            'section' => 'template_page_options',
            'priority' => 10,
            'type'=>'switch',
            'choices'=> array(
                'enable'=> esc_html__('Enable', 'trainify'),
                'disable'=> esc_html__('Disable', 'trainify'),
            ),
            'description'=> esc_html__('You can enable breadcrumbs to show before page details.', 'trainify'),
        )
    )
);

/**
 * Sidebar Layouts
 *
 * @since 1.0.0
 */
$wp_customize->add_setting(
    'trainify_framework_default_page_sidebar',
    array(
        'default'           => 'right_sidebar',
        'sanitize_callback' => 'sanitize_key',
    )
);
$wp_customize->add_control( 
    new TrainifyFramework_Customize_Imageoptions_Control(
        $wp_customize,
        'trainify_framework_default_page_sidebar',
        array(
            'label'    => esc_html__( 'Sidebar Layout', 'trainify' ),
            'description' => esc_html__( 'Choose sidebar from available layouts', 'trainify' ),
            'section'  => 'template_page_options',
            'choices'  => array(
                'left_sidebar' => array(
                    'label' => esc_html__( 'Left Sidebar', 'trainify' ),
                    'url'   => '%s/inc/trainifyframework/assets/img/sidebars/left-sidebar.png'
                ),
                'right_sidebar' => array(
                    'label' => esc_html__( 'Right Sidebar', 'trainify' ),
                    'url'   => '%s/inc/trainifyframework/assets/img/sidebars/right-sidebar.png'
                ),
                'no_sidebar' => array(
                    'label' => esc_html__( 'No Sidebar', 'trainify' ),
                    'url'   => '%s/inc/trainifyframework/assets/img/sidebars/no-sidebar.png'
                ),
                'no_sidebar_center' => array(
                    'label' => esc_html__( 'No Sidebar Center', 'trainify' ),
                    'url'   => '%s/inc/trainifyframework/assets/img/sidebars/no-sidebar-center.png'
                ),
                'both_sidebar' => array(
                    'label' => esc_html__( 'Both Sidebar', 'trainify' ),
                    'url'   => '%s/inc/trainifyframework/assets/img/sidebars/both-sidebar.png'
                )
            ),
            'priority' => 20
        )
    )
);

/**
 * Enable Featured Image
 *
 * @since 1.0.0
 */
$wp_customize->add_setting(
    'trainify_framework_enable_featured_image_page', array(
        'sanitize_callback' => 'esc_attr',
        'default'           => 'show',
    )
);
$wp_customize->add_control(
    new TrainifyFramework_Customize_Switch_Control(
        $wp_customize, 
        'trainify_framework_enable_featured_image_page', 
        array(
            'label' => esc_html__('Show Featured Image?', 'trainify'),
            'section' => 'template_page_options',
            'priority' => 30,
            'type'=>'switch',
            'choices'=> array(
                'show'=> esc_html__('Show', 'trainify'),
                'hide'=> esc_html__('Hide', 'trainify'),
            ),
            'description'=> esc_html__('If you can show featured image on single page check on show button.', 'trainify'),
        )
    )
);


