<?php
/**
 * Layout Setting
 *
 * @author LeapIn Corp.
 * @since 1.0.0
 */
$panel = 'leapin_settings';
$section = 'leapin_layouts_section';
LEAPIN_IDs::initPriority();

$wp_customize->add_section($section, array(
    'title' => __('Layout', 'pjax-blog'),
    'panel' => $panel,
    'description' => __('Select the desired layout for your website.', 'pjax-blog'),
    'priority' => 5,
    'capability' => 'manage_options',
));

/**
 * General Layout
 */
$wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_layouts_general, array(
    'type' => 'theme_mod', // or 'option'
    'capability' => 'manage_options',
    'default' => LEAPIN_Theme_Mod::$default_leapin_layouts_general,
    'transport' => LEAPIN_IDs::$refresh,
    'sanitize_callback' => 'leapin_sanitize_text',
));

$wp_customize->add_control(LEAPIN_IDs::$leapin_layouts_general, array(
    'type' => 'select',
    'label' => __('Select General Layout', 'pjax-blog'),
    'section' => $section,
    'choices' => LEAPIN_Theme_Mod::$choice_leapin_layouts_general,
    'priority' => LEAPIN_IDs::getPriority()
));

/**
 * Home Layout
 */
$wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_layouts_home, array(
    'type' => 'theme_mod', // or 'option'
    'capability' => 'manage_options',
    'default' => LEAPIN_Theme_Mod::$default_leapin_layouts_home,
    'transport' => LEAPIN_IDs::$refresh,
    'sanitize_callback' => 'leapin_sanitize_text',
));

$wp_customize->add_control(LEAPIN_IDs::$leapin_layouts_home, array(
    'type' => 'select',
    'label' => __('Select Home Layout', 'pjax-blog'),
    'section' => $section,
    'choices' => LEAPIN_Theme_Mod::$choice_leapin_layouts_home,
    'priority' => LEAPIN_IDs::getPriority()
));

/**
 * Page Background Color
 */
$wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_layouts_bg_color, array(
    'type' => 'theme_mod', // or 'option'
    'capability' => 'manage_options',
    'default' => '',
    'transport' => LEAPIN_IDs::$postMessage,
    'sanitize_callback' => 'leapin_sanitize_rgba_color'
));
$wp_customize->add_control(new LEAPIN_Customize_Alpha_Color_Control($wp_customize, LEAPIN_IDs::$leapin_layouts_bg_color, array(
    'label' => __('Page Background Color', 'pjax-blog'),
    'section' => $section,
    'settings' => LEAPIN_IDs::$leapin_layouts_bg_color,
    'show_opacity' => true,
    'priority' => LEAPIN_IDs::getPriority()
)));

