PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.8
Shortcodes and extra features for Phlox theme v2.5.8
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / contact-box.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 6 years ago accordion.php 6 years ago audio.php 6 years ago before-after.php 6 years ago button.php 6 years ago carousel-navigation.php 6 years ago contact-box.php 6 years ago contact-form.php 6 years ago custom-list.php 6 years ago divider.php 6 years ago gallery.php 6 years ago gmap.php 6 years ago heading-modern.php 6 years ago icon.php 6 years ago image.php 6 years ago mailchimp.php 6 years ago modern-button.php 6 years ago quote.php 6 years ago recent-comments.php 6 years ago recent-posts-grid-carousel.php 6 years ago recent-posts-land-style.php 6 years ago recent-posts-masonry.php 6 years ago recent-posts-tiles-carousel.php 6 years ago recent-posts-tiles.php 6 years ago recent-posts-timeline.php 6 years ago recent-products.php 6 years ago search.php 6 years ago staff.php 6 years ago svg.php 6 years ago tabs.php 6 years ago testimonial.php 6 years ago text.php 6 years ago touch-slider.php 6 years ago video.php 6 years ago
contact-box.php
411 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 /**
14 * Elementor 'ContactBox' widget.
15 *
16 * Elementor widget that displays an 'ContactBox' with lightbox.
17 *
18 * @since 1.0.0
19 */
20 class ContactBox extends Widget_Base {
21
22 /**
23 * Get widget name.
24 *
25 * Retrieve 'ContactBox' widget name.
26 *
27 * @since 1.0.0
28 * @access public
29 *
30 * @return string Widget name.
31 */
32 public function get_name() {
33 return 'aux_contactbox';
34 }
35
36 /**
37 * Get widget title.
38 *
39 * Retrieve 'ContactBox' widget title.
40 *
41 * @since 1.0.0
42 * @access public
43 *
44 * @return string Widget title.
45 */
46 public function get_title() {
47 return __('Contact Box', 'auxin-elements' );
48 }
49
50 /**
51 * Get widget icon.
52 *
53 * Retrieve 'ContactBox' widget icon.
54 *
55 * @since 1.0.0
56 * @access public
57 *
58 * @return string Widget icon.
59 */
60 public function get_icon() {
61 return 'eicon-image-hotspot auxin-badge';
62 }
63
64 /**
65 * Get widget categories.
66 *
67 * Retrieve 'ContactBox' widget icon.
68 *
69 * @since 1.0.0
70 * @access public
71 *
72 * @return string Widget icon.
73 */
74 public function get_categories() {
75 return array( 'auxin-core' );
76 }
77
78 /**
79 * Register 'ContactBox' widget controls.
80 *
81 * Adds different input fields to allow the user to change and customize the widget settings.
82 *
83 * @since 1.0.0
84 * @access protected
85 */
86 protected function _register_controls() {
87
88 /*-----------------------------------------------------------------------------------*/
89 /* Contact Info section
90 /*-----------------------------------------------------------------------------------*/
91
92 $this->start_controls_section(
93 'contactinfo_section',
94 array(
95 'label' => __('Contact Info', 'auxin-elements' )
96 )
97 );
98
99 $this->add_control(
100 'email',
101 array(
102 'label' => __('Email','auxin-elements'),
103 'description' => __('Contact box email address.', 'auxin-elements'),
104 'type' => Controls_Manager::TEXT,
105 'input_type' => 'email'
106 )
107 );
108
109 $this->add_control(
110 'telephone',
111 array(
112 'label' => __('Telephone','auxin-elements'),
113 'description' => __('Contact box phone number.', 'auxin-elements'),
114 'type' => Controls_Manager::TEXT
115 )
116 );
117
118 $this->add_control(
119 'show_socials',
120 array(
121 'label' => __('Show site socials','auxin-elements'),
122 'description' => __('Show socials below the info.','auxin-elements'),
123 'type' => Controls_Manager::SWITCHER,
124 'label_on' => __( 'On', 'auxin-elements' ),
125 'label_off' => __( 'Off', 'auxin-elements' ),
126 'default' => 'yes'
127 )
128 );
129
130 $this->add_control(
131 'address',
132 array(
133 'label' => __('Address','auxin-elements'),
134 'type' => Controls_Manager::TEXTAREA,
135 'placeholder' => __( 'Type your address here', 'auxin-elements')
136 )
137 );
138
139 $this->end_controls_section();
140
141
142 $this->start_controls_section(
143 'map_section',
144 array(
145 'label' => __('Map', 'auxin-elements' )
146 )
147 );
148
149 $this->add_control(
150 'show_map',
151 array(
152 'label' => __('Show map','auxin-elements'),
153 'description' => __('Show map above the info.','auxin-elements'),
154 'type' => Controls_Manager::SWITCHER,
155 'label_on' => __( 'On', 'auxin-elements' ),
156 'label_off' => __( 'Off', 'auxin-elements' ),
157 'default' => 'yes'
158 )
159 );
160
161 $this->add_control(
162 'map_position',
163 array(
164 'label' => __('Map position','auxin-elements'),
165 'description' => __('Whether to show map above the contact details or below them.', 'auxin-elements'),
166 'label_block' => true,
167 'type' => Controls_Manager::SELECT,
168 'default' => 'down',
169 'options' => array(
170 'down' => __('Below the contact details.', 'auxin-elements' ),
171 'up' => __('Above the contact details.', 'auxin-elements' )
172 ),
173 'return_value' => 'down',
174 'condition' => array(
175 'show_map' => 'yes'
176 )
177 )
178 );
179
180 $this->add_responsive_control(
181 'height',
182 array(
183 'label' => __( 'Map height', 'auxin-elements' ),
184 'type' => Controls_Manager::SLIDER,
185 'size_units' => array('px','em'),
186 'desktop_default' => array(
187 'size' => 160,
188 'unit' => 'px'
189 ),
190 'range' => array(
191 'px' => array(
192 'min' => 0,
193 'max' => 1600,
194 'step' => 1
195 ),
196 'em' => array(
197 'min' => 1,
198 'max' => 100,
199 'step' => 0.1
200 )
201 ),
202 'selectors' => array(
203 '{{WRAPPER}} .aux-map-wrapper' => 'height:{{SIZE}}{{UNIT}} !important;'
204 ),
205 'return_value' => 160,
206 'condition' => array(
207 'show_map' => 'yes'
208 )
209 )
210 );
211
212 $this->add_control(
213 'latitude',
214 array(
215 'label' => __( 'Latitude', 'auxin-elements' ),
216 'description' => __('Latitude location over the map.', 'auxin-elements'),
217 'type' => Controls_Manager::SLIDER,
218 'size_units' => array('px'),
219 'default' => array(
220 'size' => 40.7,
221 'unit' => 'px'
222 ),
223 'range' => array(
224 'px' => array(
225 'min' => -90,
226 'max' => 90,
227 'step' => 0.01
228 )
229 ),
230 'return_value' => 40.7,
231 'condition' => array(
232 'show_map' => 'yes'
233 )
234 )
235 );
236
237 $this->add_control(
238 'longitude',
239 array(
240 'label' => __('Longitude','auxin-elements'),
241 'description' => __('Longitude location over the map.', 'auxin-elements'),
242 'type' => Controls_Manager::SLIDER,
243 'size_units' => array('px'),
244 'default' => array(
245 'size' => -74,
246 'unit' => 'px'
247 ),
248 'range' => array(
249 'px' => array(
250 'min' => -180,
251 'max' => 180,
252 'step' => 0.01
253 )
254 ),
255 'return_value' => -74,
256 'condition' => array(
257 'show_map' => 'yes'
258 )
259 )
260 );
261
262 $this->add_control(
263 'type',
264 array(
265 'label' => __('Map type','auxin-elements'),
266 'label_block' => true,
267 'type' => Controls_Manager::SELECT,
268 'default' => 'ROADMAP',
269 'options' => array(
270 'ROADMAP' => __('ROADMAP', 'auxin-elements'),
271 'SATELLITE' => __('SATELLITE', 'auxin-elements')
272 ),
273 'return_value' => 'ROADMAP',
274 'condition' => array(
275 'show_map' => 'yes'
276 )
277 )
278 );
279
280 $this->add_control(
281 'style',
282 array(
283 'label' => __('Map style','auxin-elements'),
284 'description' => __('This feild allows you to customize the presentation of the standard Google base maps. You can find many preset styles in ', 'auxin-elements') .'<a href="https://snazzymaps.com/" target="_blank">' . __('this website.', 'auxin-elements') . '</a>' ,
285 'type' => Controls_Manager::CODE,
286 'condition' => array(
287 'show_map' => 'yes'
288 )
289 )
290 );
291
292 $this->add_control(
293 'marker_info',
294 array(
295 'label' => __('Marker info','auxin-elements'),
296 'description' => __('Marker popup text, leave it empty if you don\'t need it.', 'auxin-elements'),
297 'type' => Controls_Manager::TEXT,
298 'condition' => array(
299 'show_map' => 'yes'
300 )
301 )
302 );
303
304 $this->add_control(
305 'show_mapcontrols',
306 array(
307 'label' => __('Navigation control','auxin-elements'),
308 'description' => __('Show nacigation control on map.','auxin-elements'),
309 'type' => Controls_Manager::SWITCHER,
310 'label_on' => __( 'On', 'auxin-elements' ),
311 'label_off' => __( 'Off', 'auxin-elements' ),
312 'default' => 'no',
313 'condition' => array(
314 'show_map' => 'yes'
315 )
316 )
317 );
318
319 $this->add_control(
320 'zoom',
321 array(
322 'label' => __('Zoom','auxin-elements'),
323 'description' => __('The initial resolution at which to display the map, between 1 to 20.', 'auxin-elements'),
324 'type' => Controls_Manager::SLIDER,
325 'size_units' => array('px'),
326 'default' => array(
327 'size' => 10,
328 'unit' => 'px'
329 ),
330 'range' => array(
331 'px' => array(
332 'min' => 0,
333 'max' => 20,
334 'step' => 0.1
335 )
336 ),
337 'return_value' => 10,
338 'condition' => array(
339 'show_map' => 'yes'
340 )
341 )
342 );
343
344 $this->add_control(
345 'zoom_wheel',
346 array(
347 'label' => __('Zoom with mouse wheel','auxin-elements'),
348 'type' => Controls_Manager::SWITCHER,
349 'label_on' => __( 'On', 'auxin-elements' ),
350 'label_off' => __( 'Off', 'auxin-elements' ),
351 'default' => 'no',
352 'condition' => array(
353 'show_map' => 'yes'
354 )
355 )
356 );
357
358 $this->end_controls_section();
359
360
361 /*-----------------------------------------------------------------------------------*/
362 /* Style Tab
363 /*-----------------------------------------------------------------------------------*/
364
365 /* Color Section
366 /*-------------------------------------*/
367
368 $this->start_controls_section(
369 'color_section',
370 array(
371 'label' => __( 'Color', 'auxin-elements' ),
372 'tab' => Controls_Manager::TAB_STYLE
373 )
374 );
375
376 $this->end_controls_section();
377 }
378
379 /**
380 * Render 'ContactBox' widget output on the frontend.
381 *
382 * @access protected
383 */
384 protected function render() {
385
386 $settings = $this->get_settings_for_display();
387
388 $args = array(
389 'style' => $settings['style'],
390 'show_map' => $settings['show_map'],
391 'map_position' => $settings['map_position'],
392 'show_socials' => $settings['show_socials'],
393 'email' => $settings['email'],
394 'telephone' => $settings['telephone'],
395 'address' => $settings['address'],
396 'type' => $settings['type'],
397 'zoom' => $settings['zoom']['size'],
398 'zoom_wheel' => $settings['zoom_wheel'],
399 'marker_info' => $settings['marker_info'],
400 'show_mapcontrols' => $settings['show_mapcontrols'],
401 'latitude' => $settings['latitude']['size'],
402 'longitude' => $settings['longitude']['size'],
403 'height' => $settings['height']['size']
404 );
405
406 // pass the args through the corresponding shortcode callback
407 echo auxin_widget_contact_box( $args );
408 }
409
410 }
411