<?php
/*
 * Theme Metabox Options
 * @package Nextpage
 * @since 1.0.0
 * */

if (!defined('ABSPATH')) {
	exit(); // exit if access directly
}

if (class_exists('CSF')) {


	$nextpage_prefix = 'nextpage';


	//video meta
	CSF::createMetabox($nextpage_prefix . '_post_video', array(
		'title'     => esc_html__('Add Video', 'nextpage'),
		'post_type' => 'post',
	));

	CSF::createSection($nextpage_prefix . '_post_video', array(
		'fields' => array(
			array(
				'id'      => 'videoid',
				'type'    => 'text',
				'title'   => esc_html__('Enter Youtube Video Id', 'nextpage'),
				'desc'    => esc_html__('Keep blank to hide video section in post details', 'nextpage'),
				'default' => 'WwvNiN2_Jlk'
			),
			array(
				'id'      => 'videotitle',
				'type'    => 'text',
				'title'   => esc_html__('Enter Youtube Video Title', 'nextpage'),
				'default' => esc_html__('Expression in New Human Rights Policy', 'nextpage')
			),
			array(
				'id'      => 'videocontent',
				'type'    => 'textarea',
				'title'   => esc_html__('Enter Youtube Video Content', 'nextpage'),
				'default' => esc_html__('No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure.', 'nextpage')
			),
			array(
				'id'    => 'videoimage',
				'type'  => 'media',
				'title' => esc_html__('Video Background Image', 'nextpage'),
			),
		)
	));


	/*-------------------------------------
	   Page Options
   -------------------------------------*/
	$nextpage_group_meta = 'nextpage_page_meta';
	CSF::createMetabox($nextpage_group_meta, array(
		'title'     => 'Page Options',
		'post_type' => 'page',
	));

	//
	// Create a section
	CSF::createSection($nextpage_group_meta, array(
		'title'  => esc_html__('Header Option', 'nextpage'),
		'fields' => array(
			array(
				'id'      => 'header_style', // Header Style
				'type'    => 'button_set',
				'title'   => esc_html__('Header Style', 'nextpage'),
				'options' => array(
					'premade-header' => esc_html__('Pre Made Header', 'nextpage'),
					'header-builder' => esc_html__('Header Builder', 'nextpage'),
				),
				'default' => 'premade-header',
			),
			array(
				'type'       => 'subheading',
				'content'    => esc_html__('Header Option', 'nextpage'),
				'dependency' => array('header_style', '==', 'premade-header'),
			),
			//
			// nav select
			array(
				'id'         => $nextpage_prefix . '_nav_menu',
				'type'       => 'image_select',
				'title'      => esc_html__('Select Header', 'nextpage'),
				'dependency' => array('header_style', '==', 'premade-header'),
				'options'    => array(
					'header-one' => NEXTPAGE_THEME_OPTIONS_IMG . '/nav/nav-01.png',
					'header-two' => NEXTPAGE_THEME_OPTIONS_IMG . '/nav/nav-02.png',
				),
				'default'    => 'header-one'
			),
			array(
				'id'          => 'header-builder',
				'type'        => 'select',
				'title'       => esc_html__('Select Header', 'nextpage'),
				'placeholder' => esc_html__('Select a Header', 'nextpage'),
				'options'     => Nextpage_Function('Functions')->get_header_builder_library(),
				'dependency'  => array('header_style', '==', 'header-builder'),
				'desc'        => esc_html__("You need to create first header from header builder", 'nextpage')

			),

		)
	));

	//
	// layout select
	CSF::createSection($nextpage_group_meta, array(
		'title'  => esc_html__('Page Layout', 'nextpage'),
		'fields' => array(
			array(
				'type'    => 'subheading',
				'content' => esc_html__('Select Page Layout', 'nextpage'),
			),
			array(
				'id'      => $nextpage_prefix . '_layout',
				'type'    => 'image_select',
				'title'   => esc_html__('Select Page Layout', 'nextpage'),
				'options' => array(
					'full-width'    => NEXTPAGE_THEME_OPTIONS_IMG . '/page/D.png',
					'left-sidebar'  => NEXTPAGE_THEME_OPTIONS_IMG . '/page/L.png',
					'right-sidebar' => NEXTPAGE_THEME_OPTIONS_IMG . '/page/R.png',
					'blank'         => NEXTPAGE_THEME_OPTIONS_IMG . '/page/B.png',
				),
				'default' => 'full-width'
			),

		)
	));

	//
	// breadcrumb
	CSF::createSection($nextpage_group_meta, array(
		'title'  => esc_html__('Breadcrumb', 'nextpage'),
		'fields' => array(
			array(
				'type'    => 'subheading',
				'content' => esc_html__('Breadcrumb', 'nextpage'),
			),
			array(
				'id'      => $nextpage_prefix . '_breadcrumb',
				'title'   => esc_html__('Breadcrumb', 'nextpage'),
				'type'    => 'select',
				'options' => array(
					'show' => esc_html__('Show', 'nextpage'),
					'hide' => esc_html__('Hide', 'nextpage'),
				),
				'default' => 'show'
			),
		)

	));

	// Create a section
	CSF::createSection($nextpage_group_meta, array(
		'title'  => esc_html__('Footer Option', 'nextpage'),
		'fields' => array(
			array(
				'id'      => 'footer_type', // footer type
				'type'    => 'button_set',
				'title'   => esc_html__('Footer Style', 'nextpage'),
				'options' => array(
					'premade-footer' => esc_html__('Pre Made Footer', 'nextpage'),
					'footer-builder' => esc_html__('Footer Builder', 'nextpage'),
				),
				'default' => 'premade-footer',
			),
			array(
				'type'       => 'subheading',
				'content'    => esc_html__('Footer Option', 'nextpage'),
				'dependency' => array('footer_type', '==', 'premade-footer'),
			),
			//
			// nav select
			array(
				'id'         => $nextpage_prefix . '_footer_style',
				'type'       => 'image_select',
				'title'      => esc_html__('Select Footer', 'nextpage'),
				'dependency' => array('footer_type', '==', 'premade-footer'),
				'options'    => array(
					'footer-1' => NEXTPAGE_THEME_OPTIONS_IMG . '/footer/footer-01.png',
					'footer-2' => NEXTPAGE_THEME_OPTIONS_IMG . '/footer/footer-02.png',
				),
				'default'    => 'footer-1'
			),
			array(
				'id'          => 'footer-builder-id',
				'type'        => 'select',
				'title'       => esc_html__('Select Footer', 'nextpage'),
				'placeholder' => esc_html__('Select a Footer', 'nextpage'),
				'options'     => Nextpage_Function('Functions')->get_footer_builder_library(),
				'desc'        => esc_html__("You need to create first footer from footer builder", 'nextpage'),
				'dependency'  => array('footer_type', '==', 'footer-builder')
			),
		)
	));
}//endif