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/MovieDetails.php

<?php

namespace Layerdrops\Zeinet\Widgets;


class MovieDetails extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'zeinet-movie-details';
    }

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

        $this->add_control(
            'title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Title', 'zeinet-addon'),
                'default' => __('Default Title', 'zeinet-addon'),
            ]
        );

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

        $this->add_control(
            'year_duration',
            [
                'label' => __('Year And Duration', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('2022 / 2 h 30 min ', 'zeinet-addon'),
            ]
        );

        $info_box = new \Elementor\Repeater();

        $info_box->add_control(
            'info',
            [
                'label' => __('Info', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('4k', 'zeinet-addon'),
                'label_block' => false,
            ]
        );

        $this->add_control(
            'info_box',
            [
                'label' => __('Info Box', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $info_box->get_controls(),
                'prevent_empty' => false,
            ]
        );


        $feature_list = new \Elementor\Repeater();

        $feature_list->add_control(
            'title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Cast:', 'zeinet-addon'),
                'label_block' => false,
            ]
        );

        $feature_list->add_control(
            'content',
            [
                'label' => __('Content', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('John Smith, Christine Eve', 'zeinet-addon'),
                'label_block' => false,
            ]
        );

        $this->add_control(
            'feature_list',
            [
                'label' => __('Feature List', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $feature_list->get_controls(),
                'prevent_empty' => false,
            ]
        );

        $this->add_control(
            'button_one_label',
            [
                'label' => __('Button One Text', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Watch movie', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

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

        $this->add_control(
            'button_one_video',
            [
                'label' => __('Enable Video Popup?', 'zeinet-addon'),
                'description' => __('If you want to show vidoe on button click please make this yes.', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __('Yes', 'zeinet-addon'),
                'label_off' => __('No', 'zeinet-addon'),
                'return_value' => 'yes',
                'default' => 'no',
            ]
        );

        $this->add_control(
            'button_two_label',
            [
                'label' => __('Button Two Text', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Watch movie', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

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

        $this->add_control(
            'button_two_video',
            [
                'label' => __('Enable Video Popup?', 'zeinet-addon'),
                'description' => __('If you want to show vidoe on button click please make this yes.', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __('Yes', 'zeinet-addon'),
                'label_off' => __('No', 'zeinet-addon'),
                'return_value' => 'yes',
                'default' => 'no',
            ]
        );
        $this->add_control(
            'image',
            [
                'label' => __('Image', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [],
            ]
        );

        $this->end_controls_section();

        $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(
            'video_title',
            [
                'label' => __('Video Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Play trailer', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $this->add_control(
            'video_url',
            [
                'label' => __('Video Url', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('#', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

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

        $this->add_control(
            'gallery_title',
            [
                'label' => __('Gallery Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Photos', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_two_gallery = new \Elementor\Repeater();

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


        $this->add_control(
            'layout_two_gallery',
            [
                'label' => __('Gallery', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_two_gallery->get_controls(),
                'prevent_empty' => false,
            ]
        );

        $this->end_controls_section();

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

        $this->add_control(
            'layout_three_title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Top cast', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_three_cast_item = new \Elementor\Repeater();

        $layout_three_cast_item->add_control(
            'name',
            [
                'label' => __('name', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Millie Brown', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $layout_three_cast_item->add_control(
            'designation',
            [
                'label' => __('Designation', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('as Eleven', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

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


        $this->add_control(
            'layout_three_cast_item',
            [
                'label' => __('Cast Item', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_three_cast_item->get_controls(),
                'prevent_empty' => false,
            ]
        );

        $this->add_control(
            'layout_three_bottom_title',
            [
                'label' => __('Bottom Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __('Storyline', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $this->add_control(
            'layout_three_bottom_content',
            [
                'label' => __('Bottom Content', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('Default Text', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

        $this->end_controls_section();

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


        $this->add_control(
            'layout_four_title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'default' => __('More like this', 'zeinet-addon'),
                'label_block' => true,
            ]
        );

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

        $this->add_control(
            'select_category',
            [
                'label' => __('Select Category', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'options' => zeinet_get_taxonoy('movie_cat'),
            ]
        );


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

        $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, 'Title', '{{WRAPPER}} .movie-top__title,{{WRAPPER}} .top-cast__title', ['layout_one', 'layout_three']);

        zeinet_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .movie-top__text-2', ['layout_one']);

        zeinet_typo_and_color_options($this, 'Button One', '{{WRAPPER}} .movie-top__btn-1', ['layout_one']);
        zeinet_typo_and_color_options($this, 'Button One Background', '{{WRAPPER}} .movie-top__btn-1', ['layout_one'], 'background-color', false);

        zeinet_typo_and_color_options($this, 'Button Two', '{{WRAPPER}} .movie-top__btn-2', ['layout_one']);
        zeinet_typo_and_color_options($this, 'Button Two Background', '{{WRAPPER}} .movie-top__btn-2', ['layout_one'], 'background-color', false);

        //layout two
        zeinet_typo_and_color_options($this, 'Video/Gallery Title', '{{WRAPPER}} .trailer-and-photo__title', ['layout_two']);

        //layout three
        zeinet_typo_and_color_options($this, 'Bottom Title', '{{WRAPPER}} .top-cast__bottom-title', ['layout_three']);
        zeinet_typo_and_color_options($this, 'Bottom Content', '{{WRAPPER}} .top-cast__bottom-text', ['layout_three']);

        //layout four
        zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .movie-more__main-title', ['layout_four']);
        zeinet_typo_and_color_options($this, 'Movie Title', '{{WRAPPER}} .movie-more__title a', ['layout_four']);

        $this->end_controls_section();
    }

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