File: /mnt/data/dreamstour-wp/wp-content/plugins/dreamstour-widgets/widgets/class-about-section.php
<?php
namespace Dreamstourelementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class DTS_about_section extends Widget_Base {
public function get_name() {
return 'dreamstour_elementor_about_section';
}
public function get_title() {
return \__( 'Dreams Tour About - Section', 'dreamstour_elementor' );
}
public function get_icon() {
return 'eicon-columns';
}
public function get_categories() {
return [ 'dreamstourelemetortheme' ];
}
protected function register_controls() {
// Left visuals controls
$this->start_controls_section('left_visuals', [ 'label' => \__( 'Left Visuals', 'dreamstour_elementor' ) ]);
$this->add_control('listing_title', [ 'label' => \__( 'Small Box Title', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'All Listings', 'dreamstour_elementor' ) ]);
$this->add_control('listing_icon', [ 'label' => \__( 'Listing Icon', 'dreamstour_elementor' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => 'assets/img/icons/listing.svg' ] ]);
$this->add_control('listing_button_text', [ 'label' => \__( 'Button Text', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'Add You Listings', 'dreamstour_elementor' ) ]);
$this->add_control('listing_button_link', [ 'label' => \__( 'Button Link', 'dreamstour_elementor' ), 'type' => Controls_Manager::URL, 'default' => [ 'url' => '#', 'is_external' => false, 'nofollow' => false ] ]);
$this->add_control('main_image', [ 'label' => \__( 'Main Image', 'dreamstour_elementor' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => 'assets/img/about.png' ] ]);
$this->add_control('earnings_label', [ 'label' => \__( 'Badge Label', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'Today’s Earnings', 'dreamstour_elementor' ) ]);
$this->add_control('earnings_value', [ 'label' => \__( 'Badge Value', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => '$2500' ]);
$this->end_controls_section();
// Right content controls
$this->start_controls_section('right_content', [ 'label' => \__( 'Right Content', 'dreamstour_elementor' ) ]);
$this->add_control('kicker', [ 'label' => \__( 'Kicker', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'About DreamsTour', 'dreamstour_elementor' ) ]);
$this->add_control('heading', [ 'label' => \__( 'Heading', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'All-in-one platform for unforgettable travel experiences!', 'dreamstour_elementor' ), 'label_block' => true ]);
$this->add_control('paragraph', [ 'label' => \__( 'Paragraph', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXTAREA, 'default' => \__( "At DreamsTour, we believe that travel should be simple, seamless, and tailored to your needs.", 'dreamstour_elementor' ) ]);
$this->add_control('point_one', [ 'label' => \__( 'Point One', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'Clients navigate their journeys ... U.K', 'dreamstour_elementor' ), 'label_block' => true ]);
$this->add_control('point_two', [ 'label' => \__( 'Point Two', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'Provides a range of services ... vacation planning.', 'dreamstour_elementor' ), 'label_block' => true ]);
$this->add_control('mission_heading', [ 'label' => \__( 'Mission Heading', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXT, 'default' => \__( 'Our Mission', 'dreamstour_elementor' ) ]);
$this->add_control('mission_text', [ 'label' => \__( 'Mission Text', 'dreamstour_elementor' ), 'type' => Controls_Manager::TEXTAREA, 'default' => \__( 'Our mission is to make travel more accessible ...', 'dreamstour_elementor' ) ]);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$btn_url = isset( $settings['listing_button_link']['url'] ) ? $settings['listing_button_link']['url'] : '#';
$btn_target = ! empty( $settings['listing_button_link']['is_external'] ) ? ' target="_blank"' : '';
$btn_rel = ! empty( $settings['listing_button_link']['nofollow'] ) ? ' rel="nofollow"' : '';
?>
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6">
<div class="about-image mb-4 mb-lg-0">
<div class="about-listing">
<i class="isax isax-calendar-add text-white mb-2"></i>
<h6 class="fs-16 mb-3 text-white"><?php echo \esc_html( $settings['listing_title'] ); ?></h6>
<div class="listing-img">
<div>
<img src="<?php echo \esc_url( isset( $settings['listing_icon']['url'] ) ? $settings['listing_icon']['url'] : '' ); ?>" alt="icon">
</div>
<a href="<?php echo \esc_url( $btn_url ); ?>" class="btn btn-warning text-gray-9"<?php echo $btn_target . $btn_rel; ?>><?php echo \esc_html( $settings['listing_button_text'] ); ?></a>
</div>
</div>
<div class="about-img">
<img src="<?php echo \esc_url( isset( $settings['main_image']['url'] ) ? $settings['main_image']['url'] : '' ); ?>" alt="about">
</div>
<div class="about-progress d-inline-flex align-items-center">
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/progress-icon.svg" alt="icon">
<div class="ms-2">
<p class="fs-10 mb-1"><?php echo \esc_html( $settings['earnings_label'] ); ?></p>
<h6 class="fs-13"><?php echo \esc_html( $settings['earnings_value'] ); ?></h6>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="about-content mb-4">
<h6 class="text-primary fs-14 fw-medium mb-2"><?php echo \esc_html( $settings['kicker'] ); ?></h6>
<h2 class="display-6 mb-2"><?php echo \esc_html( $settings['heading'] ); ?></h2>
<p class="mb-4"><?php echo \esc_html( $settings['paragraph'] ); ?></p>
<div class="d-flex align-items-center mb-4">
<span class="avatar avatar-xl bg-primary rounded-circle flex-shrink-0 me-3">
<i class="isax isax-map5 fs-24"></i>
</span>
<p><?php echo \esc_html( $settings['point_one'] ); ?></p>
</div>
<div class="d-flex align-items-center">
<span class="avatar avatar-xl bg-secondary rounded-circle flex-shrink-0 me-3">
<i class="isax isax-trade5 fs-24 text-gray-9"></i>
</span>
<p><?php echo \esc_html( $settings['point_two'] ); ?></p>
</div>
</div>
<div class="about-mission">
<h6 class="text-primary fs-14 fw-medium mb-3"><?php echo \esc_html( $settings['mission_heading'] ); ?></h6>
<p class="fs-16 text-gray-6"><?php echo \esc_html( $settings['mission_text'] ); ?></p>
</div>
</div>
</div>
</div>
<?php
}
protected function content_template() {}
}