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

<?php

namespace Layerdrops\Insur\Widgets;


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

    public function get_title()
    {
        return __('Blog', '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'),
                    'layout_four' => __('Layout Four', 'insur-addon'),
                    'layout_five' => __('Layout Five', 'insur-addon'),
                ]
            ]
        );



        $this->add_control(
            'pagination_status',
            [
                'label' => __('Enable Pagination?', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __('Yes', 'insur-addon'),
                'label_off' => __('No', 'insur-addon'),
                'return_value' => 'yes',
                'default' => 'no',
            ]
        );


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

        $this->add_control(
            'sec_sub_title',
            [
                'label' => __('Sub Title', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Sub Title', 'insur-addon'),
                'default' => __('Default Sub Title', 'insur-addon'),
                'condition' => [
                    'layout_type' =>  ['layout_one', 'layout_two', '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_one', 'layout_two', '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_one', 'layout_two', 'layout_three']
                ]
            ]
        );

        $this->end_controls_section();

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


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

        $this->add_control(
            'post_word_count',
            [
                'label' => __('Word Count In Excerpt', 'insur-addon'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['count'],
                'range' => [
                    'count' => [
                        'min' => 1,
                        'max' => 200,
                        'step' => 1,
                    ],
                ],
                'default' => [
                    'unit' => 'count',
                    'size' => 11,
                ],
            ]
        );

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

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

        insur_typo_and_color_options($this, 'Title', '{{WRAPPER}} .news-one__title a,{{WRAPPER}} .news-two__title a,{{WRAPPER}} .news-three__title a', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
        insur_typo_and_color_options($this, 'Category', '{{WRAPPER}} .news-one__tag p,{{WRAPPER}} .news-two__tag p', ['layout_one', 'layout_two', 'layout_four', 'layout_five']);
        insur_typo_and_color_options($this, 'Meta', '{{WRAPPER}} .news-one__meta li a', ['layout_one']);
        insur_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .news-one__text', ['layout_one', 'layout_four', 'layout_five']);
        insur_typo_and_color_options($this, 'Read More', '{{WRAPPER}} .news-one__read-more a', ['layout_one', 'layout_four', 'layout_five']);

        insur_typo_and_color_options($this, 'Author', '{{WRAPPER}} .news-two__client-content p,{{WRAPPER}} .news-three__client-content p a,{{WRAPPER}} .news-three__client-content p ', ['layout_two', 'layout_three']);
        insur_typo_and_color_options($this, 'Date', '{{WRAPPER}} .news-two__client-content h5,{{WRAPPER}} .news-three__client-content h5', ['layout_two', 'layout_three']);

        $this->end_controls_section();

        insur_get_elementor_carousel_options($this, ['layout_five']);
    }

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

Zerion Mini Shell 1.0