<?php

/**
 * @author : Webforia Studio
 */

namespace Retheme\Customizer;

use Retheme\Customizer_Base;

class Connect extends Customizer_Base {

    public function __construct() {
        $this->set_section();
        $this->add_socmed();
        $this->add_share();
    }

    public function set_section() {

        $this->add_panel('connect', [
            'title' => __('Connect', 'jelajah-text'),
        ]);

        $this->add_section('social', [
            'title'       => __('Social Media', 'jelajah-text'),
            'panel'       => 'connect',
        ]);

        $this->add_section('share', [
            'title'       => __('Share', 'jelajah-text'),
            'panel'       => 'connect',
        ]);
    }

    public function add_socmed() {

        $section = 'social';

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_facebook',
            'label' => __('Facebook', 'jelajah-text'),
            'default' => '#',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_instagram',
            'label' => __('Instagram', 'jelajah-text'),
            'default' => '#',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_youtube',
            'label' => __('Youtube', 'jelajah-text'),
            'default' => '#',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_twitter',
            'label' => __('Twitter', 'jelajah-text'),
            'default' => '#',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_pinterest',
            'label' => __('Pinterest', 'jelajah-text'),
            'default' => '#',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_tiktok',
            'label' => __('Tiktok', 'jelajah-text'),
            'default' => '#',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_github',
            'label' => __('GitHub', 'jelajah-text'),
            'default' => '',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_gitlab',
            'label' => __('GitLab', 'jelajah-text'),
            'default' => '',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_behance',
            'label' => __('Behance', 'jelajah-text'),
            'default' => '',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_dribbble',
            'label' => __('Dribbble', 'jelajah-text'),
            'default' => '',
            'section' => $section,
        ]);

        $this->add_field([
            'type' => 'link',
            'settings' => 'socmed_linkedin',
            'label' => __('LinkedIn', 'jelajah-text'),
            'default' => '',
            'section' => $section,
        ]);
    }

    public function add_share() {
        $section = 'share';

        $this->add_field([
            'type' => 'toggle',
            'settings' => 'connect_share_facebook',
            'label' => __('Facebook', 'jelajah-text'),
            'section' => $section,
            'default' => true,
        ]);
        $this->add_field([
            'type' => 'toggle',
            'settings' => 'connect_share_twitter',
            'label' => __('Twitter', 'jelajah-text'),
            'section' => $section,
            'default' => true,
        ]);

        $this->add_field([
            'type' => 'toggle',
            'settings' => 'connect_share_pinterest',
            'label' => __('Pinterest', 'jelajah-text'),
            'section' => $section,
            'default' => true,
        ]);

        $this->add_field([
            'type' => 'toggle',
            'settings' => 'connect_share_email',
            'label' => __('Email', 'jelajah-text'),
            'section' => $section,
            'default' => true,
        ]);

        if (rt_is_premium()) {
            $this->add_field([
                'type' => 'toggle',
                'settings' => 'connect_share_whatsapp',
                'label' => __('WhatsApp', 'jelajah-text'),
                'section' => $section,
                'default' => true,
            ]);
        }
    }

    // end class
}

new Connect;
