HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/ftech-plugin/elementor/widgets/cube-animation.php
<?php

/**
 * Elementor Single Widget
 * @package ftech Tools
 * @since 1.0.0
 */

namespace Elementor;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.

class Ftech_Cube_Animation extends Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Elementor widget name.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'go-cube-animation';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Elementor widget title.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return esc_html__( 'Cube Animation', 'ftech-plugin' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve Elementor widget icon.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'ftech-custom-icon';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Elementor widget belongs to.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'ftech_widgets' ];
	}


	protected function register_controls() {

        $this->start_controls_section(
			'--img-option',
			[
				'label' => esc_html__( 'Image Option', 'ftech-plugin' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			]
		);
        
        $this->add_control(
			'img_1', [
				'label' => esc_html__( 'Image 1', 'gesto-plugin' ),
				'type' => Controls_Manager::MEDIA,
                'label_block' => true,
			]
		);

        $this->add_control(
			'img_2', [
				'label' => esc_html__( 'Image 2', 'gesto-plugin' ),
				'type' => Controls_Manager::MEDIA,
                'label_block' => true,
			]
		);
        $this->add_control(
			'img_3', [
				'label' => esc_html__( 'Image 3', 'gesto-plugin' ),
				'type' => Controls_Manager::MEDIA,
                'label_block' => true,
			]
		);
        $this->add_control(
			'img_4', [
				'label' => esc_html__( 'Image 4', 'gesto-plugin' ),
				'type' => Controls_Manager::MEDIA,
                'label_block' => true,
			]
		);
        
		$this->end_controls_section();

	}

	protected function render() {
		$settings = $this->get_settings_for_display();?>
        <div class="section-bg-1-cube-grid">
            <?php if(!empty($settings['img_1']['url'])):?>
                <img src="<?php echo esc_url($settings['img_1']['url']);?>" alt="<?php if(!empty($settings['img_1']['alt'])){ echo esc_url($settings['img_1']['alt']);}?>" class="section-bg-1-cube-1">
            <?php endif;?>

            <?php if(!empty($settings['img_2']['url'])):?>
                <img src="<?php echo esc_url($settings['img_2']['url']);?>" alt="<?php if(!empty($settings['img_2']['alt'])){ echo esc_url($settings['img_2']['alt']);}?>" class="section-bg-1-cube-2">
            <?php endif;?>

            <?php if(!empty($settings['img_3']['url'])):?>
                <img src="<?php echo esc_url($settings['img_3']['url']);?>" alt="<?php if(!empty($settings['img_3']['alt'])){ echo esc_url($settings['img_3']['alt']);}?>" class="section-bg-1-cube-3">
            <?php endif;?>

            <?php if(!empty($settings['img_4']['url'])):?>
                <img src="<?php echo esc_url($settings['img_4']['url']);?>" alt="<?php if(!empty($settings['img_4']['alt'])){ echo esc_url($settings['img_4']['alt']);}?>" class="section-bg-1-cube-4">
            <?php endif;?>

        </div>
    <?php
    }


}


Plugin::instance()->widgets_manager->register( new Ftech_Cube_Animation() );