%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/
Upload File :
Create Path :
Current File : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/Features.php

<?php

namespace Layerdrops\Insur\Widgets;


class Features extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'insur-features';
    }

    public function get_title()
    {
        return __('Features', 'insur-addon');
    }

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

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

    protected function register_controls()
    {

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

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

        $this->end_controls_section();

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

        $features = new \Elementor\Repeater();

        $features->add_control(
            'title',
            [
                'label' => __('Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Safe your money', 'insur-addon'),
                'label_block' => true,
            ]
        );

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

        $features->add_control(
            'summary',
            [
                'label' => __(' Summary', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Lorem ipsum dolor amet consectetur adipiscing elit do eiusmod tempor incid idunt ut labore.', 'insur-addon'),
                'label_block' => true,
            ]
        );

        $features->add_control(
            'icon',
            [
                'label' => __('Icon', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-insurance',
                    'library' => 'custom-icon',
                ],
            ]
        );

        $features->add_control(
            'bg_shape',
            [
                'label' => __('Background Shape ', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

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

        $this->end_controls_section();


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

        $layout_two_features = new \Elementor\Repeater();

        $layout_two_features->add_control(
            'title',
            [
                'label' => __('Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => wp_kses(__('Cash flow <br> management', 'insur-addon'), 'insur_allowed_tags'),
                'label_block' => true,
            ]
        );

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


        $layout_two_features->add_control(
            'icon',
            [
                'label' => __('Icon', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-cash-flow',
                    'library' => 'custom-icon',
                ],
            ]
        );

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

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

        $this->end_controls_section();

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

        $layout_three_features = new \Elementor\Repeater();

        $layout_three_features->add_control(
            'title',
            [
                'label' => __('Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => wp_kses(__('Get all claims at <br> anytime', 'insur-addon'), 'insur_allowed_tags'),
                'label_block' => true,
            ]
        );

        $layout_three_features->add_control(
            'sub_title',
            [
                'label' => __('Sub Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('LOREM IPSUM', 'insur-addon'),
                'label_block' => true,
            ]
        );


        $layout_three_features->add_control(
            'icon',
            [
                'label' => __('Icon', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'default' => [
                    'value' => 'icon-contract',
                    'library' => 'custom-icon',
                ],
            ]
        );



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

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

        $this->end_controls_section();

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

        insur_typo_and_color_options($this, 'Title', '{{WRAPPER}} .feature-one__title a,{{WRAPPER}} .feature-two__text a,{{WRAPPER}}  .feature-three__title', ['layout_one', 'layout_two', 'layout_three']);
        insur_typo_and_color_options($this, 'Sub Title', '{{WRAPPER}} .feature-three__sub-title', ['layout_three']);
        insur_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .feature-one__text', ['layout_one']);

        $this->end_controls_section();
    }

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

Zerion Mini Shell 1.0