<?php

/**
 * The Advanced setting configurations.
 *
 * @package domain-for-sale
 * @subpackage domain-for-sale/admin
 */

namespace ThemeAtelier\DomainForSale\Admin\Views\Settings;

use ThemeAtelier\DomainForSale\Admin\Framework\Classes\DOMAIN_FOR_SALE;

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

/**
 * The Layout building class.
 */
class DomainForSaleAdvanced
{

	/**
	 * Advanced setting section.
	 *
	 * @param string $prefix The settings.
	 * @return void
	 */
	public static function section($prefix)
	{
		DOMAIN_FOR_SALE::createSection(
			$prefix,
			array(
				'title'  => esc_html__('Advanced', 'domain-for-sale'),
				'icon'   => 'icofont-database',
				'fields' => array(
					array(
						'id'  => 'dfs-custom-css',
						'type'  => 'code_editor',
						'title' => esc_html__('Custom CSS', 'domain-for-sale'),
						'settings' => array(
							'theme' => 'mbo',
							'mode'  => 'css',
						),
						'title_help' =>
						'<div class="domain-for-sale-info-label">'
							. esc_html__('Add your own CSS rules here to style the domain for sale page without modifying theme files.', 'domain-for-sale') .
							'</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/advanced/?ref=1') . '">'
							. esc_html__('Open Docs', 'domain-for-sale') . '</a>',
					),

					array(
						'id'  => 'dfs-custom-js',
						'type'  => 'code_editor',
						'title' => esc_html__('Custom JavaScript', 'domain-for-sale'),
						'settings' => array(
							'theme' => 'mbo',
							'mode'  => 'js',
						),
						'title_help' =>
						'<div class="domain-for-sale-info-label">'
							. esc_html__('Insert custom JavaScript for extra functionality or tracking. Be careful — incorrect code may break the site.', 'domain-for-sale') .
							'</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/advanced/?ref=1') . '">'
							. esc_html__('Open Docs', 'domain-for-sale') . '</a>',
					),

					array(
						'id'      => 'cleanup_data_deletion',
						'type'    => 'checkbox',
						'title'   => esc_html__('Clean-up Data on Deletion', 'domain-for-sale'),
						'title_help' =>
						'<div class="domain-for-sale-info-label">'
							. esc_html__('Enable this option if you want the plugin to completely remove all its data when uninstalled. Use with caution — this cannot be undone.', 'domain-for-sale') .
							'</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/advanced/?ref=1') . '">'
							. esc_html__('Open Docs', 'domain-for-sale') . '</a>',
					),
				),
			)
		);
	}
}
