<?php if ( ! defined( 'FW' ) ) {
	die( 'Forbidden' );
}

$options = array(
	'homepagesettingbox' => array(
		'title'   => 'Article Template',
		'type'    => 'box',
		'context' => 'side',
		'priority' => 'high',
		'options' => array(
			'singlepostlayout' => array(
				'type'    => 'radio',
				'label'   => esc_html__( 'Choose Template', 'jt-wishbone' ),
				'choices' => array(
					'standard' 	=> esc_html__( 'Standard', 'jt-wishbone' ),
					'wide' 	=> esc_html__( 'Wide and No Sidebar', 'jt-wishbone' ),
				)
			),
		),
	),

	/* Post Format Meta */
	'postformatmeta' => array(
		'title'   => 'Post Format Setting',
		'type'    => 'box',
		'context' => 'advanced',
		'priority' => 'high',
		'options' => array(
			/*
			 * Formats
			 * - video
			 * - audio
			 * - quote
			 * - gallery
			 */

			'video' => array(
				'type'         => 'multi-picker',
				'label'        => false,
				'desc'         => false,
				'picker'       => array(
					'type' => array(
						'label'   => esc_html__( 'Video source', 'jt-wishbone' ),
						'type'    => 'radio',
						'choices' => array(
							'url'  => esc_html__( 'By URL', 'jt-wishbone' ),
							'upload' => esc_html__( 'Upload', 'jt-wishbone' ),
							'iframe' => esc_html__( 'html/iframe code', 'jt-wishbone' )
						),
						'inline' => true,
					)
				),
				'choices'      => array(
					'url'  => array(
						'url'  => array(
							'type'  => 'oembed',
							'label' => esc_html__( 'Put the video URL.', 'jt-wishbone' ),
							'desc' => esc_html__( '(Youtube, vimeo, dailymotion, etc). If the video preview below doesn\'t appear, the video player won\'t appears on the front-end either. Try to put iframe field instead', 'jt-wishbone' ),
							'preview' => array(
						        'width'  => 500, // optional, if you want to set the fixed width to iframe
						        /**
						         * if is set to false it will force to fit the dimensions,
						         * because some widgets return iframe with aspect ratio and ignore applied dimensions
						         */
						        'keep_ratio' => true
						    )
						),
					),
					'upload' => array(
						'upload' => array(
							'label' => esc_html__( 'Upload Video', 'jt-wishbone' ),
							'desc'  => esc_html__( 'Upload video file. ', 'jt-wishbone' ),
							'type'  => 'upload',
							'images_only' => false,
						),
					),
					'iframe'  => array(
						'iframe'  => array(
							'type'  => 'textarea',
							'label' => esc_html__( 'Put the code here', 'jt-wishbone' ),
						),
					),
				),
				'show_borders' => false,
			),

			'audio' => array(
				'type'         => 'multi-picker',
				'label'        => false,
				'desc'         => false,
				'picker'       => array(
					'type' => array(
						'label'   => esc_html__( 'Audio source', 'jt-wishbone' ),
						'type'    => 'radio',
						'choices' => array(
							'url'  => esc_html__( 'By URL', 'jt-wishbone' ),
							'upload' => esc_html__( 'Upload', 'jt-wishbone' ),
							'iframe' => esc_html__( 'html/iframe code', 'jt-wishbone' )
						),
						'inline' => true,
					)
				),
				'choices'      => array(
					'url'  => array(
						'url'  => array(
							'type'  => 'oembed',
							'label' => esc_html__( 'Audio URL', 'jt-wishbone' ),
							'desc' => esc_html__( 'soundcloud, etc', 'jt-wishbone' ),
							'preview' => array(
						        'width'  => 500, // optional, if you want to set the fixed width to iframe
						        /**
						         * if is set to false it will force to fit the dimensions,
						         * because some widgets return iframe with aspect ratio and ignore applied dimensions
						         */
						        'keep_ratio' => true
						    )
						),
					),
					'upload' => array(
						'upload' => array(
							'label' => esc_html__( 'Upload audio', 'jt-wishbone' ),
							'desc'  => esc_html__( 'Upload audio file. Accepted audio files:.mp3, .m4a, .ogg, .wav',
								'jt-wishbone' ),
							'type'  => 'upload',
							'images_only' => false,
						),
					),
					'iframe'  => array(
						'iframe'  => array(
							'type'  => 'textarea',
							'label' => esc_html__( 'Put the code here', 'jt-wishbone' ),
						),
					),
				),
				'show_borders' => false,
			),

			'quote' => array(
				'type'    => 'group',
				'options' => array(
					'quotelink' => array(
						'label' => esc_html__( 'Author Name', 'jt-wishbone' ),
						'type'  => 'text',
					),
					'quoteauthor' => array(
						'label' => esc_html__( 'Source Link', 'jt-wishbone' ),
						'type'  => 'text',
					),
				),
			),

			'gallery' => array(
				'type'    => 'group',
				'options' => array(
					'gallery' => array(
						'label' => esc_html__( 'Upload Images', 'jt-wishbone' ),
						'desc'  => esc_html__( 'Upload the images here',
							'jt-wishbone' ),
						'type'  => 'multi-upload',
					)
				),
			),
		),
	),
);
