| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\FloatingButtons\Classes\Render; |
| 4 |
|
| 5 |
/** |
| 6 |
* Class Contact_Buttons_Core_Render. |
| 7 |
* |
| 8 |
* This class handles the rendering of the Contact Buttons widget for the core version. |
| 9 |
* |
| 10 |
* @since 3.23.0 |
| 11 |
*/ |
| 12 |
class Contact_Buttons_Core_Render extends Contact_Buttons_Render_Base { |
| 13 |
|
| 14 |
public function render(): void { |
| 15 |
$this->build_layout_render_attribute(); |
| 16 |
$this->add_content_wrapper_render_attribute(); |
| 17 |
|
| 18 |
$content_classnames = 'e-contact-buttons__content'; |
| 19 |
$animation_duration = $this->settings['style_chat_box_animation_duration']; |
| 20 |
|
| 21 |
if ( ! empty( $animation_duration ) ) { |
| 22 |
$content_classnames .= ' has-animation-duration-' . $animation_duration; |
| 23 |
} |
| 24 |
|
| 25 |
$this->widget->add_render_attribute( 'content', [ |
| 26 |
'class' => $content_classnames, |
| 27 |
] ); |
| 28 |
?> |
| 29 |
<div <?php echo $this->widget->get_render_attribute_string( 'layout' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 30 |
<div <?php echo $this->widget->get_render_attribute_string( 'content-wrapper' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 31 |
<div <?php echo $this->widget->get_render_attribute_string( 'content' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 32 |
<?php |
| 33 |
$this->render_top_bar(); |
| 34 |
$this->render_message_bubble(); |
| 35 |
$this->render_send_button(); |
| 36 |
?> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
<?php |
| 40 |
$this->render_chat_button(); |
| 41 |
?> |
| 42 |
</div> |
| 43 |
<?php |
| 44 |
} |
| 45 |
|
| 46 |
protected function add_layout_render_attribute( $layout_classnames ) { |
| 47 |
$this->widget->add_render_attribute( 'layout', [ |
| 48 |
'class' => $layout_classnames, |
| 49 |
'id' => $this->settings['advanced_custom_css_id'], |
| 50 |
'data-document-id' => get_the_ID(), |
| 51 |
'aria-role' => 'dialog', |
| 52 |
] ); |
| 53 |
} |
| 54 |
|
| 55 |
protected function add_content_wrapper_render_attribute() { |
| 56 |
$this->widget->add_render_attribute( 'content-wrapper', [ |
| 57 |
'aria-hidden' => 'true', |
| 58 |
'aria-label' => __( 'Links window', 'elementor' ), |
| 59 |
'class' => 'e-contact-buttons__content-wrapper hidden', |
| 60 |
'id' => 'e-contact-buttons__content-wrapper', |
| 61 |
] ); |
| 62 |
} |
| 63 |
} |
| 64 |
|