| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
class Divi_Property_Enquiry_Form_Link_Widget extends ET_Builder_Module |
| 7 |
{ |
| 8 |
public $slug = 'et_pb_property_enquiry_form_link_widget'; |
| 9 |
public $vb_support = 'partial'; |
| 10 |
public $icon = ''; |
| 11 |
|
| 12 |
public function init() { |
| 13 |
$this->name = esc_html__( 'Property Enquiry Form Link', 'propertyhive' ); |
| 14 |
$this->icon = '1'; |
| 15 |
} |
| 16 |
|
| 17 |
public function get_fields() |
| 18 |
{ |
| 19 |
$fields = array(); |
| 20 |
|
| 21 |
return $fields; |
| 22 |
} |
| 23 |
|
| 24 |
public function render( $attrs, $content, $render_slug ) |
| 25 |
{ |
| 26 |
$post_id = get_the_ID(); |
| 27 |
|
| 28 |
$property = new PH_Property($post_id); |
| 29 |
|
| 30 |
if ( !isset($property->id) ) { |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
ob_start(); |
| 35 |
?> |
| 36 |
<a data-fancybox data-src="#makeEnquiry<?php echo (int)$property->id; ?>" href="javascript:;"><?php echo esc_html(__( 'Make Enquiry', 'propertyhive' )); ?></a> |
| 37 |
|
| 38 |
<!-- LIGHTBOX FORM --> |
| 39 |
<div id="makeEnquiry<?php echo (int)$property->id; ?>" style="display:none;"> |
| 40 |
|
| 41 |
<h2><?php echo esc_html(__( 'Make Enquiry', 'propertyhive' )); ?></h2> |
| 42 |
|
| 43 |
<p><?php _e( 'Please complete the form below and a member of staff will be in touch shortly.', 'propertyhive' ); ?></p> |
| 44 |
|
| 45 |
<?php propertyhive_enquiry_form(); ?> |
| 46 |
|
| 47 |
</div> |
| 48 |
<!-- END LIGHTBOX FORM --> |
| 49 |
<?php |
| 50 |
|
| 51 |
return $this->_render_module_wrapper( ob_get_clean(), $render_slug ); |
| 52 |
} |
| 53 |
} |