HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/doccure-wp/wp-content/plugins/doccure-elementor/widgets/class-calltoaction.php
<?php
/**
 * Awesomesauce class.
 *
 * @category   Class
 * @package    ElementorAwesomesauce
 * @subpackage WordPress
 * @author     Ben Marshall <[email protected]>
 * @copyright  2020 Ben Marshall
 * @license    https://opensource.org/licenses/GPL-3.0 GPL-3.0-only
 * @link       link(https://www.benmarshall.me/build-custom-elementor-widgets/,
 *             Build Custom Elementor Widgets)
 * @since      1.0.0
 * php version 7.3.9
 */

namespace ElementorDoccure\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Utils;
use Elementor\Scheme_Color;

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

/**
 * Awesomesauce widget class.
 *
 * @since 1.0.0
 */
class DoccureCallAction extends Widget_Base {

	/**
	 * Retrieve the widget name.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'DoccureCallAction';
	}

	/**
	 * Retrieve the widget title.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'Doccure Call to Action', 'doccure_elementor' );
	}

	/**
	 * Retrieve the widget icon.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'eicon-gallery-group';
	}

	/**
	 * Retrieve the list of categories the widget belongs to.
	 *
	 * Used to determine where to display the widget in the editor.
	 *
	 * Note that currently Elementor supports only one category.
	 * When multiple categories passed, Elementor uses the first one.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return array( 'doccure' );
	}

	/**
	 * Register the widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */
	protected function register_controls() {
      
		$this->start_controls_section(
			'content_section',
			[
				'label' => __( 'Content', 'plugin-name' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);


		$this->add_control(
			'style',
			[
				'label' => __( 'Style', 'plugin-domain' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'default' => 'style1',
				'options' => [
 					'style1' =>  __( 'Style 1', 'doccure_elementor' ),
					'style2' =>  __(  'Style 2', 'doccure_elementor' ),
 				],
			]
		);

		$this->add_control(
			'title',
			array(
				'label'   => __( 'Title', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( 'Download the Doccure App today!', 'doccure_elementor' ),
			)
		);	


		
		$this->add_control(
			'piconclass',
			array(
				'label'   => __( 'Phone Icon Class', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( 'isax isax-headphone', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style2'], 
				],
			)
		);

		$this->add_control(
			'phone_label',
			array(
				'label'   => __( 'Phone Label', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( 'Customer Support', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style2'], 
				],
			)
		);

		$this->add_control(
			'phone_text',
			array(
				'label'   => __( 'Phone Number', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( '+1 56589 54598', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style2'], 
				],
			)
		);

		
		$this->add_control(
			'eiconclass',
			array(
				'label'   => __( 'Email Icon Class', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( 'isax isax-message-2', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style2'], 
				],
			)
		);

		$this->add_control(
			'email_label',
			array(
				'label'   => __( 'Email Label', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( 'Drop Us an Email', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style2'], 
				],
			)
		);

		$this->add_control(
			'email_text',
			array(
				'label'   => __( 'Email', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( '[email protected]', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style2'], 
				],
			)
		);


		$this->add_control(
			'subtitle',
			array(
				'label'   => __( 'Sub-Title', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( 'To download an app related to a doctor or medical services, you can typically visit the app store on your device.', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style1'], 
				],
			)
		);

		$this->add_control(
			'gapp_link',
			array(
				'label'   => __( 'Google App Link', 'doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( '#', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style1'], 
				],
			)
		);

	 

		$this->add_control(
			'app_link',
			[
				'label' => __( 'Apple App Link','doccure_elementor' ),
				'type'    => Controls_Manager::TEXT,
				'default' => __( '#', 'doccure_elementor' ),
				'condition' => [
					'style' => [ 'style1'], 
				],
 			]
		);

		$this->add_control(
			'gapp_image',
			[
				'label' => __( 'Google App Image', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);

		$this->add_control(
			'app_image',
			[
				'label' => __( 'Apple App Image', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);

		$this->add_control(
			'right_image',
			[
				'label' => __( 'Right Image', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);

		$this->add_control(
			'shape_1',
			[
				'label' => __( 'Backbround 1', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);
		$this->add_control(
			'shape_2',
			[
				'label' => __( 'Backbround 2', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);
		$this->add_control(
			'shape_3',
			[
				'label' => __( 'Backbround 3', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);

		$this->add_control(
			'shape_4',
			[
				'label' => __( 'Backbround 4', 'dreamslms_elementor' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'condition' => [
					'style' => [ 'style1'], 
				],
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				]
			]
		);

 		$this->end_controls_section();

	}

	/**
	 * Render the widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */
	protected function render() {
		$settings = $this->get_settings_for_display();

 ?>
 
 <?php
if($settings['style']=='style1'){ ?>


<section class="app-section app-sec-one p-0">
				<div class="container">
					<div class="app-bg">
						<div class="row">
							<div class="col-lg-6 col-md-12 d-flex">
								<div class="app-content d-flex flex-column justify-content-center">
									<div class="app-header aos" data-aos="fade-up">
										<h3 class="display-6 text-white"><?php echo $settings['title']; ?></h3>
										<p class="text-light"><?php echo $settings['subtitle']; ?></p>
									</div>
									<div class="google-imgs aos" data-aos="fade-up">

									<?php if(isset($settings['gapp_image']['url']) && !empty(isset($settings['gapp_image']['url']))){ ?> 
										<a href="<?php echo $settings['gapp_link']; ?>" target="_blank"><img src="<?php echo esc_url($settings['gapp_image']['url']); ?>"  alt=""></a>
<?php } ?>


<?php if(isset($settings['app_image']['url']) && !empty(isset($settings['app_image']['url']))){ ?> 
										<a href="<?php echo $settings['app_link']; ?>" target="_blank"><img src="<?php echo esc_url($settings['app_image']['url']); ?>"  alt=""></a>
<?php } ?>

 										 
									</div>
								</div>
							</div>
							<div class="col-lg-6 col-md-12 aos" data-aos="fade-up">
								<div class="mobile-img">
								<?php if(isset($settings['app_image']['url']) && !empty(isset($settings['app_image']['url']))){ ?> 

									<img src="<?php echo esc_url($settings['right_image']['url']); ?>" class="img-fluid" alt="img">
									<?php } ?>
								</div>
							</div>
						</div>
						<div class="app-bgs">
						<?php if(isset($settings['shape_2']['url']) && !empty(isset($settings['app_image']['url']))){ ?> 
							<img src="<?php echo esc_url($settings['shape_2']['url']); ?>" alt="img" class="app-bg-01">
							<?php } ?>
							<?php if(isset($settings['shape_3']['url']) && !empty(isset($settings['shape_3']['url']))){ ?>
							<img src="<?php echo esc_url($settings['shape_3']['url']); ?>" alt="img" class="app-bg-02">
							<?php } ?>
							<?php if(isset($settings['shape_4']['url']) && !empty(isset($settings['shape_4']['url']))){ ?>
							<img src="<?php echo esc_url($settings['shape_4']['url']); ?>" alt="img" class="app-bg-03">
							<?php } ?>
						 
						</div>
					</div>
				</div>
				<div class="download-bg">
 
					<?php if(isset($settings['shape_1']['url']) && !empty(isset($settings['shape_1']['url']))){ ?>
							<img src="<?php echo esc_url($settings['shape_1']['url']); ?>" alt="img" >
							<?php } ?>

				</div>
			</section>
			

<?php } else if($settings['style']=='style2'){ ?>
	<section class="info-section">
				<div class="container">					
					<div class="contact-info">
						<div class="d-lg-flex align-items-center justify-content-between w-100 gap-4">
							<div class="mb-4 mb-lg-0 aos" data-aos="fade-up">
								<h6 class="display-6 text-white mb-0"><?php echo $settings['title']; ?></h6>
							</div>
							<div class="d-sm-flex align-items-center justify-content-lg-end gap-4 aos" data-aos="fade-up">
								<div class="con-info d-flex align-items-center mb-3 mb-sm-0">
									<span class="con-icon">
										<i class="<?php echo $settings['piconclass']; ?>"></i>
									</span>
									<div class="ms-2">
										<p class="text-white mb-1"><?php echo $settings['phone_label']; ?></p>
										<p class="text-white fw-medium mb-0"><?php echo $settings['phone_text']; ?></p>
									</div>
								</div>
								<div class="con-info d-flex align-items-center">
									<span class="con-icon">
										<i class="<?php echo $settings['eiconclass']; ?>"></i>
									</span>
									<div class="ms-2">
										<p class="text-white mb-1"><?php echo $settings['email_label']; ?></p>
										<p class="text-white fw-medium mb-0"><?php echo $settings['email_text']; ?></p>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</section>
	<?php } ?>
	
 <?php
	}
}