<?php
$sidebar_positions   = Minimog_Helper::get_list_sidebar_positions();
$registered_sidebars = Minimog_Redux::instance()->get_registered_widgets_options();

Redux::set_section( Minimog_Redux::OPTION_NAME, array(
	'title'      => __( 'Blog Archive', 'minimog' ),
	'id'         => 'blog_archive',
	'subsection' => true,
	'fields'     => array(
		array(
			'id'     => 'section_start_blog_archive_header',
			'type'   => 'tm_heading',
			'title'  => __( 'Header Settings', 'minimog' ),
			'indent' => true,
		),
		array(
			'id'          => 'blog_archive_header_type',
			'type'        => 'select',
			'title'       => __( 'Header Style', 'minimog' ),
			'placeholder' => __( 'Use Global Setting', 'minimog' ),
			'options'     => Minimog_Header::instance()->get_list( true ),
		),
		array(
			'id'          => 'blog_archive_header_overlay',
			'type'        => 'select',
			'title'       => __( 'Header Overlay', 'minimog' ),
			'placeholder' => __( 'Use Global Setting', 'minimog' ),
			'options'     => Minimog_Header::instance()->get_overlay_list(),
		),
		array(
			'id'          => 'blog_archive_header_skin',
			'type'        => 'select',
			'title'       => __( 'Header Skin', 'minimog' ),
			'placeholder' => __( 'Use Global Setting', 'minimog' ),
			'options'     => Minimog_Header::instance()->get_skin_list(),
		),
		array(
			'id'     => 'section_start_blog_archive_title_bar',
			'type'   => 'tm_heading',
			'title'  => __( 'Title Bar Settings', 'minimog' ),
			'indent' => true,
		),
		array(
			'id'          => 'blog_archive_title_bar_layout',
			'type'        => 'select',
			'title'       => __( 'Title Bar Style', 'minimog' ),
			'placeholder' => __( 'Use Global Setting', 'minimog' ),
			'options'     => Minimog_Title_Bar::instance()->get_list( true ),
		),
		array(
			'id'     => 'section_start_blog_archive_sidebar',
			'type'   => 'tm_heading',
			'title'  => __( 'Sidebar Settings', 'minimog' ),
			'indent' => true,
		),
		array(
			'id'      => 'blog_archive_page_sidebar_1',
			'type'    => 'select',
			'title'   => __( 'Sidebar 1', 'minimog' ),
			'options' => $registered_sidebars,
			'default' => Minimog_Redux::get_default_setting( 'blog_archive_page_sidebar_1' ),
		),
		array(
			'id'      => 'blog_archive_page_sidebar_2',
			'type'    => 'select',
			'title'   => __( 'Sidebar 2', 'minimog' ),
			'options' => $registered_sidebars,
			'default' => Minimog_Redux::get_default_setting( 'blog_archive_page_sidebar_2' ),
		),
		array(
			'id'      => 'blog_archive_page_sidebar_position',
			'type'    => 'button_set',
			'title'   => __( 'Sidebar Position', 'minimog' ),
			'options' => $sidebar_positions,
			'default' => Minimog_Redux::get_default_setting( 'blog_archive_page_sidebar_position' ),
		),
		array(
			'id'             => 'blog_archive_single_sidebar_width',
			'type'           => 'dimensions',
			'units'          => array( '%' ),
			'units_extended' => 'false',
			'title'          => __( 'Single Sidebar Width', 'minimog' ),
			'description'    => __( 'Controls the width of the sidebar when only one sidebar is present. Leave blank to use global setting.', 'minimog' ),
			'height'         => false,
			'default'        => Minimog_Redux::get_default_setting( 'blog_archive_single_sidebar_width' ),
		),
		array(
			'id'             => 'blog_archive_single_sidebar_offset',
			'type'           => 'dimensions',
			'units'          => array( 'px' ),
			'units_extended' => 'false',
			'title'          => __( 'Single Sidebar Offset', 'minimog' ),
			'description'    => __( 'Controls the offset of the sidebar when only one sidebar is present. Leave blank to use global setting.', 'minimog' ),
			'height'         => false,
			'default'        => Minimog_Redux::get_default_setting( 'blog_archive_single_sidebar_offset' ),
		),
		array(
			'id'      => 'blog_archive_page_sidebar_style',
			'type'    => 'select',
			'title'   => __( 'Sidebar Style', 'minimog' ),
			'options' => Minimog_Sidebar::instance()->get_supported_style_options(),
			'default' => Minimog_Redux::get_default_setting( 'blog_archive_page_sidebar_style' ),
		),
		array(
			'id'     => 'section_start_blog_archive_layout',
			'type'   => 'tm_heading',
			'title'  => __( 'Layout Settings', 'minimog' ),
			'indent' => true,
		),
		array(
			'id'      => 'blog_archive_site_layout',
			'type'    => 'select',
			'title'   => __( 'Site Layout', 'minimog' ),
			'options' => Minimog_Site_Layout::instance()->get_container_wide_list(),
			'default' => Minimog_Redux::get_default_setting( 'blog_archive_site_layout' ),
		),
		array(
			'id'      => 'blog_archive_pagination_type',
			'type'    => 'button_set',
			'title'   => __( 'Pagination Type', 'minimog' ),
			'options' => array(
				''          => __( 'Numbered list', 'minimog' ),
				'load-more' => __( 'Load more button', 'minimog' ),
				'infinite'  => __( 'Infinite scrolling', 'minimog' ),
			),
			'default' => Minimog_Redux::get_default_setting( 'blog_archive_pagination_type' ),
		),
		array(
			'id'          => 'blog_archive_style',
			'type'        => 'select',
			'title'       => __( 'Blog Style', 'minimog' ),
			'description' => __( 'Select blog style that display for archive pages.', 'minimog' ),
			'options'     => [
				'grid' => __( 'Grid', 'minimog' ),
				'list' => __( 'List', 'minimog' ),
			],
			'default'     => Minimog_Redux::get_default_setting( 'blog_archive_style' ),
		),
		array(
			'id'       => 'blog_archive_masonry',
			'type'     => 'switch',
			'title'    => __( 'Masonry', 'minimog' ),
			'default'  => Minimog_Redux::get_default_setting( 'blog_archive_masonry' ),
			'required' => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'       => 'blog_archive_grid_image_size',
			'type'     => 'select',
			'title'    => __( 'Image Size', 'minimog' ),
			'options'  => [
				'740x480' => '740x480',
				'840x544' => '840x544',
				'custom'  => __( 'Custom', 'minimog' ),
			],
			'default'  => Minimog_Redux::get_default_setting( 'blog_archive_grid_image_size' ),
			'required' => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_grid_image_size_width',
			'title'         => __( 'Image Size Width', 'minimog' ),
			'type'          => 'slider',
			'min'           => 1,
			'max'           => 960,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
				[ 'blog_archive_grid_image_size', '=', 'custom' ],
			),
		),
		array(
			'id'            => 'blog_archive_grid_image_size_height',
			'title'         => __( 'Image Size Height', 'minimog' ),
			'type'          => 'slider',
			'min'           => 1,
			'max'           => 960,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
				[ 'blog_archive_grid_image_size', '=', 'custom' ],
			),
		),
		array(
			'id'          => 'blog_archive_grid_caption_style',
			'type'        => 'select',
			'title'       => __( 'Blog Caption Style', 'minimog' ),
			'description' => __( 'Select blog grid caption style that display for archive pages.', 'minimog' ),
			'options'     => [
				'01' => '01',
				'02' => '02',
				'03' => '03',
				'04' => '04',
			],
			'default'     => Minimog_Redux::get_default_setting( 'blog_archive_grid_caption_style' ),
			'required'    => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'       => 'blog_archive_grid_caption_alignment',
			'type'     => 'button_set',
			'title'    => __( 'Blog Caption Alignment', 'minimog' ),
			'options'  => array(
				'left'   => __( 'Left', 'minimog' ),
				'center' => __( 'Center', 'minimog' ),
				'right'  => __( 'Right', 'minimog' ),
			),
			'default'  => Minimog_Redux::get_default_setting( 'blog_archive_grid_caption_alignment' ),
			'required' => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_posts_per_page',
			'title'         => __( 'Number posts', 'minimog' ),
			'description'   => __( 'Controls the number of posts per page', 'minimog' ),
			'type'          => 'spinner',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_posts_per_page' ),
			'min'           => 1,
			'max'           => 100,
			'step'          => 1,
			'display_value' => 'text',
		),
		array(
			'id'            => 'blog_archive_lg_columns',
			'title'         => __( 'Grid Columns', 'minimog' ),
			'type'          => 'slider',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_lg_columns' ),
			'min'           => 1,
			'max'           => 6,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_lg_gutter',
			'title'         => __( 'Grid Gutter', 'minimog' ),
			'type'          => 'slider',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_lg_gutter' ),
			'min'           => 0,
			'max'           => 100,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_md_columns',
			'title'         => __( 'Grid Columns (Tablet)', 'minimog' ),
			'type'          => 'slider',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_md_columns' ),
			'min'           => 1,
			'max'           => 6,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_md_gutter',
			'title'         => __( 'Grid Gutter (Tablet)', 'minimog' ),
			'type'          => 'slider',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_md_gutter' ),
			'min'           => 0,
			'max'           => 100,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_sm_columns',
			'title'         => __( 'Grid Columns (Mobile)', 'minimog' ),
			'type'          => 'slider',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_sm_columns' ),
			'min'           => 1,
			'max'           => 6,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
		array(
			'id'            => 'blog_archive_sm_gutter',
			'title'         => __( 'Grid Gutter (Mobile)', 'minimog' ),
			'type'          => 'slider',
			'default'       => Minimog_Redux::get_default_setting( 'blog_archive_sm_gutter' ),
			'min'           => 0,
			'max'           => 100,
			'step'          => 1,
			'display_value' => 'text',
			'required'      => array(
				[ 'blog_archive_style', '=', 'grid' ],
			),
		),
	),
) );
