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/dreamsrent-wp/wp-content/plugins/dreamsrent-widgets/widgets/class-contactbox11.php
<?php
namespace Dreamsrentelementor\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
use Elementor\Utils;

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

/**
 * Elementor Hello World
 *
 * Elementor widget for hello world.
 *
 * @since 1.0.0
 */
class DSR_contact_box extends Widget_Base {

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

	/**
	 * Retrieve the widget title.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'DR Conatact Box', 'dreamsrent_elementor' );
	}

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

	/**
	 * 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 [ 'dreamsrentelemetortheme' ];
	}

	/**
	 * Retrieve the list of scripts the widget depended on.
	 *
	 * Used to set scripts dependencies required to run the widget.
	 *
	 * @since 1.0.0
	 *
	 * @access public
	 *
	 * @return array Widget scripts dependencies.
	 */
	public function get_script_depends() {
		return [ 'dreamsrent_elementor_service_card' ];
	}

	/**
	 * 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(
			'section_content',
			[
				'label' => __( 'Content', 'dreamsrent_elementor' ),
			]
		);


		$this->add_control(
			'icon',
			[
				'label' => __( 'Icon', 'dreamsrent_elementor' ),
				'type' => Controls_Manager::SELECT,
				'default' => 'feather-phone-call',
				'options' => [
					'feather-phone-call' =>  __( 'Phone', 'dreamsrent_elementor' ),
					'feather-mail' =>  __( 'Email', 'dreamsrent_elementor' ),
					'feather-map-pin' =>  __( 'Map', 'dreamsrent_elementor' ),
					'feather-clock' =>  __( 'Clock', 'dreamsrent_elementor' ),
				
					
				],
			]
		);

		$this->add_control(
			'title',
			[
				'label' => __( 'Title', 'dreamsrent_elementor' ),
				'type' => Controls_Manager::TEXT,
				"default" => __( 'Phone Number', 'dreamsrent_elementor' ),
			]
		);
   
	
 	 
  
		$this->add_control(
			'desc',
			[
				'label' => __( 'Description', 'dreamsrent_elementor' ),
				'type' => Controls_Manager::TEXT,
				"default" => __( '(888) 888-8888', 'dreamsrent_elementor' ),
			]
		);

	 
		

		$this->end_controls_section();

		// Style tab: Title
		$this->start_controls_section(
			'contactbox11_title_style',
			[
				'label' => __( 'Title', 'dreamsrent_elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'contactbox11_title_color',
			[
				'label'     => __( 'Title Color', 'dreamsrent_elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .single-contact-info h3' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name'     => 'contactbox11_title_typography',
				'label'    => __( 'Title Typography', 'dreamsrent_elementor' ),
				'selector' => '{{WRAPPER}} .single-contact-info h3',
			]
		);

		$this->end_controls_section();

		// Style tab: Description / Link
		$this->start_controls_section(
			'contactbox11_desc_style',
			[
				'label' => __( 'Description', 'dreamsrent_elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_control(
			'contactbox11_desc_color',
			[
				'label'     => __( 'Description Color', 'dreamsrent_elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .single-contact-info a' => 'color: {{VALUE}};',
				],
			]
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			[
				'name'     => 'contactbox11_desc_typography',
				'label'    => __( 'Description Typography', 'dreamsrent_elementor' ),
				'selector' => '{{WRAPPER}} .single-contact-info a',
			]
		);

		$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(); ?>

<div class="contact-info-area">
<div class="col-lg-3 col-md-6 col-12 d-flex" data-aos="fade-down" data-aos-duration="1200" data-aos-delay="0.1"> 
							<div class="single-contact-info flex-fill">
								 
								<span><i class="<?php echo esc_attr( $settings['icon'] ); ?>"></i></span>
							 
								<h3><?php echo esc_html( $settings['title'] ); ?></h3>
							 
									<a href="tel:<?php echo esc_attr( $settings['desc'] ); ?>">
									   <?php echo esc_html( $settings['desc'] ); ?>
									</a>
									 
								  
							</div>
						</div>

 

</div>
 
  
<?php
	}

	/**
	 * Render the widget output in the editor.
	 *
	 * Written as a Backbone JavaScript template and used to generate the live preview.
	 *
	 * @since 1.0.0
	 *
	 * @access protected
	 */
	protected function content_template() {
		?>

		
		<div class="dreamsrentelementor_service_card {{{ settings.class }}} ">
			<img src="{{{ settings.img.url }}}"></img>
			<div class="content  ">
				<h3 class="title">{{{ settings.title }}}</h3>
				<div class="desc">{{{ settings.desc }}}</div>
 			</div>
		</div>
		<?php
	}
}