Your IP : 216.73.216.0


Current Path : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/
Upload File :
Current File : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/Service.php

<?php

namespace Layerdrops\Zeinet\Widgets;


class Service extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'zeinet-service';
    }

    public function get_title()
    {
        return __('Service', 'zeinet-addon');
    }

    public function get_icon()
    {
        return 'eicon-cogs';
    }

    public function get_categories()
    {
        return ['zeinet-category'];
    }

    protected function register_controls()
    {
        $this->start_controls_section(
            'layout_section',
            [
                'label' => __('Layout', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'zeinet-addon'),
                    'layout_two' => __('Layout Two', 'zeinet-addon'),
                    'layout_three' => __('Layout Three', 'zeinet-addon'),
                ]
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'content_section',
            [
                'label' => __('Content', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                'condition'   => [
                    'layout_type' => 'layout_one'
                ]
            ]
        );

        $service_item = new \Elementor\Repeater();

        $service_item->add_control(
            'title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => wp_kses(__('Fiber <br> Broadband', 'zeinet-addon'), 'zeinet_allowed_tags'),
                'label_block' => true,
            ]
        );

        $service_item->add_control(
            'url',
            [
                'label' => __('Url', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::URL,
                'placeholder' => __('#', 'zeinet-addon'),
                'show_external' => false,
                'default' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => true,
                ],
                'show_label' => false,
            ]
        );

        $service_item->add_control(
            'content',
            [
                'label' => __('Content', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Awesome Content', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $service_item->add_control(
            'icon',
            [
                'label' => __('Icon', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-wifi-router',
                    'library' => 'custom-icon',
                ],
            ]
        );

        $service_item->add_control(
            'bg',
            [
                'label' => __('Background Image', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->add_control(
            'service_item',
            [
                'label' => __('Service Items', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $service_item->get_controls(),
                'prevent_empty' => false,
                'title_field' => '{{{ title }}}',
            ]
        );


        $this->end_controls_section();

        //layout_two
        $this->start_controls_section(
            'layout_two_content_section',
            [
                'label' => __('Content', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                'condition'   => [
                    'layout_type' => 'layout_two'
                ]
            ]
        );

        $this->add_control(
            'layout_two_sec_title',
            [
                'label' => __('Section Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Awesome Title', 'zeinet-addon'),
            ]
        );

        $this->add_control(
            'layout_two_sec_sub_title',
            [
                'label' => __('Section Sub Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Awesome  sub title', 'zeinet-addon'),
            ]
        );

        $this->add_control(
            'layout_two_summary_text',
            [
                'label' => __('Summary Text', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Default Summary Text', 'zeinet-addon'),
            ]
        );

        $layout_two_service_item = new \Elementor\Repeater();

        $layout_two_service_item->add_control(
            'title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Smart TV', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_two_service_item->add_control(
            'content',
            [
                'label' => __('Content', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Awesome Content', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_two_service_item->add_control(
            'icon',
            [
                'label' => __('Icon', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-tv-box',
                    'library' => 'custom-icon',
                ],
            ]
        );

        $layout_two_service_item->add_control(
            'url',
            [
                'label' => __('Url', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::URL,
                'placeholder' => __('#', 'zeinet-addon'),
                'show_external' => false,
                'default' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => true,
                ],
                'show_label' => false,
            ]
        );

        $layout_two_service_item->add_control(
            'image',
            [
                'label' => __('Image', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->add_control(
            'layout_two_service_item',
            [
                'label' => __('Service Items', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_two_service_item->get_controls(),
                'prevent_empty' => false,
                'default' => [
                    [
                        'title' => __('Smart TV', 'zeinet-addon'),
                    ],
                ],
                'title_field' => '{{{ title }}}',
            ]
        );

        $this->add_control(
            'layout_two_shape_one',
            [
                'label' => __('Shapes One', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->add_control(
            'layout_two_shape_two',
            [
                'label' => __('Shapes Two', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->end_controls_section();

        //layout_three
        $this->start_controls_section(
            'layout_three_content_section',
            [
                'label' => __('Content', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                'condition'   => [
                    'layout_type' => 'layout_three'
                ]
            ]
        );


        $layout_three_service_item = new \Elementor\Repeater();

        $layout_three_service_item->add_control(
            'title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Smart TV', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_three_service_item->add_control(
            'content',
            [
                'label' => __('Content', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Awesome Content', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_three_service_item->add_control(
            'icon',
            [
                'label' => __('Icon', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-tv-box',
                    'library' => 'custom-icon',
                ],
            ]
        );

        $layout_three_service_item->add_control(
            'url',
            [
                'label' => __('Url', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::URL,
                'placeholder' => __('#', 'zeinet-addon'),
                'show_external' => false,
                'default' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => true,
                ],
                'show_label' => false,
            ]
        );

        $layout_three_service_item->add_control(
            'image',
            [
                'label' => __('Image', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->add_control(
            'layout_three_service_item',
            [
                'label' => __('Service Items', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_three_service_item->get_controls(),
                'prevent_empty' => false,
                'default' => [
                    [
                        'title' => __('Smart TV', 'zeinet-addon'),
                    ],
                ],
                'title_field' => '{{{ title }}}',
            ]
        );


        $this->end_controls_section();

        //General style
        $this->start_controls_section(
            'general_style',
            [
                'label' => esc_html__('Style Options', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_two']);
        zeinet_typo_and_color_options($this, 'Section Sub Title', '.section-title__tagline', ['layout_two']);
        zeinet_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .services-one__top-tex', ['layout_two']);

        zeinet_typo_and_color_options($this, 'Service Title', '{{WRAPPER}} .feature-one__title a,{{WRAPPER}} .services-one__title a,{{WRAPPER}} .services-one__title a', ['layout_one', 'layout_two', 'layout_three']);

        zeinet_typo_and_color_options($this, 'Service Content', '{{WRAPPER}} .feature-one__text,{{WRAPPER}} .services-one__text,{{WRAPPER}} .services-one__text', ['layout_one', 'layout_two', 'layout_three']);

        $this->end_controls_section();

        zeinet_get_elementor_carousel_options($this, ['layout_three']);
    }


    protected function render()
    {
        $settings = $this->get_settings_for_display();
        include zeinet_get_template('service-one.php');
        include zeinet_get_template('service-two.php');
        include zeinet_get_template('service-three.php');
    }
}