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

<?php

namespace Layerdrops\Insur\Widgets;


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

    public function get_title()
    {
        return __('Portfolio', '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(
            'content_section',
            [
                'label' => __('Content', 'insur-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'sec_title',
            [
                'label' => __('Section Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Title', 'insur-addon'),
                'default' => __('Awesome Title', 'insur-addon'),
                'condition'   => [
                    'layout_type' => 'layout_three'
                ]
            ]
        );

        $this->add_control(
            'sec_sub_title',
            [
                'label' => __('Section Sub Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Sub Title', 'insur-addon'),
                'default' => __('Awesome Sub Title', 'insur-addon'),
                'condition'   => [
                    'layout_type' => 'layout_three'
                ]
            ]
        );

        $this->add_control(
            'sub_title_left_shape',
            [
                'label' => __('Sub Title Left Shape', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
                'condition'   => [
                    'layout_type' => 'layout_three'
                ]
            ]
        );

        $this->add_control(
            'sub_title_right_shape',
            [
                'label' => __('Sub Title Right Shape', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
                'condition'   => [
                    'layout_type' => 'layout_three'
                ]
            ]
        );

        $this->add_control(
            'post_count',
            [
                'label' => __('Number Of Posts', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['count'],
                'range' => [
                    'count' => [
                        'min' => 0,
                        'max' => 12,
                        'step' => 1,
                    ],
                ],
                'default' => [
                    'unit' => 'count',
                    'size' => 6,
                ],
            ]
        );

        $this->add_control(
            'select_category',
            [
                'label' => __('Post Category', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'options' => insur_get_taxonoy('portfolio_cat'),
                'multiple' => true
            ]
        );


        $this->add_control(
            'query_order',
            [
                'label' => __('Select Order', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'DESC',
                'options' => [
                    'DESC' => __('DESC', 'insur-addon'),
                    'ASC' => __('ASC', 'insur-addon'),
                ]
            ]
        );

        $this->add_control(
            'show_filter',
            [
                'label' => __('Enable Filter', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __('Show', 'insur-addon'),
                'label_off' => __('Hide', 'insur-addon'),
                'return_value' => 'yes',
                'default' => 'yes',
                'condition' => [
                    'layout_type' => 'layout_one'
                ]
            ]
        );

        $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, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_three']);
        insur_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-sub-title', ['layout_three']);

        insur_typo_and_color_options($this, 'Filter Button', '{{WRAPPER}} .portfolio-filter.style1 li .filter-text', ['layout_one']);

        insur_typo_and_color_options($this, 'Title', '{{WRAPPER}} .portfolio__title a', ['layout_one', 'layout_two', 'layout_three']);
        insur_typo_and_color_options($this, 'Category', '{{WRAPPER}} .portfolio__sub-title', ['layout_one', 'layout_two', 'layout_three']);

        $this->end_controls_section();

        insur_get_elementor_carousel_options($this, ['layout_two', 'layout_three']);
    }

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

Zerion Mini Shell 1.0