widget = $widget; $this->settings = $widget->get_settings_for_display(); } protected function render_chat_button_icon(): void { $platform = $this->settings['chat_button_platform'] ?? ''; $mapping = Social_Network_Provider::get_icon_mapping( $platform ); $icon_lib = explode( ' ', $mapping )[0]; $library = 'fab' === $icon_lib ? 'fa-brands' : 'fa-solid'; Icons_Manager::render_icon( [ 'library' => $library, 'value' => $mapping, ], [ 'aria-hidden' => 'true' ] ); } protected function render_chat_button(): void { $platform = $this->settings['chat_button_platform'] ?? ''; $display_dot = $this->settings['chat_button_show_dot'] ?? ''; $button_size = $this->settings['style_chat_button_size']; $hover_animation = $this->settings['style_button_color_hover_animation']; $entrance_animation = $this->settings['style_chat_button_animation']; $entrance_animation_duration = $this->settings['style_chat_button_animation_duration']; $entrance_animation_delay = $this->settings['style_chat_button_animation_delay']; $accessible_name = $this->settings['chat_aria_label']; $button_classnames = 'e-contact-buttons__chat-button e-contact-buttons__chat-button-shadow'; if ( ! empty( $button_size ) ) { $button_classnames .= ' has-size-' . $button_size; } if ( ! empty( $hover_animation ) ) { $button_classnames .= ' elementor-animation-' . $hover_animation; } if ( ! empty( $entrance_animation ) && 'none' != $entrance_animation ) { $button_classnames .= ' has-entrance-animation'; } if ( ! empty( $entrance_animation_delay ) ) { $button_classnames .= ' has-entrance-animation-delay'; } if ( ! empty( $entrance_animation_duration ) ) { $button_classnames .= ' has-entrance-animation-duration-' . $entrance_animation_duration; } if ( 'yes' === $display_dot ) { $button_classnames .= ' has-dot'; } $this->widget->add_render_attribute( 'button', [ 'class' => $button_classnames, 'aria-controls' => 'e-contact-buttons__content-wrapper', 'aria-label' => sprintf( /* translators: 1: Accessible name. */ esc_html__( 'Toggle %1$s', 'elementor' ), $accessible_name, ), 'type' => 'button', ] ); ?>
settings['chat_aria_label']; $this->widget->add_render_attribute( 'close-button', [ 'class' => 'e-contact-buttons__close-button', 'aria-controls' => 'e-contact-buttons__content-wrapper', 'aria-label' => sprintf( /* translators: 1: Accessible name. */ esc_html__( 'Close %1$s', 'elementor' ), $accessible_name, ), 'type' => 'button', ] ); ?> settings['top_bar_image'] ?? []; $has_profile_image = ! empty( $profile_image_value ) && ( ! empty( $profile_image_value['url'] || ! empty( $profile_image_value['id'] ) ) ); $profile_image_size = $this->settings['style_top_bar_image_size']; $display_profile_dot = $this->settings['top_bar_show_dot']; $profile_image_classnames = 'e-contact-buttons__profile-image'; if ( ! empty( $profile_image_size ) ) { $profile_image_classnames .= ' has-size-' . $profile_image_size; } if ( 'yes' === $display_profile_dot ) { $profile_image_classnames .= ' has-dot'; } $top_bar_title = $this->settings['top_bar_title'] ?? ''; $top_bar_subtitle = $this->settings['top_bar_subtitle'] ?? ''; $has_top_bar_title = ! empty( $top_bar_title ); $has_top_bar_subtitle = ! empty( $top_bar_subtitle ); $this->widget->add_render_attribute( 'profile-image', [ 'class' => $profile_image_classnames, ] ); ?> settings['chat_button_show_animation']; ?> settings['message_bubble_name'] ?? ''; $message_bubble_body = $this->settings['message_bubble_body'] ?? ''; $has_message_bubble_name = ! empty( $message_bubble_name ); $has_message_bubble_body = ! empty( $message_bubble_body ); $time_format = $this->settings['chat_button_time_format']; ?> settings['chat_button_show_animation'] ?? false; $has_typing_animation = $show_animation && 'yes' === $show_animation; if ( $has_typing_animation ) { $message_bubble_classnames .= ' has-typing-animation'; } $this->widget->add_render_attribute( 'message-bubble', [ 'class' => $message_bubble_classnames, ] ); ?>