Current File : /home/kelaby89/babyl0n.restaurant/wp-content/plugins/restar-core/addons/widgets/restar-banner2.php
<?php
use \Elementor\Widget_Base;
use \Elementor\Controls_Manager;
use \Elementor\Group_Control_Typography;
use \Elementor\Repeater;
use \Elementor\Utils;
use \Elementor\Group_Control_Border;
/**
 *
 * Banner Widget.
 *
 */
class restar_Banner2 extends Widget_Base {

	public function get_name() {
		return 'restarbanner2';
	}
	public function get_title() {
		return __( 'Banner / Hero', 'restar' );
	}
	public function get_icon() {
		return 'th-icon';
    }
	public function get_categories() {
		return [ 'restar_header_elements' ];
	}

	protected function register_controls() {

		$this->start_controls_section(
			'banner_section',
			[
				'label' 	=> __( 'Banner', 'restar' ),
				'tab' 		=> Controls_Manager::TAB_CONTENT,
			]
        );

		restar_select_field( $this, 'layout_style', 'Layout Style', ['Style One'] );

		restar_media_fields( $this, 'bg', 'Choose Background', ['2'] );
        restar_media_fields( $this, 'hero_image', 'Main Image', ['1'] );

		restar_media_fields( $this, 'image1', 'Shape Image 1', ['1'] );
		restar_media_fields( $this, 'image2', 'Shape Image 2', ['1'] );
		restar_media_fields( $this, 'image3', 'Shape Image 3', ['1'] );

		restar_general_fields( $this, 'subtitle', 'Subtitle', 'TEXTAREA', 'Its Quick & Amusing!' );
		restar_general_fields( $this, 'title', 'Title', 'TEXTAREA', 'Fast Fresh' );
		restar_general_fields( $this, 'title2', 'Title 2', 'TEXTAREA', 'Flavorful' );

		restar_general_fields( $this, 'button_text', 'Button Text', 'TEXT', 'Order Now' );
		restar_url_fields( $this, 'button_url', 'Button URL' );

		$this->end_controls_section();

        //---------------------------------------
			//Style Section Start
		//---------------------------------------

		//-------Subtitle Style-------
		restar_common_style_fields( $this, 'subtitle', 'Subtitle', '{{WRAPPER}} .sub', ['1'],'--theme-color' );
		//-------Title Style-------
		restar_common_style_fields( $this, 'title', 'Title', '{{WRAPPER}} .el-title1' );
		restar_common_style_fields( $this, 'title2', 'Title 2', '{{WRAPPER}} .el-title2' );
		//------Button Style (gradient-color)-------
		restar_button_style_fields( $this, 'btn10', 'Button Styling', '{{WRAPPER}} .th_btn' );

    }

	protected function render() {

    $settings = $this->get_settings_for_display();

		if( $settings['layout_style'] == '1' ){

            echo '<div class="th-hero-wrapper hero-2" id="hero" id="hero">';
                if(!empty( esc_url( $settings['image1']['url'] ))){
                    echo '<div class="hero-shape1">';
                        echo restar_img_tag( array(
                            'url'   => esc_url( $settings['image1']['url'] ),
                        ));
                    echo '</div>';
                }
                if(!empty( esc_url( $settings['image2']['url'] ))){
                    echo '<div class="hero-shape2">';
                        echo restar_img_tag( array(
                            'url'   => esc_url( $settings['image2']['url'] ),
                        ));
                    echo '</div>';
                }
                if(!empty( esc_url( $settings['image3']['url'] ))){
                    echo '<div class="hero-shape3">';
                        echo restar_img_tag( array(
                            'url'   => esc_url( $settings['image3']['url'] ),
                        ));
                    echo '</div>';
                }
                echo '<div class="hero-inner">';
                    echo '<div class="container th-container">';
                        echo '<div class="hero-style2">';
                            if(!empty($settings['subtitle'])){
                                echo '<div class="title-ani">';
                                    echo '<span class="hero-subtitle text-center sub">'.wp_kses_post($settings['subtitle']).'</span>';
                                echo '</div>';
                            }
                            if(!empty($settings['title'])){
                                echo '<h1 class="hero-title2 el-title1">'.wp_kses_post($settings['title']).'</h1>';
                            }
                            if(!empty($settings['title2'])){
                                echo '<h2 class="hero-title3 el-title2">'.wp_kses_post($settings['title2']).'</h2>';
                            }
                            if(!empty($settings['button_text'])){
                                echo '<div class="title-ani2">';
                                    echo '<a href="'.esc_url( $settings['button_url']['url'] ).'" class="th-btn style3 th_btn">'.wp_kses_post($settings['button_text']).'</a>';
                                echo '</div>';
                            }
                        echo '</div>';
                    echo '</div>';
                echo '</div>';
                if(!empty( esc_url( $settings['hero_image']['url'] ))){
                    echo '<div class="hero-img">';
                        echo restar_img_tag( array(
                            'url'   => esc_url( $settings['hero_image']['url'] ),
                        ));
                    echo '</div>';
                }
            echo '</div>';
           
		} elseif( $settings['layout_style'] == '2' ) {


		}

		
	}

}
Page not found – Hello World !