<?php

namespace ThemeAtelier\DomainForSale\Admin\Views;

use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleLayout;
use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleMainOptions;
use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleContactForm;
use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleTypography;
use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleShortcode;
use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleStyleOptions;
use ThemeAtelier\DomainForSale\Admin\Framework\Classes\DOMAIN_FOR_SALE;
use ThemeAtelier\DomainForSale\Admin\Views\Metabox\DomainForSaleContentOptions;

if ( ! defined( 'ABSPATH' ) ) {
	die;
} // Cannot access directly.

class DomainForSaleMetaboxes {

	/**
	 * Layout Metabox function.
	 *
	 * @param string $prefix The meta-key for this metabox.
	 * @return void
	 */
	public static function layout_metabox( $prefix ) {
		/**
		 * Preview metabox.
		 *
		 * @param string $prefix The metabox main Key.
		 * @return void
		 */
		DOMAIN_FOR_SALE::createMetabox(
			'dfs_live_preview',
			array(
				'title'             => __( 'Live Preview', 'domain-for-sale' ),
				'post_type'         => 'dfs_template',
				'show_restore'      => false,
				'context'           => 'normal',
			)
		);
		DOMAIN_FOR_SALE::createSection(
			'dfs_live_preview',
			array(
				'fields' => array(
					array(
						'type' => 'preview',
					),
				),
			)
		);
		DOMAIN_FOR_SALE::createMetabox(
			$prefix,
			array(
				'title'        => esc_html__( 'Domain For Sale', 'domain-for-sale' ),
				'post_type'    => 'dfs_template',
				'show_restore' => false,
				'context'      => 'normal',
			)
		);

		DomainForSaleLayout::section( $prefix );
	}

	/**
	 * Option Metabox function
	 *
	 * @param string $prefix The metabox key.
	 * @return void
	 */
	public static function option_metabox( $prefix ) {
		DOMAIN_FOR_SALE::createMetabox(
			$prefix,
			array(
				'title'        => esc_html__( 'View Options', 'domain-for-sale' ),
				'post_type'    => 'dfs_template',
				'show_restore' => false,
				'nav'          => 'inline',
				'theme'        => 'light',
			)
		);

		DomainForSaleMainOptions::options( $prefix );
		DomainForSaleContentOptions::options($prefix);
		DomainForSaleStyleOptions::options( $prefix );
		DomainForSaleTypography::options( $prefix );
	}

	/**
	 * Shortcode Metabox function
	 *
	 * @param string $prefix The metabox key.
	 * @return void
	 */
	public static function shortcode_metabox( $prefix ) {
		DOMAIN_FOR_SALE::createMetabox(
			$prefix,
			array(
				'title'        => esc_html__( 'Domain For Sale', 'domain-for-sale' ),
				'post_type'    => 'dfs_template',
				'context'      => 'side',
				'show_restore' => false,
			)
		);

		DOMAIN_FOR_SALE::createSection(
				$prefix,
				array(
					'fields' => array(
						array(
							'type'  => 'shortcode',
							'shortcode' => 'manage_view',
							'class' => 'domain-for-sale-admin-sidebar',
						),
					),
				)
			);
	}



	/**
	 * Page Builder Metabox function
	 *
	 * @param string $prefix The metabox key.
	 * @return void
	 */
	public static function page_builders_metabox( $prefix ) {
		DOMAIN_FOR_SALE::createMetabox(
			$prefix,
			array(
				'title'        => __( 'Page Builders', 'domain-for-sale' ),
				'post_type'    => 'dfs_template',
				'context'      => 'side',
				'show_restore' => false,
			)
		);

		DOMAIN_FOR_SALE::createSection(
			$prefix,
			array(
				'fields' => array(
					array(
						'type'      => 'shortcode',
						'shortcode' => false,
						'class'     => 'dfs-admin-sidebar',
					),
				),
			)
		);
	}

	/**
	 * Shortcode Metabox function
	 *
	 * @param string $prefix The metabox key.
	 * @return void
	 */
	public static function promotional_metabox( $prefix ) {
		DOMAIN_FOR_SALE::createMetabox(
			$prefix,
			array(
				'title'        => __( 'Additional Features in Pro', 'domain-for-sale' ),
				'post_type'    => 'dfs_template',
				'context'      => 'side',
				'show_restore' => false,
			)
		);

		DOMAIN_FOR_SALE::createSection(
			$prefix,
			array(
				'fields' => array(
					array(
						'type'      => 'shortcode',
						'shortcode' => 'pro_notice',
						'class'     => 'dfs-admin-sidebar',
					),
				),
			)
		);
	}
}
