PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.31
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.31
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.0.31, at public/admin/widgets/class-elementormeeting.php

128 lines 2.4 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
106 if ( Plugin::$instance->editor->is_edit_mode() ) {
107 ?>
108 <div class="hubspot-meeting-edit-mode" data-attributes=<?php echo json_encode( $content ); ?>>
109 &nbsp;
110 </div>
111
112 <?php
113 if ( empty( $content ) ) {
114 ?>
115 <div class="hubspot-widget-empty">
116
117 </div>
118 <?php
119 }
120 }
121
122 if ( ! empty( $content ) ) {
123 $url = $content['url'];
124 echo do_shortcode( '[hubspot url="' . $url . '" type="meeting"]' );
125 }
126 }
127 }
128