PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.3.65
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.3.65
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / public / admin / widgets / class-elementormeeting.php

class-elementormeeting.php in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.3.65, at public/admin/widgets/class-elementormeeting.php

131 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Leadin\admin\widgets;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6
7 /**
8 * ElementorMeeting Widget
9 */
10 class ElementorMeeting extends Widget_Base {
11
12 /**
13 * Widget internal name.
14 */
15 public function get_name() {
16 return 'hubspot-meeting';
17 }
18
19 /**
20 * Widget title.
21 */
22 public function get_title() {
23 return esc_html( 'HubSpot Meeting' );
24 }
25
26 /**
27 * Widget display icon.
28 */
29 public function get_icon() {
30 return 'eicon-calendar';
31 }
32
33 /**
34 * Widget help url.
35 */
36 public function get_custom_help_url() {
37 return 'https://wordpress.org/support/plugin/leadin/';
38 }
39
40 /**
41 * Widget category.
42 */
43 public function get_categories() {
44 return array( 'general', 'hubspot' );
45 }
46
47 /**
48 * Widget keywords.
49 */
50 public function get_keywords() {
51 return array( 'hubspot', 'meeting', 'leadin' );
52 }
53
54 /**
55 * Widget style.
56 */
57 public function get_style_depends() {
58 wp_register_style( 'leadin-elementor', LEADIN_JS_BASE_PATH . '/elementor.css', array(), LEADIN_PLUGIN_VERSION );
59 wp_register_style( 'leadin-css', LEADIN_ASSETS_PATH . '/style/leadin.css', array(), LEADIN_PLUGIN_VERSION );
60 return array( 'leadin-elementor', 'leadin-css' );
61 }
62
63 /**
64 * Widget script.
65 */
66 public function get_script_depends() {
67 wp_register_script(
68 'leadin-meeting',
69 'https://static.hsappstatic.net/MeetingsEmbed/ex/MeetingsEmbedCode.js',
70 array(),
71 LEADIN_PLUGIN_VERSION,
72 true
73 );
74 return array( 'leadin-meeting' );
75 }
76
77 /**
78 * Widget controls.
79 */
80 protected function register_controls() {
81 $this->start_controls_section(
82 'content_section',
83 array(
84 'label' => esc_html( __( 'Meetings Scheduler', 'leadin' ) ),
85 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
86 )
87 );
88
89 $this->add_control(
90 'content',
91 array(
92 'type' => 'leadinmeetingselect',
93 )
94 );
95
96 $this->end_controls_section();
97 }
98
99 /**
100 * Render the widget
101 */
102 protected function render() {
103 $settings = $this->get_settings_for_display();
104 $content = $settings['content'];
105 $parsed_parameters = array(
106 'url' => isset( $content['url'] ) && filter_var( $content['url'], FILTER_VALIDATE_URL ) ? esc_url_raw( $content['url'] ) : '',
107 );
108
109 if ( Plugin::$instance->editor->is_edit_mode() ) {
110
111 ?>
112 <div class="hubspot-meeting-edit-mode" data-attributes=<?php echo esc_attr( json_encode( $parsed_parameters ) ); ?>>
113 &nbsp;
114 </div>
115
116 <?php
117 if ( empty( $parsed_parameters['url'] ) ) {
118 ?>
119 <div class="hubspot-widget-empty">
120
121 </div>
122 <?php
123 }
124 }
125
126 if ( ! empty( $parsed_parameters['url'] ) ) {
127 echo do_shortcode( '[hubspot url="' . $parsed_parameters['url'] . '" type="meeting"]' );
128 }
129 }
130 }
131