<?php
/*
 * Theme Metabox
 * @package Ethrik
 * @since 1.0.0
 * */

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

if (class_exists('CSF')) {

	$prefix = 'ethrik';

	/*-------------------------------------
		Category Taxonomy Options
	-------------------------------------*/

	// Create taxonomy options
	CSF::createTaxonomyOptions($prefix, array(
		'title'     => esc_html__('Catgeory Options', 'ethrik'),
		'taxonomy'  => 'category',
		'data_type' => 'serialize', // The type of the database save options. `serialize` or `unserialize`
	));

	//
	// Create a section
	CSF::createSection($prefix, array(
		'fields' => array(

			array(

				'id'          => 'cat-color',
				'type'        => 'color',
				'title'       => esc_html__('Select Category Color', 'ethrik'),
				'default' => '#0073FF',

			),

			array(

				'id'          => 'catbg-color',
				'type'        => 'color',
				'title'       => esc_html__('Select Category Background Color', 'ethrik'),
				'default' => '#0073ff1a',

			),

			array(
				'id'    => 'cat-bg',
				'type'  => 'upload',
				'title' => esc_html__('Upload', 'ethrik'),
			),
		)
	));


	/*-------------------------------------
		Post Format Options
	-------------------------------------*/
	CSF::createMetabox('theme_postvideo_options', array(
		'title' => esc_html__('Video Post Format Options', 'ethrik'),
		'post_type' => 'post',
		'post_formats' => 'video',
		'data_type'          => 'serialize',
		'context'            => 'advanced',
		'priority'           => 'default',
	));

	CSF::createSection('theme_postvideo_options', array(
		'fields' => array(
			array(
				'id' => 'textm',
				'type' => 'text',
				'title' => esc_html__('Upload Video For Post', 'ethrik'),
				'desc' => esc_html__('Upload Video Post', 'ethrik'),
			)
		)
	));


	/*-------------------------------------
       Page Options
   -------------------------------------*/
	$post_metabox = 'ethrik_post_meta';

	CSF::createMetabox($post_metabox, array(
		'title'     => esc_html__('Page Options', 'ethrik'),
		'post_type' => 'page',
	));

	//
	// Create a section
	CSF::createSection($post_metabox, array(
		'title'  => 'Nav Menu Option',
		'fields' => array(
			array(
				'type'    => 'subheading',
				'content' => esc_html__('Nav Menu Option', 'ethrik'),
			),
			//

			array(
				'id' => 'nav_menu',
				'type' => 'image_select',
				'title' => esc_html__('Select Header Navigation Style', 'ethrik'),
				'options' => array(
					'nav-style-one' => ETHRIK_IMG . '/admin/header-style/style1.png',
					'nav-style-two' => ETHRIK_IMG . '/admin/header-style/style2.png',
				),
				'default' => 'nav-style-one'
			),


			array(
				'id' => 'page_title_enable',
				'title' => esc_html__('Show Page Title', 'ethrik'),
				'type' => 'switcher',
				'default' => true,
				'desc' => esc_html__('Show Page Title Bar', 'ethrik'),
			),


			array(
				'id' => 'page-spacing-padding',
				'type' => 'spacing',
				'title' => esc_html__('Theme Page Spacing', 'ethrik'),
				'output' => 'body.page .main-container',
				'output_mode' => 'padding', // or margin, relative
				'default' => array(
					'top' => '80',
					'right' => '0',
					'bottom' => '80',
					'left' => '0',
					'unit' => 'px',
				),
			),
		)
	));

	/*-------------------------------------
       Post Options
   -------------------------------------*/
	$single_blog_metabox = 'ethrik_blog_post_meta';

	CSF::createMetabox($single_blog_metabox, array(
		'title'     => esc_html__('Post Options', 'ethrik'),
		'post_type' => 'post',
	));

	//
	// Create a section
	CSF::createSection($single_blog_metabox, array(
		'title'  => esc_html__('Single Post Layout Option', 'ethrik'),
		'fields' => array(
			array(
				'type'    => 'subheading',
				'content' => esc_html__('Single Post Layout Option', 'ethrik'),
			),
			//

			array(
				'id' => 'ethrik_single_blog_layout',
				'type' => 'image_select',
				'title' => esc_html__('Select Single Blog Style', 'ethrik'),
				'options' => array(
					'single-one' => ETHRIK_IMG . '/admin/page/blog-1.png',
					'single-two' => ETHRIK_IMG . '/admin/page/blog-2.png',
				),
				'default' => 'single-one'
			),

		)
	));

	/*-------------------------------------
       NFT Options
   	-------------------------------------*/
	$single_nft_metabox = 'ethrik_nft_single_meta';

	CSF::createMetabox('ethrik_nft_single_meta', array(
		'title'     => esc_html__('NFT Item Options', 'ethrik'),
		'post_type' => 'nft',
		'data_type'          => 'serialize',
		'context'            => 'advanced',
		'priority'           => 'default',
	));

	//
	// Create a section
	CSF::createSection('ethrik_nft_single_meta', array(

		'fields' => array(

			array(
				'id'      => 'nft-owner',
				'type'    => 'text',
				'title'   => 'Owner Name',
				'default' => 'Simple User'
			),

			array(
				'id' => 'nft-owner-thumb',
				'type' => 'media',
				'title' => 'Upload NFT Owner Thumb',
				'library' => 'image',
			),

			array(
				'id'      => 'nft-ends-text',
				'type'    => 'text',
				'title'   => 'NFT Sale ends info date',
				'default' => 'Sale ends'
			),


			array(
				'type'    => 'subheading',
				'content' => esc_html__('NFT Pricing', 'ethrik'),
			),


			array(
				'id'      => 'nft-price-eth',
				'type'    => 'text',
				'title'   => 'Insert NFT Pricing in ETH Cryptocurrency',
				'default' => '12.88 ETH'
			),

			array(
				'id'      => 'nft-price-usd',
				'type'    => 'text',
				'title'   => 'Insert NFT Pricing in USD',
				'default' => '$12500'
			),

			array(
				'id'      => 'nft-time-left',
				'type'    => 'text',
				'title'   => 'Set Time Left',
				'default' => '14 hours left'
			),

			array(
				'id'      => 'nft-place-bid-text',
				'type'    => 'text',
				'title'   => 'Place Bid Button Text',
				'default' => 'Place a bid'
			),

			array(
				'id' => 'nft-place-bid-link',
				'type' => 'link',
				'title' => 'Place Bid Button Link',
				'add_title' => 'Add Link',
				'edit_title' => 'Edit Link',
				'remove_title' => 'Remove Link',
			),


			array(
				'type'    => 'subheading',
				'content' => esc_html__('NFT Buttons', 'ethrik'),
			),


			array(
				'id'      => 'nft-buy-btn-text',
				'type'    => 'text',
				'title'   => 'Buy Now Button Text',
				'default' => 'Buy Now',
			),

			array(
				'id' => 'nft-buy-btn-link',
				'type' => 'link',
				'title' => 'Buy Now Button Link',
				'add_title' => 'Add Link',
				'edit_title' => 'Edit Link',
				'remove_title' => 'Remove Link',
			),

			array(
				'id'      => 'nft-offer-btn-text',
				'type'    => 'text',
				'title'   => 'Make Offer Button Text',
				'default' => 'Make Offer',
			),

			array(
				'id' => 'nft-offer-btn-link',
				'type' => 'link',
				'title' => 'Make Offer Button Link',
				'add_title' => 'Add Link',
				'edit_title' => 'Edit Link',
				'remove_title' => 'Remove Link',
			),

			array(
				'type'    => 'subheading',
				'content' => esc_html__('NFT Highest Bid Amount Box', 'ethrik'),
			),

			array(
				'id'      => 'nft-high-bid',
				'type'    => 'text',
				'title'   => 'Insert NFT Highest Bid Amount in ETH',
				'default' => '16.22 ETH'
			),
		)
	));
}
