File: /mnt/data/demo-doccurelanding-wp/wp-content/plugins/dreamslanding-widgets/widgets/class-driving.php
<?php
namespace Dreamslandingelementor\Widgets;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
class DTS_driving extends Widget_Base {
public function get_name() {
return 'dreamslanding_elementor_driving';
}
public function get_title() {
return __( 'DL Driving', 'dreamslanding_elementor' );
}
public function get_icon() {
return 'eicon-image-box';
}
public function get_categories() {
return [ 'dreamslandingelemetortheme' ];
}
protected function register_controls() {
$this->start_controls_section(
'section_header',
[
'label' => __( 'Header', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'title',
[
'label' => __( 'Title', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Driving the Future of Digital Healthcare Business', 'dreamslanding_elementor' ),
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_left',
[
'label' => __( 'Left Content', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'left_image',
[
'label' => __( 'Left Image', 'dreamslanding_elementor' ),
'type' => Controls_Manager::MEDIA,
'default' => [ 'url' => '' ],
]
);
$this->add_control(
'left_image_alt',
[
'label' => __( 'Left Image Alt', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => '',
]
);
$this->add_control(
'btn_text',
[
'label' => __( 'Button Text', 'dreamslanding_elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Speak with a Specialist', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'btn_url',
[
'label' => __( 'Button URL', 'dreamslanding_elementor' ),
'type' => Controls_Manager::URL,
'options' => [ 'url', 'is_external', 'nofollow' ],
'default' => [ 'url' => 'javascript:void(0)' ],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_right',
[
'label' => __( 'Right Paragraphs', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'para_one',
[
'label' => __( 'Paragraph One', 'dreamslanding_elementor' ),
'type' => Controls_Manager::WYSIWYG,
'default' => __( 'Healthcare today is transforming into a technology-driven, hybrid service model. Medical facilities are expanding beyond traditional boundaries—leveraging telemedicine, artificial intelligence, and IoT devices to connect with patients wherever they are. For healthcare business leaders, this transformation opens doors to fresh revenue opportunities, reduced overhead expenses, and enhanced patient engagement.', 'dreamslanding_elementor' ),
]
);
$this->add_control(
'para_two',
[
'label' => __( 'Paragraph Two', 'dreamslanding_elementor' ),
'type' => Controls_Manager::WYSIWYG,
'default' => __( 'Doccure enables healthcare innovators to maintain their competitive edge through a customizable, comprehensive telemedicine solution that integrates clinical delivery, operational management, and performance analytics—guaranteeing growth potential, regulatory adherence, and financial success in the digital healthcare landscape.', 'dreamslanding_elementor' ),
]
);
$this->end_controls_section();
}
protected function render() {
$s = $this->get_settings_for_display();
$title = isset($s['title']) ? $s['title'] : '';
$img = !empty($s['left_image']['url']) ? $s['left_image']['url'] : '';
$img_alt = isset($s['left_image_alt']) ? $s['left_image_alt'] : '';
$btn_text = isset($s['btn_text']) ? $s['btn_text'] : '';
$btn = isset($s['btn_url']) ? $s['btn_url'] : [];
$btn_url = !empty($btn['url']) ? $btn['url'] : 'javascript:void(0)';
$btn_target = !empty($btn['is_external']) ? ' target="_blank"' : '';
$btn_rel = !empty($btn['nofollow']) ? ' rel="nofollow"' : '';
$para_one = isset($s['para_one']) ? $s['para_one'] : '';
$para_two = isset($s['para_two']) ? $s['para_two'] : '';
?>
<section class="section-eg">
<div class="section-header aos" data-aos="fade-up">
<?php if ($title): ?><h2><?php echo esc_html($title); ?></h2><?php endif; ?>
</div>
<div class="container">
<div class="row">
<div class="col-lg-6">
<div class="sec-img">
<?php if ($img): ?><img src="<?php echo esc_url($img); ?>" alt="<?php echo esc_attr($img_alt); ?>" /><?php endif; ?>
</div>
<div class="sec-btn">
<?php if ($btn_text): ?>
<a href="<?php echo esc_url($btn_url); ?>" class="btn btn-w-ico"<?php echo $btn_target . $btn_rel; ?>><?php echo esc_html($btn_text); ?><i class="ti ti-arrow-up-right"></i></a>
<?php endif; ?>
</div>
</div>
<div class="col-lg-6">
<div class="ec-highlight-list ec-highlight-list-2">
<div class="ec-highlight-card">
<?php if ($para_one): ?><p><?php echo wp_kses_post($para_one); ?></p><?php endif; ?>
</div>
<div class="ec-highlight-card">
<?php if ($para_two): ?><p><?php echo wp_kses_post($para_two); ?></p><?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
}
protected function content_template() {
?>
<section class="section-eg">
<div class="section-header aos" data-aos="fade-up">
<# if ( settings.title ) { #><h2>{{{ settings.title }}}</h2><# } #>
</div>
<div class="container">
<div class="row">
<div class="col-lg-6">
<div class="sec-img">
<# if ( settings.left_image && settings.left_image.url ) { #>
<img src="{{ settings.left_image.url }}" alt="{{ settings.left_image_alt || '' }}" />
<# } #>
</div>
<div class="sec-btn">
<# if ( settings.btn_text ) { #>
<a href="{{ settings.btn_url.url || 'javascript:void(0)' }}" class="btn btn-w-ico" <# if ( settings.btn_url.is_external ) { #>target="_blank"<# } #> <# if ( settings.btn_url.nofollow ) { #>rel="nofollow"<# } #>>{{{ settings.btn_text }}}<i class="ti ti-arrow-up-right"></i></a>
<# } #>
</div>
</div>
<div class="col-lg-6">
<div class="ec-highlight-list ec-highlight-list-2">
<div class="ec-highlight-card">
<# if ( settings.para_one ) { #><p>{{{ settings.para_one }}}</p><# } #>
</div>
<div class="ec-highlight-card">
<# if ( settings.para_two ) { #><p>{{{ settings.para_two }}}</p><# } #>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
}
}