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

<?php

namespace Layerdrops\Zeinet\Widgets;


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

    public function get_title()
    {
        return __('Custom Movie', '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'),
                ]
            ]
        );

        $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(
            'sec_title',
            [
                'label' => __('Section Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Title', 'zeinet-addon'),
                'default' => __('Default Title', 'zeinet-addon'),
            ]
        );

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

        $layout_one_movie_post = new \Elementor\Repeater();

        $layout_one_movie_post->add_control(
            'select_post',
            [
                'label'       => esc_html__('Select Post', 'zeinet-addon'),
                'label_block' => true,
                'type'        => \Elementor\Controls_Manager::SELECT,
                'options'     => zeinet_post_query('movie'),
            ]
        );

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


        $layout_one_movie_post->add_control(
            'date',
            [
                'label' => __('Date', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Add Date', 'zeinet-addon'),
                'default' => __('Mar.11,2024', 'zeinet-addon'),
                'label_block' => true
            ]
        );

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

        $this->add_control(
            'layout_one_movie_post',
            [
                'label' => __('Movie Post', 'zeinet-addon'),
                'prevent_empty' => false,
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_one_movie_post->get_controls(),
                'title_field' => '{{{ custom_title }}}',
            ]
        );

        $this->add_control(
            'layout_one_bg_image',
            [
                'label' => __('Background 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(
            'layout_two_sec_title',
            [
                'label' => __('Section Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Title', 'zeinet-addon'),
                'default' => __('Default Title', 'zeinet-addon'),
            ]
        );

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

        $layout_two_movie_post = new \Elementor\Repeater();

        $layout_two_movie_post->add_control(
            'select_post',
            [
                'label'       => esc_html__('Select Post', 'zeinet-addon'),
                'label_block' => true,
                'type'        => \Elementor\Controls_Manager::SELECT,
                'options'     => zeinet_post_query('movie'),
            ]
        );

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


        $layout_two_movie_post->add_control(
            'date',
            [
                'label' => __('Date', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Add Date', 'zeinet-addon'),
                'default' => __('Mar.11,2024', 'zeinet-addon'),
                'label_block' => true
            ]
        );

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

        $this->add_control(
            'layout_two_movie_post',
            [
                'label' => __('Movie Post', 'zeinet-addon'),
                'prevent_empty' => false,
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $layout_two_movie_post->get_controls(),
                'title_field' => '{{{ custom_title }}}',
            ]
        );

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

        zeinet_get_elementor_carousel_options($this, ['layout_two']);

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

        zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one', 'layout_two']);
        zeinet_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline', ['layout_one', 'layout_two']);
        zeinet_typo_and_color_options($this, 'Movie Title', '{{WRAPPER}} .movie-four__single__title a', ['layout_one', 'layout_two']);
        zeinet_typo_and_color_options($this, 'Date', '{{WRAPPER}} .movie-four__single__date', ['layout_one', 'layout_two']);


        $this->end_controls_section();
    }

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