<?php

/**
 * Views class for Shortcode generator options.
 *
 * @link       https://themeatelier.net
 * @since      1.0.0
 *
 * @package domain-for-sale
 * @subpackage domain-for-sale/src/Admin/Views/DomainForSaleMetaboxMainOptions
 * @author     ThemeAtelier<themeatelierbd@gmail.com>
 */

namespace ThemeAtelier\DomainForSale\Admin\Views\Metabox;

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

class DomainForSaleContentOptions
{
    /**
     * Create Option fields for the setting options.
     *
     * @param string $prefix Option setting key prefix.
     * @return void
     */
    public static function options($prefix)
    {
        // Domain Options
        DOMAIN_FOR_SALE::createSection(
            $prefix,
            array(
                'title'  => esc_html__('Content Options', 'domain-for-sale'),
                'icon'   => 'icofont-ui-settings',
                'fields' => array(
                    array(
                        'id'      => 'dfs_apply_on',
                        'type'    => 'select',
                        'title'   => esc_html__('Apply Landing Page With', 'domain-for-sale'),
                        'default' => 'shortcode',
                        'class'   => 'dfs_apply_on',
                        'options' => array(
                            'shortcode'     => esc_html__('Shortcode', 'domain-for-sale'),
                            'replace_theme' => esc_html__('Replace Theme', 'domain-for-sale'),
                            'single_page'   => esc_html__('Replace Specific Page (Pro)', 'domain-for-sale'),
                            'multi_page'    => esc_html__('Replace Multiple Pages (Pro)', 'domain-for-sale'),
                        ),
                        'attributes' => array(
                            'style' => 'width: 200px;',
                        ),
                        'title_help' => '<div class="domain-for-sale-info-label">' . __('Choose how this template will be applied: Shortcode, Replace Current Theme, or Specific Page(s). Only one template can replace the current theme at a time.', 'domain-for-sale') . '</div><span><b>' . esc_html__('Note:', 'domain-for-sale') . '</b> ' . esc_html__('Shortcode can be pasted into any page/post. Replace Theme replaces your entire theme. Single/Multi pages allow page selection.', 'domain-for-sale') . '</span> <br /> <a class="tooltip_btn_primary" target="_blank" href="' . DOMAIN_FOR_SALE_DEMO_URL . 'docs/all-domains/#content-options?ref=1">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),

                    array(
                        'id'         => 'offer_tag',
                        'type'       => 'text',
                        'title'      => esc_html__('Offer Tag', 'domain-for-sale'),
                        'default'    => esc_html__('Start your bid from {{startingPrice}}', 'domain-for-sale'),
                        'dependency' => array('price_options', '==', 'receive_offers'),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Custom text displayed when offers are enabled.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                        'desc'  => __('<b>Use placeholders:</b> {startingPrice}, {heightPrice} (number only) or {{startingPrice}}, {{heightPrice}} (with currency).', 'domain-for-sale')
                    ),

                    array(
                        'id'         => 'price_tag',
                        'type'       => 'text',
                        'title'      => esc_html__('Price Tag', 'domain-for-sale'),
                        'default'    => esc_html__('Price {{price}} Only', 'domain-for-sale'),
                        'dependency' => array('price_options', '==', 'fixed_price'),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Custom text displayed when fixed price is enabled.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                        'desc'  => __('<b>Use placeholders:</b> {price} (number only) or {{price}} (with currency).', 'domain-for-sale')
                    ),

                    array(
                        'id'         => 'sale_title',
                        'type'       => 'text',
                        'title'      => esc_html__('Sale Title', 'domain-for-sale'),
                        'default'    => esc_html__('is for sale', 'domain-for-sale'),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('The title text displayed under your domain name, e.g., "is for sale".', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),

                    array(
                        'id'         => 'sale_content',
                        'type'       => 'wp_editor',
                        'title'      => esc_html__('Sale Content', 'domain-for-sale'),
                        'default'    => esc_html__('The domain name (without content) is available for sale by its owner. Any offer you submit is binding for 7 days. If you require further information, contact me.', 'domain-for-sale'),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Main description text shown on the sale page. You can include custom HTML or formatting.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),

                    array(
                        'id'         => 'contact_title',
                        'type'       => 'text',
                        'title'      => esc_html__('Contact Title', 'domain-for-sale'),
                        'default'    => esc_html__('Contact Info:', 'domain-for-sale'),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Heading displayed above the contact information list.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),

                    array(
                        'id'      => 'contact_infos',
                        'type'    => 'repeater',
                        'title'   => esc_html__('Contact Information\'s', 'domain-for-sale'),
                        'max'     => '1',
                        'fields'  => array(
                            array(
                                'id'    => 'contactinfos-icon',
                                'type'  => 'icon',
                                'title' => esc_html__('Icon for contact info', 'domain-for-sale'),
                            ),
                            array(
                                'id'    => 'contactinfos-text',
                                'type'  => 'text',
                                'title' => esc_html__('Contact info', 'domain-for-sale'),
                            ),
                        ),
                        'default' => array(
                            array(
                                'contactinfos-icon' => 'icofont-envelope',
                                'contactinfos-text' => get_option('admin_email'),
                            ),
                            array(
                                'contactinfos-icon' => 'icofont-phone',
                                'contactinfos-text' => esc_html__('(345) 456 789 23', 'domain-for-sale'),
                            ),
                        ),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Add one or more contact details (email, phone, etc.) with icons to display on the sale page.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),

                    array(
                        'id'         => 'more_domain_title',
                        'type'       => 'text',
                        'title'      => esc_html__('More Domain Title', 'domain-for-sale'),
                        'default'    => esc_html__('More Domains', 'domain-for-sale'),
                        'dependency' => array('dfs_layout_preset', '==', 'layout_02', 'any'),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Heading for the recommended/more domains section. Only visible in Layout 02.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),

                    array(
                        'id'         => 'more_domains',
                        'type'       => 'group',
                        'title'      => esc_html__('Recommended Domain', 'domain-for-sale'),
                        'dependency' => array('dfs_layout_preset', '==', 'layout_02', 'any'),
                        'fields'     => array(
                            array(
                                'id'         => 'moredomains-title',
                                'type'       => 'text',
                                'title'      => esc_html__('Domain name', 'domain-for-sale'),
                                'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Enter the domain name you want to showcase in this section.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                            ),
                            array(
                                'id'         => 'moredomains-link',
                                'type'       => 'link',
                                'title'      => esc_html__('Domain link', 'domain-for-sale'),
                                'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Provide the URL where users can visit or inquire about this domain.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                            ),
                            array(
                                'id'         => 'moredomains-content',
                                'type'       => 'textarea',
                                'title'      => esc_html__('About domain', 'domain-for-sale'),
                                'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Write a brief description or details about the domain to help potential buyers understand its value.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                            ),
                        ),
                        'default' => array(
                            array(
                                'moredomains-title'   => 'www.firstdomain.com',
                                'moredomains-link'    => '',
                                'moredomains-content' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum nihil consequatur aspernatur ipsum facere neque distinctio fugit voluptatum laborum odit eveniet saepe culpa sit dolor ea fugiat officiis, debitis magni.', 'domain-for-sale'),
                            ),
                            array(
                                'moredomains-title'   => 'www.seconddomain.com',
                                'moredomains-link'    => '',
                                'moredomains-content' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum nihil consequatur aspernatur ipsum facere neque distinctio fugit voluptatum laborum odit eveniet saepe culpa sit dolor ea fugiat officiis, debitis magni.', 'domain-for-sale'),
                            ),
                            array(
                                'moredomains-title'   => 'www.thirddomain.com',
                                'moredomains-link'    => '',
                                'moredomains-content' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum nihil consequatur aspernatur ipsum facere neque distinctio fugit voluptatum laborum odit eveniet saepe culpa sit dolor ea fugiat officiis, debitis magni.', 'domain-for-sale'),
                            ),
                        ),
                        'title_help' => '<div class="domain-for-sale-info-label">' . esc_html__('Add a list of additional/recommended domains with name, link, and description. Visible only in Layout 02.', 'domain-for-sale') . '</div> <a class="tooltip_btn_primary" target="_blank" href="' . esc_url(DOMAIN_FOR_SALE_DEMO_URL . 'docs/main-options/?ref=1') . '">' . esc_html__('Open Docs', 'domain-for-sale') . '</a>',
                    ),
                )
            )
        );
    }
}
