PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 8.5.37
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v8.5.37
9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 All 222 releases
wpvr / admin / classes / class-wpvr-meta-field.php

class-wpvr-meta-field.php in WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress 8.5.37, at admin/classes/class-wpvr-meta-field.php

5,592 lines 218.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if (!defined('ABSPATH')) exit;
4
5 /**
6 * Responsible for managing WPVR meta fields
7 *
8 * @link http://rextheme.com/
9 * @since 8.0.0
10 *
11 * @package Wpvr
12 * @subpackage Wpvr/admin/classes
13 */
14
15
16 class WPVR_Meta_Field {
17
18 /**
19 * Constructor.
20 */
21 public function __construct(){
22
23 }
24
25 /**
26 * Initialize primary meta fields for a Tour
27 *
28 * @return array
29 * @since 8.0.0
30 */
31 public static function get_primary_meta_fields()
32 {
33 $meta_fields = array(
34 'panoid' => null,
35 'autoLoad' => 1,
36 'hfov' => null,
37 'maxHfov' => null,
38 'minHfov' => null,
39 'showControls' => 1,
40 'customcontrol' => null,
41 'preview' => null,
42 'defaultscene' => null,
43 'scenefadeduration' => null,
44 'panodata' => array(
45 'scene-list' => array(
46 array(
47 'scene-id' => null,
48 'scene-type' => 'equirectangular',
49 'hotspot-list' => array(
50 array(
51 'hotspot-title' => null,
52 'hotspot-pitch' => null,
53 'hotspot-yaw' => null,
54 'hotspot-customclass' => null,
55 'hotspot-scene' => null,
56 'hotspot-url' => null,
57 'hotspot-content' => null,
58 'hotspot-hover' => null,
59 'hotspot-type' => 'info',
60 'hotspot-scene-list' => 'none',
61 'wpvr_url_open' => array(
62 0 => 'off'
63 )
64 ),
65 ),
66 'dscene' => 'off',
67 'scene-attachment-url' => null,
68 ),
69 ),
70 ),
71 'previewtext' => 'Click To Load Panorama',
72 );
73 return apply_filters( 'extend_primary_meta_fields', $meta_fields );
74 }
75
76
77 /**
78 * Initialise Tab Navigation Items
79 * @return array
80 * @since 8.0.0
81 */
82 public static function get_navigation_fields() {
83 $fields = array(
84 array(
85 'class' => 'scene',
86 'screen' => 'scene',
87 'href' => 'scenes',
88 'r_src' => 'admin/icon/scenes-regular.png',
89 'h_src' => 'admin/icon/scenes-hover.png',
90 'title' => __('Scenes','wpvr'),
91 'active' => 'active'
92 ),
93 array(
94 'class' => 'hotspot',
95 'screen' => 'hotspot',
96 'href' => 'scenes',
97 'r_src' => 'admin/icon/hotspot-regular.png',
98 'h_src' => 'admin/icon/hotspot-hover.png',
99 'title' => __('Hotspot','wpvr'),
100 'active' => ''
101 ),
102 array(
103 'class' => 'general',
104 'screen' => 'general',
105 'href' => 'general',
106 'r_src' => 'admin/icon/general-regular.png',
107 'h_src' => 'admin/icon/general-hover.png',
108 'title' => __('Settings','wpvr'),
109 'active' => ''
110 ),
111 array(
112 'class' => 'videos',
113 'screen' => 'video',
114 'href' => 'video',
115 'r_src' => 'admin/icon/video-regular.png',
116 'h_src' => 'admin/icon/video-hover.png',
117 'title' => __('Video','wpvr'),
118 'active' => ''
119 ),
120 );
121 return apply_filters( 'extend_rex_pano_nav_menu', $fields );
122 }
123
124 /**
125 * Initialise Basic Setting Left Field
126 * @param mixed $preview
127 * @param mixed $previewtext
128 * @param mixed $autoload
129 * @param mixed $control
130 *
131 * @return array
132 * @since 8.0.0
133 */
134 public static function get_basic_setting_left_fields($postdata)
135 {
136 return array(
137 'preview-attachment-url' => array(
138 'class' => 'single-settings preview-setting',
139 'type' => 'preview_image',
140 'value' => $postdata['preview'],
141 'title' => __('Set a Tour Preview Image','wpvr'),
142 'have_tooltip' => true,
143 'tooltip_text' => array(
144 'text' => __('Upload an image that will be shown as the preview before the tour starts.', 'wpvr'),
145 'url' => 'https://rextheme.com/docs/wpvr-add-a-preview-image-virtual-tour-wpvr/'
146 ),
147 ),
148 'previewtext' => array(
149 'class' => 'single-settings preview-img-message',
150 'type' => 'preview_image_msg',
151 'value' => $postdata['previewtext'],
152 'have_tooltip' => true,
153 'title' => __('Preview Image Message','wpvr'),
154 'tooltip_text' => array(
155 'text' => __('Add a custom message that appears alongside the tour preview image.', 'wpvr'),
156 'url' => ''
157 ),
158
159 ),
160 'autoload' => array(
161 'class' => 'single-settings autoload',
162 'type' => 'basic_setting_checkbox',
163 'title' => __('Tour Autoload','wpvr'),
164 'id' => 'wpvr_autoload',
165 'have_tooltip' => true,
166 'tooltip_text' => array(
167 'text' => __('Automatically start the tour when the page is loaded without displaying the preview image.', 'wpvr'),
168 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#3-toc-title'
169 ),
170 'checked' => $postdata['autoLoad'],
171 ),
172
173 );
174 }
175
176 /**
177 * Initialize fields render method
178 * @param mixed $preview
179 * @param mixed $previewtext
180 * @param mixed $autoload
181 * @param mixed $control
182 *
183 * @return void
184 * @since 8.0.0
185 */
186 public static function render_basic_settings_left_fields($postdata)
187 {
188 $fields = self::get_basic_setting_left_fields($postdata);
189
190 foreach($fields as $name => $val) {
191 self::{ 'render_' . $val['type'] }( $name, $val );
192 }
193 }
194
195 /**
196 * Initilize Basic Setting Right Fields
197 * @param mixed $scene_fade_duration
198 * @param mixed $postdata
199 *
200 * @return array
201 * @since 8.0.0
202 */
203 public static function get_basic_setting_right_fields($postdata)
204 {
205 if(!isset($postdata['autoRotate'])){
206 $rotation = 0;
207 }else{
208 $rotation = 1;
209 }
210
211 $basic_setting_right_fields = array(
212 'controls' => array(
213 'class' => 'single-settings controls',
214 'type' => 'basic_setting_checkbox',
215 'title' => __('Basic Control Buttons','wpvr'),
216 'id' => 'wpvr_controls',
217 'have_tooltip' => true,
218 'tooltip_text' => array(
219 'text' => __('Enable basic navigation buttons like play, pause, and reset for easier control of the tour.', 'wpvr'),
220 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#4-toc-title'
221 ),
222 'checked' => $postdata['showControls'],
223 ),
224 'scene-fade-duration' => array(
225 'class' => 'single-settings scene-fade-duration',
226 'title' => __('Scene Fade Duration','wpvr'),
227 'type' => 'number_field',
228 'value' => $postdata['scenefadeduration'],
229 'placeholder' => null,
230 'have_tooltip' => true,
231 'tooltip_text' => array(
232 'text' => __('Set the duration (in milliseconds) for the fade effect between scenes.', 'wpvr'),
233 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#5-toc-title'
234 ),
235 ),
236 'autorotation' => array(
237 'class' => 'single-settings autoload has-children',
238 'title' => __('Auto Rotation','wpvr'),
239 'id' => 'wpvr_autorotation',
240 'type' => 'basic_setting_checkbox',
241 'checked' => $rotation,
242 'have_tooltip' => true,
243 'tooltip_text' => array(
244 'text' => __('Enable automatic rotation of the tour for continuous movement without user interaction.', 'wpvr'),
245 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#6-toc-title'
246 ),
247 ),
248 );
249
250 if (defined('MEPR_VERSION') || is_plugin_active( 'restrict-content-pro/restrict-content-pro.php' )) {
251 $post_id = isset($postdata['panoid']) ? str_replace("pano", "", $postdata['panoid']) : null;
252
253 if(!empty($post_id)){
254 $membership_access = get_post_meta($post_id, '_wpvr_allowed_roles_levels', true);
255 $basic_setting_right_fields['membership-access'] = array(
256 'class' =>'wpvr-membership-access',
257 'title' => __('Control Access to this Tour','wpvr'),
258 'type' => 'membership_access_name_select',
259 'id' => 'wpvr_membership_access',
260 'package' => 'pro',
261 'value' => $membership_access ?? 'none',
262 'placeholder' => null,
263 'have_tooltip' => true,
264 'tooltip_text' => __('This will set the scene fade effect and execution time.','wpvr'),
265 );
266 }
267
268 }
269 return apply_filters( 'extend_basic_setting_right_fields', $basic_setting_right_fields, $postdata );
270 }
271
272 /**
273 * Initilize Basic Setting Right Fields
274 * @param mixed $scene_fade_duration
275 * @param mixed $postdata
276 *
277 * @return array
278 * @since 8.0.0
279 */
280 public static function get_basic_setting_generic_form_fields($postdata)
281 {
282 $is_disable = apply_filters('is_wpvr_pro_active', false);
283
284 if(!isset($postdata['genericform'])){
285 $genericform = "off";
286 }else{
287 $genericform = $postdata['genericform'];
288 }
289
290 return array(
291 'genericform' => array(
292 'class' => 'single-settings genericform has-children',
293 'title' => __('Generic Form','wpvr'),
294 'id' => 'wpvr_generic_form',
295 'type' => 'generic_form_checkbox',
296 'checked' => $is_disable ? $genericform : 'off',
297 'is_disable' => $is_disable,
298 'have_tooltip' => true,
299 'tooltip_text' => array(
300 'text' => __('Enable this to add a form to the tour for user interaction.', 'wpvr'),
301 'url' => ''
302 ),
303 )
304 );
305 }
306
307 /**
308 * Initilize Basic Setting Right Fields
309 * @param mixed $scene_fade_duration
310 * @param mixed $postdata
311 *
312 * @return array
313 * @since 8.0.0
314 */
315 public static function get_basic_setting_call_to_action_fields($postdata)
316 {
317 $is_disable = apply_filters('is_wpvr_pro_active', false);
318 if(!isset($postdata['calltoaction'])){
319 $calltoaction = "off";
320 }else{
321 $calltoaction = $postdata['calltoaction'];
322 }
323
324 return array(
325 'calltoaction' => array(
326 'class' => 'single-settings calltoaction has-children',
327 'title' => __('Call To Action ','wpvr'),
328 'id' => 'wpvr_cal_to_action_form',
329 'type' => 'call_to_form_checkbox',
330 'checked' => $is_disable ? $calltoaction : 'off',
331 'is_disable' => $is_disable,
332 'have_tooltip' => true,
333 'tooltip_text' => array(
334 'text' => __('Add a call-to-action button that prompts users to take action during the tour.', 'wpvr'),
335 'url' => 'https://rextheme.com/docs/call-to-action-in-virtual-tour/'
336 ),
337 )
338 );
339 }
340
341 /**
342 * Initilize Basic Setting Right Fields
343 * @param mixed $scene_fade_duration
344 * @param mixed $postdata
345 *
346 * @return array
347 * @since 8.0.0
348 */
349 public static function get_basic_setting_custom_css_fields($postdata)
350 {
351 $is_disable = apply_filters('is_wpvr_pro_active', false);
352
353 if(!isset($postdata['customcss_enable'])){
354 $customcss_enable = "off";
355 }else{
356 $customcss_enable = $postdata['customcss_enable'];
357 }
358
359 return array(
360 'customcss' => array(
361 'class' => 'single-settings customcss-switcher has-children',
362 'title' => __('Custom CSS ','wpvr'),
363 'id' => 'wpvr_custom_css',
364 'type' => 'custom_css_form_checkbox',
365 'checked' => $is_disable ? $customcss_enable : 'off',
366 'is_disable' => $is_disable,
367 'have_tooltip' => true,
368 'tooltip_text' => array(
369 'text' => __('Add your own custom CSS styles to further personalize the look and feel of the tour.', 'wpvr'),
370 'url' => ''
371 ),
372 )
373 );
374 }
375
376 /**
377 * Render Basic Setting Right Fields
378 * @param mixed $scene_fade_duration
379 * @param mixed $postdata
380 *
381 * @return void
382 * @since 8.0.0
383 */
384 public static function render_basic_setting_generic_form_fields($postdata)
385 {
386 $fields = self::get_basic_setting_generic_form_fields($postdata);
387
388 foreach($fields as $name => $val) {
389 self::{ 'render_' . $val['type'] }( $name, $val );
390 }
391 }
392 /**
393 * Render Basic Setting Right Fields
394 * @param mixed $scene_fade_duration
395 * @param mixed $postdata
396 *
397 * @return void
398 * @since 8.0.0
399 */
400 public static function render_basic_setting_call_to_action_fields($postdata)
401 {
402 $fields = self::get_basic_setting_call_to_action_fields($postdata);
403 foreach($fields as $name => $val) {
404 self::{ 'render_' . $val['type'] }( $name, $val );
405 }
406 }
407 /**
408 * Render Basic Setting Right Fields
409 * @param mixed $scene_fade_duration
410 * @param mixed $postdata
411 *
412 * @return void
413 * @since 8.0.0
414 */
415 public static function render_basic_setting_custom_css_fields($postdata)
416 {
417 $fields = self::get_basic_setting_custom_css_fields($postdata);
418 foreach($fields as $name => $val) {
419 self::{ 'render_' . $val['type'] }( $name, $val );
420 }
421 }
422
423 /**
424 * Render Basic Setting Right Fields
425 * @param mixed $scene_fade_duration
426 * @param mixed $postdata
427 *
428 * @return void
429 * @since 8.0.0
430 */
431 public static function render_basic_setting_right_fields($postdata)
432 {
433 $fields = self::get_basic_setting_right_fields($postdata);
434
435 foreach($fields as $name => $val) {
436 if('basic_setting_checkbox_for_scene_animation' === $val['type']){
437 self::{ 'render_' . $val['type'] }( $name, $val, $postdata );
438 } else{
439 self::{ 'render_' . $val['type'] }( $name, $val );
440 }
441 }
442 }
443
444
445 /**
446 * Initialize Autorotation Data Wrapper Fields
447 * @param mixed $autorotation
448 * @param mixed $autorotationinactivedelay
449 * @param mixed $autorotationstopdelay
450 *
451 * @return array
452 * @since 8.0.0
453 */
454 public static function get_autorotation_data_wrapper_fields($postdata)
455 {
456 return array(
457 'auto-rotation' => array(
458 'class' => 'single-settings autorotationdata',
459 'title' => __('Rotation Speed and Direction','wpvr'),
460 'type' => 'number_field',
461 'value' => isset($postdata['autoRotate']) ? $postdata['autoRotate'] : -5,
462 'placeholder' => -5,
463 'have_tooltip' => true,
464 'tooltip_text' => array(
465 'text' => __('Set the rotation speed, with positive values for anti-clockwise rotation and negative values for clockwise rotation.', 'wpvr'),
466 'url' => 'https://rextheme.com/docs/wp-vr-enable-auto-rotation-virtual-tour/'
467 ),
468 ),
469 'auto-rotation-inactive-delay' => array(
470 'class' => 'single-settings autorotationdata',
471 'title' => __('Resume Auto-rotation after','wpvr'),
472 'type' => 'number_field',
473 'value' => isset($postdata['autoRotateInactivityDelay']) ? $postdata['autoRotateInactivityDelay'] : null,
474 'placeholder' => 2000,
475 'have_tooltip' => true,
476 'tooltip_text' => array(
477 'text' => __('Define the time (in milliseconds) after which auto-rotation will resume once the user clicks on the tour.', 'wpvr'),
478 'url' => 'https://rextheme.com/docs/wp-vr-enable-auto-rotation-virtual-tour/'
479 ),
480 ),
481 'auto-rotation-stop-delay' => array(
482 'class' => 'single-settings autorotationdata',
483 'title' => __('Stop Auto-rotation after','wpvr'),
484 'type' => 'number_field',
485 'value' => isset($postdata['autoRotateStopDelay']) ? $postdata['autoRotateStopDelay'] : null,
486 'placeholder' => 2000,
487 'have_tooltip' => true,
488 'tooltip_text' => array(
489 'text' => __('Set the time (in milliseconds) after which the auto-rotation will stop automatically.', 'wpvr'),
490 'url' => 'https://rextheme.com/docs/wp-vr-enable-auto-rotation-virtual-tour/'
491 ),
492 ),
493 );
494 }
495
496
497 /**
498 * Initialize Scene Animation Transition Data Wrapper Fields
499 * @param mixed $sceneAnimationName
500 * @param mixed $sceneAnimationTransitionDuration
501 * @param mixed $sceneAnimationTransitionDelay
502 *
503 * @return array
504 * @since 8.5.16
505 */
506 public static function get_scene_animation_transition_data_wrapper_fields($postdata)
507 {
508 return array(
509 'scene-animation-name' => array(
510 'class' => 'single-settings scene-animation-name',
511 'title' => __('Select Transition Style','wpvr'),
512 'type' => 'animation_name_select',
513 'id' => 'wpvr_scene_animation_name',
514 'package' => 'pro',
515 'value' => isset($postdata['sceneAnimationName']) ? $postdata['sceneAnimationName'] : 'none',
516 'placeholder' => null,
517 'have_tooltip' => true,
518 'tooltip_text' => array(
519 'text' => __('This will set the scene fade effect and execution time.', 'wpvr'),
520 'url' => ''
521 ),
522 ),
523 'scene-animation-transition-duration' => array(
524 'class' => 'single-settings autorotationdata scene-animation-transition-duration',
525 'title' => __('Scene Transition Duration (ms)','wpvr'),
526 'type' => 'number_field',
527 'id' => 'wpvr_scene_animation_transition_duration',
528 'package' => 'pro',
529 'value' => isset($postdata['sceneAnimationTransitionDuration']) ? $postdata['sceneAnimationTransitionDuration'] : '500',
530 'placeholder' => null,
531 'have_tooltip' => true,
532 'tooltip_text' => array(
533 'text' => __('Set the duration for scene transition animations in milliseconds (default: 500 ms).', 'wpvr'),
534 'url' => ''
535 ),
536
537 ),
538 'scene-animation-transition-delay' => array(
539 'class' => 'single-settings autorotationdata scene-animation-transition-delay',
540 'title' => __('Add Animation Delay (ms)','wpvr'),
541 'type' => 'number_field',
542 'id' => 'wpvr_scene_animation_transition_delay',
543 'package' => 'pro',
544 'value' => isset($postdata['sceneAnimationTransitionDelay']) ? $postdata['sceneAnimationTransitionDelay'] : '0',
545 'placeholder' => null,
546 'have_tooltip' => true,
547 'have_tooltip' => true,
548 'tooltip_text' => array(
549 'text' => __('Set the delay before the scene transition animation starts (default: 0 ms).', 'wpvr'),
550 'url' => ''
551 ),
552 ),
553 );
554 }
555
556 public static function get_generic_form_associate_fields($postdata)
557 {
558 return array(
559 'genericformshortcode' => array(
560 'class' => 'single-settings genericformshortcode',
561 'title' => __('Add Form Shortcode','wpvr'),
562 'type' => 'text_field',
563 'value' => isset($postdata['genericformshortcode']) ? $postdata['genericformshortcode'] : "",
564 'placeholder' => "",
565 'have_tooltip' => true,
566 'tooltip_text' => array(
567 'text' => __('Insert the shortcode for the form you want to display in the tour.', 'wpvr'),
568 'url' => ''
569 ),
570 ),
571 );
572 }
573
574
575 public static function get_call_to_action_associate_fields($postdata)
576 {
577 return array(
578 'buttontext' => array(
579 'class' => 'single-settings buttontext',
580 'title' => __('Button Text','wpvr'),
581 'type' => 'text_field',
582 'value' => isset($postdata['buttontext']) ? $postdata['buttontext'] : "Click Here",
583 'placeholder' => "",
584 'have_tooltip' => true,
585 'tooltip_text' => array(
586 'text' => __('Customize the text displayed on the call-to-action button.', 'wpvr'),
587 'url' => 'https://rextheme.com/docs/call-to-action-in-virtual-tour/'
588 ),
589
590 ),'buttonurl' => array(
591 'class' => 'single-settings buttonurl',
592 'title' => __('Button URL','wpvr'),
593 'type' => 'text_field',
594 'value' => isset($postdata['buttonurl']) ? $postdata['buttonurl'] : "",
595 'placeholder' => "Button URL",
596 'have_tooltip' => true,
597 'tooltip_text' => array(
598 'text' => __('Set the link the call-to-action button will direct users to when clicked.', 'wpvr'),
599 'url' => 'https://rextheme.com/docs/call-to-action-in-virtual-tour/'
600 ),
601 ),
602 'button_configuration' => array(
603 'class' => 'single-settings button_configuration',
604 'title' => __('Button Style','wpvr'),
605 'name' => 'button_configuration_field',
606 'type' => 'button_configuration_field',
607 'value' => isset($postdata['button_configuration']) ? $postdata['button_configuration'] : array(),
608 'placeholder' => "",
609 'have_tooltip' => true,
610 'tooltip_text' => __('Print the forms shortcode you want to show.','wpvr'),
611 ),
612
613 );
614 }
615
616 public static function get_custom_css_associate_fields($postdata)
617 {
618 return array(
619 'customcss' => array(
620 'class' => 'single-settings customcss',
621 'title' => __('Custom CSS','wpvr'),
622 'type' => 'text_area_field',
623 'code_mirror_id' => 'code-mirror-editor-custom-css',
624 'value' => isset($postdata['customcss']) ? $postdata['customcss'] : "",
625 'placeholder' => "",
626 'have_tooltip' => true,
627 )
628
629 );
630 }
631
632 /**
633 * Render generic form associate fields
634 * @param mixed $genericformshortcode
635 *
636 * @return void
637 * @since 8.0.0
638 */
639 public static function render_generic_form_associate_fields($postdata)
640 {
641 $fields = self::get_generic_form_associate_fields($postdata);
642
643 foreach($fields as $name => $val) {
644 self::{ 'render_' . $val['type'] }( $name, $val );
645 }
646 }
647
648 /**
649 * Render generic form associate fields
650 * @param mixed $genericformshortcode
651 *
652 * @return void
653 * @since 8.0.0
654 */
655 public static function render_call_to_action_associate_fields($postdata)
656 {
657 $fields = self::get_call_to_action_associate_fields($postdata);
658
659 foreach($fields as $name => $val) {
660 self::{ 'render_' . $val['type'] }( $name, $val );
661 }
662 }
663
664 /**
665 * Render generic form associate fields
666 * @param mixed $genericformshortcode
667 *
668 * @return void
669 * @since 8.0.0
670 */
671 public static function render_custom_css_associate_fields($postdata)
672 {
673 $fields = self::get_custom_css_associate_fields($postdata);
674
675 foreach($fields as $name => $val) {
676 self::{ 'render_' . $val['type'] }( $name, $val );
677 }
678 }
679
680
681 /**
682 * Render Autorotation Data Wrapper Fields
683 * @param mixed $autorotation
684 * @param mixed $autorotationinactivedelay
685 * @param mixed $autorotationstopdelay
686 *
687 * @return void
688 * @since 8.0.0
689 */
690 public static function render_autorotation_data_wrapper_fields($postdata)
691 {
692 $fields = self::get_autorotation_data_wrapper_fields($postdata);
693 foreach($fields as $name => $val) {
694 self::{ 'render_' . $val['type'] }( $name, $val );
695 }
696 }
697
698
699 /**
700 * Render Scene Animation Transition Data Wrapper Fields
701 * @param mixed $sceneAnimationName
702 * @param mixed $sceneAnimationTransitionDuration
703 * @param mixed $sceneAnimationTransitionDelay
704 *
705 * @return void
706 * @since 8.5.16
707 */
708 public static function render_scene_animation_transition_data_wrapper_fields($postdata)
709 {
710 $fields = self::get_scene_animation_transition_data_wrapper_fields($postdata);
711
712 foreach($fields as $name => $val) {
713 self::{ 'render_' . $val['type'] }( $name, $val );
714 }
715 }
716
717
718 /**
719 * Render Tab Navigation
720 * @return void
721 * @since 8.0.0
722 */
723 public static function render_pano_tab_nav($postdata) {
724 $fields = self::get_navigation_fields();
725 ob_start();
726 ?>
727
728 <nav class="rex-pano-tab-nav rex-pano-nav-menu main-nav" id="wpvr-main-nav">
729 <ul>
730 <li class="logo"><img loading="lazy" src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/wpvr-logo.svg'; ?>" alt="logo" /></li>
731
732 <?php foreach($fields as $field) { ?>
733
734 <li class="<?= $field['class']; ?> <?= $field['active']; ?>" data-screen="<?= $field['screen']; ?>">
735 <span data-href="#<?= $field['href']; ?>">
736 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . $field['r_src']; ?>" alt="icon" class="regular" />
737 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . $field['h_src']; ?>" alt="icon" class="hover" />
738 <?= __($field['title'], 'wpvr'); ?> </span>
739 </li>
740
741 <?php }
742
743 if(!is_plugin_active('wpvr-pro/wpvr-pro.php')){
744 ?>
745
746 <li class="floor-plan floor-plan-pro-tag" data-screen="floorPlan">
747 <div class="navigator-pro-tag"><?php echo __('pro', 'wpvr');?></div>
748 <span data-href="#floorPlan">
749 <img src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/map.svg'; ?>" alt="icon" class="regular">
750 <img src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/map-hover.svg'; ?>" alt="icon" class="hover">
751 <?php echo __('Floor Plan', 'wpvr');?>
752 </span>
753 </li>
754
755 <li class="background-tour background-tour-pro-tag" data-screen="backgroundTour">
756 <div class="navigator-pro-tag"><?php echo __('pro', 'wpvr');?></div>
757 <span data-href="#backgroundTour">
758 <img src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/bg-tour-regular.png';?>" alt="icon" class="regular">
759 <img src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/bg-tour-hover.png'; ?>" alt="icon" class="hover">
760 <?php echo __('Background Tour', 'wpvr');?>
761 </span>
762 </li>
763
764 <li class="streetview streetview-pro-tag " data-screen="streetview">
765 <div class="navigator-pro-tag"><?php echo __('pro', 'wpvr');?></div>
766 <span data-href="#streetview">
767 <img src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/street-view-regular.png';?>" alt="icon" class="regular">
768 <img src="<?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/street-view-hover.png';?>" alt="icon" class="hover">
769 <?php echo __('Street View', 'wpvr');?>
770 </span>
771 </li>
772
773 <li class="export export-pro-tag" data-screen="export">
774 <div class="navigator-pro-tag"><?php echo __('pro', 'wpvr');?></div>
775 <span data-href="#import">
776 <img loading="lazy" src=" <?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/export-regular.png'; ?> " alt="icon" class="regular" />
777 <img loading="lazy" src=" <?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/export-hover.png'; ?> " alt="icon" class="hover" />
778 <?php echo __('Export', 'wpvr'); ?>
779 </span>
780 </li>
781
782 <?php
783 }
784
785 //== Render Export Tab for Tour edit ==//
786 if(is_plugin_active( 'wpvr-pro/wpvr-pro.php' )) { if (isset($postdata['panoid'])) { ?>
787 <li class="export" data-screen="export">
788 <span data-href="#import">
789 <img loading="lazy" src=" <?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/export-regular.png'; ?> " alt="icon" class="regular" />
790 <img loading="lazy" src=" <?php echo WPVR_PLUGIN_DIR_URL . 'admin/icon/export-hover.png'; ?> " alt="icon" class="hover" />
791 <?php echo __('Export', 'wpvr'); ?>
792 </span>
793 </li>
794 <?php } } ?>
795
796 </ul>
797 </nav>
798
799 <?php
800 ob_end_flush();
801 }
802
803
804 /**
805 * Initialise Advanced Settings Left Fields
806 * @return array
807 * @since 8.0.0
808 */
809 public static function get_advanced_settings_left_fields($postdata)
810 {
811 $fields = array(
812 'diskeyboard' => array(
813 'class' => 'single-settings compass',
814 'title' => __('Keyboard Movement Control','wpvr'),
815 'id' => 'wpvr_diskeyboard',
816 'have_tooltip' => true,
817 'tooltip_text' => array(
818 'text' => __('Use arrow keys or WASD keys to move through the virtual tour.', 'wpvr'),
819 'url' => 'https://rextheme.com/docs/wp-vr-limit-keyboard-controls-for-navigation-and-zoom/#0-toc-title'
820 ),
821 'type' => 'checkbox'
822 ),
823 'keyboardzoom' => array(
824 'class' => 'single-settings keyboard-zoom',
825 'title' => __('Keyboard Zoom Control','wpvr'),
826 'id' => 'wpvr_keyboardzoom',
827 'have_tooltip' => true,
828 'tooltip_text' => array(
829 'text' => __('Zoom in and out of the virtual tour using keyboard shortcuts.', 'wpvr'),
830 'url' => 'https://rextheme.com/docs/wp-vr-limit-keyboard-controls-for-navigation-and-zoom/#4-toc-title'
831 ),
832 'type' => 'checkbox'
833 ),
834 'draggable' => array(
835 'class' => 'single-settings has-children',
836 'title' => __('Mouse Drag Control','wpvr'),
837 'id' => 'wpvr_draggable',
838 'have_tooltip' => true,
839 'tooltip_text' => array(
840 'text' => __('Click and drag with your mouse to look around and navigate the virtual tour.', 'wpvr'),
841 'url' => 'https://rextheme.com/docs/wp-vr-limit-mouse-scroll-to-zoom-drag-to-move/#8-toc-title'
842 ),
843 'type' => 'checkbox'
844 ),
845 'mouseZoom' => array(
846 'class' => 'single-settings',
847 'title' => __('Mouse Zoom Control','wpvr'),
848 'id' => 'wpvr_mouseZoom',
849 'have_tooltip' => true,
850 'tooltip_text' => array(
851 'text' => __('Use your mouse wheel to zoom in and out smoothly within the virtual tour.', 'wpvr'),
852 'url' => 'https://rextheme.com/docs/wp-vr-limit-mouse-scroll-to-zoom-drag-to-move/#1-toc-title'
853 ),
854 'type' => 'checkbox'
855 ),
856 'gyro' => array(
857 'class' => 'single-settings gyro',
858 'title' => __('Gyroscope Control','wpvr'),
859 'id' => 'wpvr_gyro',
860 'have_tooltip' => true,
861 'tooltip_text' => array(
862 'text' => __('Move your mobile device to explore the tour using built-in motion sensors.', 'wpvr'),
863 'url' => 'https://rextheme.com/docs/wp-vr-gyroscope-support/'
864 ),
865 'type' => 'checkbox'
866 ),
867 'deviceorientationcontrol' => array(
868 'class' => 'single-settings orientation',
869 'title' => __('Auto Gyroscope Support','wpvr'),
870 'id' => 'wpvr_deviceorientationcontrol',
871 'have_tooltip' => true,
872 'tooltip_text' => array(
873 'text' => __('Automatically activate device orientation control if enabled, or manually trigger it with a button.', 'wpvr'),
874 'url' => 'https://rextheme.com/docs/wp-vr-gyroscope-support/'
875 ),
876 'type' => 'checkbox'
877 ),
878 'compass' => array(
879 'class' => 'single-settings compass',
880 'title' => __('Compass','wpvr'),
881 'id' => 'wpvr_compass',
882 'have_tooltip' => true,
883 'tooltip_text' => array(
884 'text' => __('Display a directional guide to keep track of your orientation while navigating the virtual tour.', 'wpvr'),
885 'url' => 'https://rextheme.com/docs/wp-vr-exclusive-features-general-settings/#11-toc-title'
886 ),
887 'type' => 'checkbox'
888 ),
889 );
890 return apply_filters( 'modify_advanced_control_left_fields', $fields, $postdata );
891 }
892
893
894 /**
895 * Initialise Advanced Settings Right Fields
896 * @return array
897 * @since 8.0.0
898 */
899 public static function get_advanced_settings_right_fields($postdata)
900 {
901 $fields = array(
902 'vrgallery' => array(
903 'class' => 'single-settings gallery',
904 'title' => __('Scene Gallery','wpvr'),
905 'id' => 'wpvr_vrgallery',
906 'type' => 'checkbox',
907 'have_tooltip' => true,
908 'tooltip_text' => array(
909 'text' => __('Show a gallery of all scenes, allowing users to easily navigate by clicking on thumbnails.', 'wpvr'),
910 'url' => 'https://rextheme.com/docs/wp-vr-scene-gallery/'
911 ),
912 ),
913 'vrgallery_title' => array(
914 'class' => 'single-settings',
915 'title' => __('Scene Titles on Gallery','wpvr'),
916 'id' => 'wpvr_vrgallery_title',
917 'type' => 'checkbox',
918 'have_tooltip' => true,
919 'tooltip_text' => array(
920 'text' => __('Display scene titles on each thumbnail in the Scene Gallery for better identification.', 'wpvr'),
921 'url' => 'https://rextheme.com/docs/wp-vr-scene-gallery/'
922 ),
923 ),
924 'vrscene_navigation' => array(
925 'class' => 'single-settings scene-navigation',
926 'title' => __('Scene Navigation Menu','wpvr'),
927 'id' => 'wpvr_scene_navigation',
928 'type' => 'checkbox',
929 'have_tooltip' => true,
930 'tooltip_text' => array(
931 'text' => __('Enable a menu to navigate through all scenes, allowing users to jump to a specific scene.', 'wpvr'),
932 'url' => ''
933 ),
934 ),
935 'bg_music' => array(
936 'class' => 'single-settings',
937 'title' => __('Tour Background Music','wpvr'),
938 'id' => 'wpvr_bg_music',
939 'type' => 'checkbox',
940 'have_tooltip' => true,
941 'tooltip_text' => array(
942 'text' => __('Add background music to your tour to enhance the user experience.', 'wpvr'),
943 'url' => 'https://rextheme.com/docs/wp-vr-add-background-music-virtual-tours/'
944 ),
945 ),
946 'explainerSwitch' => array(
947 'class' => 'single-settings company-info',
948 'title' => __('Enable explainer video','wpvr'),
949 'id' => 'wpvr_explainerSwitch',
950 'have_tooltip' => true,
951 'tooltip_text' => array(
952 'text' => __('Add an explainer video to the tour, providing additional context or details for users.', 'wpvr'),
953 'url' => 'https://rextheme.com/docs/set-explainer-videos-inside-virtual-tours/'
954 ),
955 'type' => 'checkbox',
956 ),
957 'globalzoom' => array(
958 'class' => 'single-settings',
959 'title' => __('Set Zoom Preferences','wpvr'),
960 'id' => 'wpvr_globalzoom',
961 'have_tooltip' => true,
962 'tooltip_text' => array(
963 'text' => __('Customize the zoom level for your tour, with options to adjust the view between 50 to 120 degrees.', 'wpvr'),
964 'url' => ''
965 ),
966 'type' => 'checkbox',
967 ),
968 'cpLogoSwitch' => array(
969 'class' => 'single-settings company-info',
970 'title' => __('Add Company Information','wpvr'),
971 'id' => 'wpvr_cpLogoSwitch',
972 'type' => 'checkbox',
973 'have_tooltip' => true,
974 'tooltip_text' => array(
975 'text' => __('Include your company logo and details within the tour to brand the experience.', 'wpvr'),
976 'url' => 'https://rextheme.com/docs/wp-vr-add-your-company-logo-virtual-tour/'
977 ),
978 )
979
980 );
981 return apply_filters( 'modify_advanced_control_right_fields', $fields, $postdata );
982 }
983
984
985 /**
986 * Initialize Scene setting left fields
987 * Panodata is empty
988 * @return array
989 * @since 8.0.0
990 */
991 public static function get_scene_left_fields_empty_panodata()
992 {
993 $fields = array(
994 'scene-type' => array(
995 'label_for' => 'scene-type',
996 'title' => __('Scene Type','wpvr'),
997 'input_class' => '',
998 'type' => 'text',
999 'value' => 'equirectangular',
1000 'disabled' => 'disabled',
1001 'have_tooltip' => true,
1002 'tooltip_text' => array(
1003 'text' => __('Choose the type of scene, such as Equirectangular or Cubemap.', 'wpvr-pro'),
1004 'url' => ''
1005 ),
1006
1007 ),
1008 'scene-attachment-url' => array(
1009 'title' => __('Scene Upload','wpvr'),
1010 'type' => 'upload',
1011 'value' => '',
1012 'display' => 'none',
1013 'have_tooltip' => true,
1014 'tooltip_text' => array(
1015 'text' => __('Upload an image to be used as the scene media (video is not supported).', 'wpvr-pro'),
1016 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/'
1017 ),
1018 ),
1019 'dscene' => array(
1020 'class' => 'scene-setting dscene',
1021 'title' => __('Set as Default','wpvr'),
1022 'type' => 'select',
1023 'select_class' => 'dscen',
1024 'selected' => 'off',
1025 'have_tooltip' => true,
1026 'tooltip_text' => array(
1027 'text' => __('Make this scene the first one that appears when the tour loads.', 'wpvr-pro'),
1028 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/'
1029 ),
1030 ),
1031 'scene-id' => array(
1032 'label_for' => 'scene-id',
1033 'title' => __('Scene ID','wpvr'),
1034 'input_class' => 'sceneid',
1035 'type' => 'text',
1036 'value' => '',
1037 'disabled' => 'disabled',
1038 'have_tooltip' => true,
1039 'tooltip_text' => array(
1040 'text' => __('Unique identifier for the scene, auto-generated if left empty.', 'wpvr-pro'),
1041 'url' => ''
1042 ),
1043 )
1044 );
1045
1046 return apply_filters( 'modify_scene_default_left_fields', $fields );
1047 }
1048
1049
1050 /**
1051 * Initilize Scene Settings left Fields
1052 * Panodata is not empty
1053 * @param mixed $dscene
1054 * @param mixed $scene_id
1055 * @param mixed $scene_photo
1056 *
1057 * @return array
1058 * @since 8.0.0
1059 */
1060 public static function get_scene_left_fields_with_panodata($pano_scene)
1061 {
1062 $fields = array(
1063 'scene-type' => array(
1064 'label_for' => 'scene-type',
1065 'title' => __('Scene Type','wpvr'),
1066 'input_class' => '',
1067 'type' => 'text',
1068 'value' => 'equirectangular',
1069 'disabled' => 'disabled',
1070 'have_tooltip' => true,
1071 'tooltip_text' => array(
1072 'text' => __('Choose the type of scene, such as Equirectangular or Cubemap.', 'wpvr'),
1073 'url' => ''
1074 ),
1075 ),
1076 'scene-attachment-url' => array(
1077 'title' => __('Scene Upload','wpvr'),
1078 'type' => 'upload',
1079 'value' => $pano_scene['scene-attachment-url'],
1080 'display' => 'block',
1081 'have_tooltip' => true,
1082 'tooltip_text' => array(
1083 'text' => __('Upload an image to be used as the scene media (video is not supported).', 'wpvr'),
1084 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/'
1085 ),
1086 ),
1087 'dscene' => array(
1088 'class' => 'scene-setting dscene',
1089 'title' => __('Set as Default','wpvr'),
1090 'type' => 'select',
1091 'select_class' => 'dscen',
1092 'selected' => $pano_scene['dscene'],
1093 'have_tooltip' => true,
1094 'tooltip_text' => array(
1095 'text' => __('Make this scene the first one that appears when the tour loads.', 'wpvr'),
1096 'url' => 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/'
1097 ),
1098 ),
1099 'scene-id' => array(
1100 'label_for' => 'scene-id',
1101 'title' => __('Scene ID','wpvr'),
1102 'input_class' => 'sceneid',
1103 'type' => 'text',
1104 'value' => $pano_scene['scene-id'],
1105 'disabled' => 'disabled',
1106 'have_tooltip' => true,
1107 'tooltip_text' => array(
1108 'text' => __('Unique identifier for the scene, auto-generated if left empty.', 'wpvr'),
1109 'url' => ''
1110 ),
1111 ),
1112 );
1113
1114 return apply_filters( 'modify_scene_left_fields', $fields, $pano_scene );
1115 }
1116
1117
1118 /**
1119 * Initialize Hotspot Settings Left Fields
1120 * @return array
1121 *
1122 * @since 8.0.0
1123 */
1124 public static function get_hotspot_left_fields($pano_hotspot)
1125 {
1126 $fields = array(
1127 'hotspot-title' => array(
1128 'title' => __('Hotspot ID','wpvr'),
1129 'value' => $pano_hotspot['hotspot-title'],
1130 'type' => 'text',
1131 'input_class' => '',
1132 'input_id' => 'hotspot-title',
1133 'have_tooltip' => true,
1134 'tooltip_text' => array(
1135 'text' => __('A unique identifier for the hotspot, auto-generated if left empty.', 'wpvr'),
1136 'url' => ''
1137 ),
1138
1139 ),
1140 'hotspot-pitch' => array(
1141 'title' => __('Pitch','wpvr'),
1142 'value' => $pano_hotspot['hotspot-pitch'],
1143 'type' => 'text',
1144 'input_class' => 'hotspot-pitch',
1145 'input_id' => '',
1146 'have_tooltip' => true,
1147 'tooltip_text' => array(
1148 'text' => __('Set the pitch angle for the hotspot’s vertical position in the scene.', 'wpvr'),
1149 'url' => ''
1150 ),
1151 ),
1152 'hotspot-yaw' => array(
1153 'title' => __('Yaw','wpvr'),
1154 'value' => $pano_hotspot['hotspot-yaw'],
1155 'type' => 'text',
1156 'input_class' => 'hotspot-yaw',
1157 'input_id' => '',
1158 'have_tooltip' => true,
1159 'tooltip_text' => array(
1160 'text' => __('Set the yaw angle for the hotspot’s horizontal position in the scene.', 'wpvr'),
1161 'url' => ''
1162 ),
1163 ),
1164 'hotspot-customclass' => array(
1165 'title' => __('Hotspot Custom Icon Class','wpvr'),
1166 'value' => $pano_hotspot['hotspot-customclass'],
1167 'type' => 'text',
1168 'input_class' => '',
1169 'input_id' => 'hotspot-customclass',
1170 'have_tooltip' => true,
1171 'tooltip_text' => array(
1172 'text' => __('Add a custom CSS class for the hotspot icon.', 'wpvr'),
1173 'url' => 'https://rextheme.com/docs/how-to-use-the-custom-icon-class/'
1174 ),
1175 ),
1176 );
1177 return apply_filters( 'modify_hotspot_left_fields', $fields, $pano_hotspot );
1178 }
1179
1180
1181 /**
1182 * Initialize Hotspot Setting Right Fields
1183 * @return array
1184 *
1185 * @since 8.0.0
1186 */
1187 public static function get_hotspot_right_fields()
1188 {
1189 $fields = array(
1190 'hotspot-type' => array(
1191 'title' => __('Hotspot-Type','wpvr'),
1192 'type' => 'info_type_select',
1193 ),
1194 'hotspot-url' => array(
1195 'title' => __('URL','wpvr'),
1196 'type' => 'info_url',
1197 'value' => '',
1198 'display' => 'block',
1199 'have_tooltip' => true,
1200 'tooltip_text' => array(
1201 'text' => __('Provide a URL that the hotspot will link to when clicked.', 'wpvr'),
1202 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1203 ),
1204 ),
1205 'wpvr_url_open' => array(
1206 'title' => __('Open in same tab','wpvr'),
1207 'type' => 'same_tab_checkbox',
1208 'value' => 'off',
1209 'display' => 'flex',
1210 'have_tooltip' => true,
1211 'tooltip_text' => array(
1212 'text' => __('Choose whether the URL opens in the same tab or a new tab.', 'wpvr'),
1213 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1214 ),
1215 ),
1216 'hotspot-content' => array(
1217 'class' => 'hotspot-content',
1218 'title' => __('On Click Content','wpvr'),
1219 'type' => 'textarea',
1220 'have_tooltip' => true,
1221 'tooltip_text' => array(
1222 'text' => __('Add custom content or actions that occur when the hotspot is clicked.', 'wpvr'),
1223 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1224 ),
1225 ),
1226 'hotspot-hover' => array(
1227 'class' => 'hotspot-hover',
1228 'title' => __('On Hover Content','wpvr'),
1229 'type' => 'textarea',
1230 'have_tooltip' => true,
1231 'tooltip_text' => array(
1232 'text' => __('Add custom content or actions that appear when the user hovers over the hotspot.', 'wpvr'),
1233 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1234 ),
1235 ),
1236 'hotspot-scene-list' => array(
1237 'title' => __('Select Target Scene from List','wpvr'),
1238 'type' => 'scene_select',
1239 'have_tooltip' => true,
1240 'tooltip_text' => array(
1241 'text' => __('Choose the target scene for the hotspot to navigate to.', 'wpvr'),
1242 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title'
1243 ),
1244 ),
1245 'hotspot-scene' => array(
1246 'title' => __('Target Scene ID','wpvr'),
1247 'display' => 'none',
1248 'input_class' => 'hotspotsceneinfodata',
1249 'type' => 'disabled_text',
1250 'value' => '',
1251 'have_tooltip' => true,
1252 'tooltip_text' => array(
1253 'text' => __('Provide the unique ID of the target scene.', 'wpvr'),
1254 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title'
1255 ),
1256 )
1257 );
1258 return apply_filters( 'modify_hotspot_right_fields', $fields );
1259 }
1260
1261
1262 /**
1263 * Initialize Hotspot Setting Info Fields
1264 *
1265 * @param mixed $hotspot_type
1266 * @param mixed $hotspot_url
1267 * @param mixed $hotspot_content
1268 * @param mixed $hotspot_hover
1269 *
1270 * @return array
1271 * @since 8.0.0
1272 */
1273 public static function get_hotspot_setting_info_fields($pano_hotspot)
1274 {
1275 $fields = array(
1276 'hotspot-type' => array(
1277 'title' => __('Hotspot-Type','wpvr'),
1278 'type' => 'info_type_select',
1279 ),
1280 'hotspot-url' => array(
1281 'title' => __('URL','wpvr'),
1282 'type' => 'info_url',
1283 'value' => $pano_hotspot['hotspot-url'],
1284 'display' => 'block',
1285 'have_tooltip' => true,
1286 'tooltip_text' => array(
1287 'text' => __('Provide a URL that the hotspot will link to when clicked.', 'wpvr'),
1288 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1289 ),
1290 ),
1291 'wpvr_url_open' => array(
1292 'title' => __('Open in same tab','wpvr'),
1293 'type' => 'same_tab_checkbox',
1294 'value' => isset($pano_hotspot['wpvr_url_open'][0]) ? $pano_hotspot['wpvr_url_open'][0] : 'off',
1295 'display' => 'flex',
1296 'have_tooltip' => true,
1297 'tooltip_text' => array(
1298 'text' => __('Choose whether the URL opens in the same tab or a new tab.', 'wpvr'),
1299 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1300 ),
1301 ),
1302 'hotspot-content' => array(
1303 'class' => 'hotspot-content',
1304 'title' => __('On Click Content','wpvr'),
1305 'type' => 'info_textarea',
1306 'value' => $pano_hotspot['hotspot-content'],
1307 'display' => 'block',
1308 'have_tooltip' => true,
1309 'tooltip_text' => array(
1310 'text' => __('Add custom content or actions that occur when the hotspot is clicked.', 'wpvr'),
1311 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1312 ),
1313 ),
1314 'hotspot-hover' => array(
1315 'class' => 'hotspot-hover tip',
1316 'title' => __('On Hover Content','wpvr'),
1317 'type' => 'info_textarea',
1318 'value' => $pano_hotspot['hotspot-hover'],
1319 'display' => 'block',
1320 'have_tooltip' => true,
1321 'tooltip_text' => array(
1322 'text' => __('Add custom content or actions that appear when the user hovers over the hotspot.', 'wpvr'),
1323 'url' => 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/'
1324 ),
1325 ),
1326 'hotspot-scene-list' => array(
1327 'title' => __('Select Target Scene from List','wpvr'),
1328 'type' => 'scene_list',
1329 'display' => 'none',
1330 'have_tooltip' => true,
1331 'tooltip_text' => array(
1332 'text' => __('Choose the target scene for the hotspot to navigate to.', 'wpvr'),
1333 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title'
1334 ),
1335 ),
1336 'hotspot-scene' => array(
1337 'title' => __('Target Scene ID','wpvr'),
1338 'display' => 'none',
1339 'input_class' => 'hotspotsceneinfodata',
1340 'type' => 'disabled_text',
1341 'value' => '',
1342 'have_tooltip' => true,
1343 'tooltip_text' => array(
1344 'text' => __('Provide the unique ID of the target scene.', 'wpvr'),
1345 'url' => 'https://rextheme.com/docs/wp-vr-set-default-scene-face/#3-toc-title'
1346 ),
1347
1348 )
1349 );
1350 return apply_filters( 'modify_hotspot_right_fields', $fields );
1351
1352 }
1353
1354 /**
1355 * Initialize Hotspot Setting Info Fields
1356 *
1357 * @param mixed $hotspot_type
1358 * @param mixed $hotspot_url
1359 * @param mixed $hotspot_content
1360 * @param mixed $hotspot_hover
1361 *
1362 * @return array
1363 * @since 8.0.0
1364 */
1365 public static function get_hotspot_setting_wc_product_fields($pano_hotspot)
1366 {
1367 $fields = array(
1368 'hotspot-type' => array(
1369 'title' => __('Hotspot-Type','wpvr'),
1370 'type' => 'wc_product_type',
1371 ),
1372 'hotspot-product-id' => array(
1373 'title' => __('Select your form','wpvr'),
1374 'type' => 'wc_product_select',
1375 'class' => 'wpvr-product-search',
1376 'value' => $pano_hotspot
1377 ),
1378 'hotspot-url' => array(
1379 'title' => __('URL','wpvr'),
1380 'type' => 'info_url',
1381 'value' => $pano_hotspot['hotspot-url'],
1382 'display' => 'none',
1383 ),
1384 'wpvr_url_open' => array(
1385 'title' => __('Open in same tab','wpvr'),
1386 'type' => 'same_tab_checkbox',
1387 'value' => isset($pano_hotspot['wpvr_url_open'][0]) ? $pano_hotspot['wpvr_url_open'][0] : 'off',
1388 'display' => 'none',
1389 ),
1390 'hotspot-content' => array(
1391 'class' => 'hotspot-content',
1392 'title' => __('On Click Content','wpvr'),
1393 'type' => 'info_textarea',
1394 'value' => $pano_hotspot['hotspot-content'],
1395 'display' => 'none',
1396 ),
1397 'hotspot-hover' => array(
1398 'class' => 'hotspot-hover',
1399 'title' => __('On Hover Content','wpvr'),
1400 'type' => 'info_textarea',
1401 'value' => $pano_hotspot['hotspot-hover'],
1402 'display' => 'block',
1403 ),
1404 'hotspot-scene-list' => array(
1405 'title' => __('Select Target Scene from List','wpvr'),
1406 'type' => 'scene_list',
1407 'display' => 'none',
1408 ),
1409 'hotspot-scene' => array(
1410 'title' => __('Target Scene ID','wpvr'),
1411 'display' => 'none',
1412 'input_class' => 'hotspotsceneinfodata',
1413 'type' => 'disabled_text',
1414 'value' => ''
1415 )
1416 );
1417 return apply_filters( 'modify_hotspot_right_fields', $fields );
1418
1419 }
1420 /**
1421 * Initialize Hotspot Setting Fluent form field Fields
1422 *
1423 * @param mixed $hotspot_type
1424 * @param mixed $hotspot_url
1425 * @param mixed $hotspot_content
1426 * @param mixed $hotspot_hover
1427 *
1428 * @return array
1429 * @since 8.0.0
1430 */
1431 public static function get_hotspot_setting_fluent_form_fields($pano_hotspot)
1432 {
1433 $fields = array(
1434 'hotspot-type' => array(
1435 'title' => __('Hotspot-Type','wpvr'),
1436 'type' => 'fluent_form_type',
1437 ),
1438 'fluent-form-id' => array(
1439 'title' => __('Select your form','wpvr'),
1440 'type' => 'fluent_form_select',
1441 'class' => 'wpvr-fluent-forms',
1442 'value' => $pano_hotspot
1443 ),
1444 'hotspot-url' => array(
1445 'title' => __('URL','wpvr'),
1446 'type' => 'info_url',
1447 'value' => $pano_hotspot['hotspot-url'],
1448 'display' => 'none',
1449 ),
1450 'wpvr_url_open' => array(
1451 'title' => __('Open in same tab','wpvr'),
1452 'type' => 'same_tab_checkbox',
1453 'value' => isset($pano_hotspot['wpvr_url_open'][0]) ? $pano_hotspot['wpvr_url_open'][0] : 'off',
1454 'display' => 'none',
1455 ),
1456 'hotspot-content' => array(
1457 'class' => 'hotspot-content',
1458 'title' => __('On Click Content','wpvr'),
1459 'type' => 'info_textarea',
1460 'value' => $pano_hotspot['hotspot-content'],
1461 'display' => 'none',
1462 ),
1463 'hotspot-hover' => array(
1464 'class' => 'hotspot-hover',
1465 'title' => __('On Hover Content','wpvr'),
1466 'type' => 'info_textarea',
1467 'value' => $pano_hotspot['hotspot-hover'],
1468 'display' => 'block',
1469 ),
1470 'hotspot-scene-list' => array(
1471 'title' => __('Select Target Scene from List','wpvr'),
1472 'type' => 'scene_list',
1473 'display' => 'none',
1474 ),
1475 'hotspot-scene' => array(
1476 'title' => __('Target Scene ID','wpvr'),
1477 'display' => 'none',
1478 'input_class' => 'hotspotsceneinfodata',
1479 'type' => 'disabled_text',
1480 'value' => ''
1481 )
1482 );
1483 return apply_filters( 'modify_hotspot_right_fields', $fields );
1484
1485 }
1486
1487
1488 /**
1489 * Initializa Hotspot Setting Scene Fields
1490 *
1491 * @param mixed $hotspot_hover
1492 * @param mixed $hotspot_target_scene
1493 *
1494 * @return array
1495 * @since 8.0.0
1496 */
1497 public static function get_hotspot_setting_scene_fields($pano_hotspot)
1498 {
1499 $fields = array(
1500 'hotspot-type' => array(
1501 'title' => __('Hotspot-Type','wpvr'),
1502 'type' => 'scene_type_select',
1503 ),
1504 'hotspot-url' => array(
1505 'title' => __('URL','wpvr'),
1506 'type' => 'info_url',
1507 'display' => 'none',
1508 'value' => '',
1509 ),
1510 'wpvr_url_open' => array(
1511 'title' => __('Open in same tab','wpvr'),
1512 'type' => 'same_tab_checkbox',
1513 'value' => 'off',
1514 'display' => 'none',
1515 ),
1516 'hotspot-content' => array(
1517 'class' => 'hotspot-content',
1518 'title' => __('On Click Content','wpvr'),
1519 'type' => 'scene_content',
1520 'display' => 'none',
1521 ),
1522 'hotspot-hover' => array(
1523 'class' => 'hotspot-hover',
1524 'title' => __('On Hover Content','wpvr'),
1525 'type' => 'info_textarea',
1526 'value' => $pano_hotspot['hotspot-hover'],
1527 'display' => 'block',
1528 ),
1529 'hotspot-scene-list' => array(
1530 'title' => __('Select Target Scene from List','wpvr'),
1531 'type' => 'scene_list',
1532 'display' => 'block',
1533 ),
1534 'hotspot-scene' => array(
1535 'title' => __('Target Scene ID','wpvr'),
1536 'display' => 'block',
1537 'input_class' => 'hotspotsceneinfodata',
1538 'type' => 'disabled_text',
1539 'value' => $pano_hotspot['hotspot-scene']
1540 ),
1541 );
1542 return apply_filters( 'modify_hotspot_setting_scene_fields', $fields, $pano_hotspot );
1543 }
1544
1545
1546 /**
1547 * Return general feature navigation meta fields
1548 *
1549 * @return array
1550 * @since 8.0.0
1551 */
1552 public static function get_general_navigation_meta_fields()
1553 {
1554 $fields = array(
1555 array(
1556 'class' => 'gen-basic',
1557 'active' => 'active',
1558 'href' => 'gen-basic',
1559 'isPro' => false,
1560 'regular_icon' => 'admin/icon/basic-settings-regular.svg',
1561 'hover_icon' => 'admin/icon/basic-settings-hover.svg',
1562 'title' => __('Basic Settings','wpvr')
1563 ),
1564 array(
1565 'class' => 'gen-advanced',
1566 'active' => '',
1567 'href' => 'gen-advanced',
1568 'isPro' => true,
1569 'regular_icon' => 'admin/icon/advance-control-regular.svg',
1570 'hover_icon' => 'admin/icon/advance-control-hover.svg',
1571 'title' => __('Advanced Controls','wpvr')
1572 ),
1573 );
1574
1575 return apply_filters( 'make_is_pro_false', $fields );
1576 }
1577
1578
1579 /**
1580 * Render inner navigation bar for General tab
1581 *
1582 * @return void
1583 * @since 8.0.0
1584 */
1585 public static function render_general_inner_navigation()
1586 {
1587 ob_start();
1588 ?>
1589
1590 <ul class="inner-nav">
1591
1592 <?php
1593 $fields = WPVR_Meta_Field::get_general_navigation_meta_fields();
1594 foreach($fields as $field) { ?>
1595
1596 <li class="<?php echo $field['class']; ?> <?php echo $field['active']; ?>">
1597 <span data-href="#<?php echo $field['href']; ?>">
1598 <?php if($field['isPro'] == true) { ?>
1599 <span class="pro-tag">pro</span>
1600 <?php } ?>
1601 <img loading="lazy" src="<?php echo WPVR_PLUGIN_DIR_URL . $field['regular_icon']; ?>" alt="icon" class="regular" />
1602 <img loading="lazy" src="<?php echo WPVR_PLUGIN_DIR_URL. $field['hover_icon']; ?>" alt="icon" class="hover" />
1603 <?php echo __($field['title'], 'wpvr');?></span>
1604 </li>
1605
1606 <?php } ?>
1607
1608 <li class="vr-documentation">
1609 <a href="https://rextheme.com/docs-category/wp-vr/" target="_blank">
1610 <svg xmlns="http://www.w3.org/2000/svg" width="17" height="18" viewBox="0 0 17 18" fill="none" class="doc-icon">
1611 <path d="M15.8398 7.5V11.25C15.8398 15 14.3398 16.5 10.5898 16.5H6.08984C2.33984 16.5 0.839844 15 0.839844 11.25V6.75C0.839844 3 2.33984 1.5 6.08984 1.5H9.83984" stroke="#73707D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1612 <path d="M15.8398 7.5H12.8398C10.5898 7.5 9.83984 6.75 9.83984 4.5V1.5L15.8398 7.5Z" stroke="#73707D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1613 <path d="M4.58984 9.75H9.08984" stroke="#73707D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1614 <path d="M4.58984 12.75H7.58984" stroke="#73707D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1615 </svg>
1616 <?php echo __('Documentation ', 'wpvr'); ?>
1617 </a>
1618 </li>
1619
1620 </ul>
1621
1622 <?php
1623 ob_end_flush();
1624 }
1625
1626
1627 /**
1628 * Render Hotspot Setting Left Fields
1629 * @return void
1630 *
1631 * @since 8.0.0
1632 */
1633 public static function render_hotspot_setting_left_fields($pano_hotspot)
1634 {
1635 $fields = self::get_hotspot_left_fields($pano_hotspot);
1636 foreach($fields as $name => $val) {
1637 self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val );
1638 }
1639 }
1640
1641
1642 /**
1643 * Render Hotspot Setting Right Fileds
1644 * @return void
1645 *
1646 * @since 8.0.0
1647 */
1648 public static function render_hotspot_setting_right_fields()
1649 {
1650 $fields = self::get_hotspot_right_fields();
1651 foreach($fields as $name => $val) {
1652 self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val );
1653 }
1654 }
1655
1656
1657 /**
1658 * Render Hotspot Setting When Hotspot-Type is Info
1659 *
1660 * @param mixed $hotspot_url
1661 * @param mixed $hotspot_content
1662 * @param mixed $hotspot_hover
1663 *
1664 * @return void
1665 * @since 8.0.0
1666 */
1667 public static function render_hotspot_setting_info_fields($pano_hotspot)
1668 {
1669 $fields = self::get_hotspot_setting_info_fields($pano_hotspot);
1670 foreach($fields as $name => $val) {
1671 self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val );
1672 }
1673 }
1674
1675 /**
1676 * Render Hotspot Setting When Hotspot-Type is fluent form
1677 *
1678 * @param mixed $hotspot_hover
1679 * @param mixed $hotspot_target_scene
1680 *
1681 * @return void
1682 * @since 8.0.0
1683 */
1684 public static function render_hotspot_setting_fluent_form_fields($pano_hotspot)
1685 {
1686 $fields = self::get_hotspot_setting_fluent_form_fields($pano_hotspot);
1687 foreach($fields as $name => $val) {
1688 self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val );
1689 }
1690 }
1691 /**
1692 * Render Hotspot Setting When Hotspot-Type is Woocommerce Product
1693 *
1694 * @param mixed $hotspot_hover
1695 * @param mixed $hotspot_target_scene
1696 *
1697 * @return void
1698 * @since 8.0.0
1699 */
1700 public static function render_hotspot_setting_wc_product_fields($pano_hotspot)
1701 {
1702 $fields = self::get_hotspot_setting_wc_product_fields($pano_hotspot);
1703 foreach($fields as $name => $val) {
1704 self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val );
1705 }
1706 }
1707
1708
1709 /**
1710 * Render Hotspot Setting When Hotspot-Type is Scene
1711 *
1712 * @param mixed $hotspot_hover
1713 * @param mixed $hotspot_target_scene
1714 *
1715 * @return void
1716 * @since 8.0.0
1717 */
1718 public static function render_hotspot_setting_scene_fields($pano_hotspot)
1719 {
1720 $fields = self::get_hotspot_setting_scene_fields($pano_hotspot);
1721 foreach($fields as $name => $val) {
1722 self::{ 'render_hotspot_' . $val['type'] . '_field' }( $name, $val );
1723 }
1724 }
1725
1726
1727
1728 /**
1729 * Render Scene Setting Left fields
1730 * When Panodata is Empty
1731 * @return void
1732 * @since 8.0.0
1733 */
1734 public static function render_scene_left_fields_empty_panodata()
1735 {
1736 $fields = self::get_scene_left_fields_empty_panodata();
1737 foreach($fields as $name => $val) {
1738 self::{ 'render_scene_' . $val['type'] . '_field' }( $name, $val );
1739 }
1740
1741 }
1742
1743
1744 /**
1745 * Render Scene Setting Left Fields
1746 * When Panodata is not Empty
1747 * @param mixed $dscene
1748 * @param mixed $scene_id
1749 * @param mixed $scene_photo
1750 *
1751 * @return void
1752 * @since 8.0.0
1753 */
1754 public static function render_scene_left_fields_with_panodata($pano_scene)
1755 {
1756 $fields = self::get_scene_left_fields_with_panodata($pano_scene);
1757 foreach($fields as $name => $val) {
1758 self::{ 'render_scene_' . $val['type'] . '_field' }( $name, $val );
1759 }
1760 }
1761
1762
1763 /**
1764 * Initialize fields render method
1765 * @return void
1766 * @since 8.0.0
1767 */
1768 public static function render_advanced_settings_left_fields($postdata)
1769 {
1770 $fields = self::get_advanced_settings_left_fields($postdata);
1771 foreach($fields as $name => $val) {
1772 if( 'advanced_setting_checkbox_for_mouse_dragg_control' === $val['type']){
1773 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1774 } else if('advanced_mouse_zoom_control' === $val['type']){
1775 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1776 }else if('advanced_gyro_control' === $val['type']){
1777 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1778 } else if('advanced_setting_scene_gallery' === $val['type']){
1779 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1780 } else if('pro_inner_scene_gallery_icon_size' === $val['type']){
1781 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1782 } else if($val['type'] === 'tour_layout_select'){
1783 self::{ 'render_' . $val['type'] }( $name, $val );
1784 } else{
1785 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
1786 }
1787 }
1788 }
1789
1790
1791 /**
1792 * Initialize fields render method
1793 * @return void
1794 * @since 8.0.0
1795 */
1796 public static function render_advanced_settings_right_fields($postdata)
1797 {
1798 $fields = self::get_advanced_settings_right_fields($postdata);
1799 foreach($fields as $name => $val) {
1800 if(in_array($name, array('explainer','backToHome', 'panFullscreenControl'))){
1801 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val );
1802 }else if('basic_setting_checkbox_for_scene_animation' === $val['type']){
1803 self::{ 'render_' . $val['type'] }( $name, $val, $postdata );
1804 } else if('advanced_setting_explainer_video' === $val['type']){
1805 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1806 } else if('advanced_setting_explainer_video' === $val['type']){
1807 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1808 } else if('advanced_setting_set_zoom_preference' === $val['type']){
1809 self::{ 'render_' . $val['type'] . '_field' }( $name, $val, $postdata );
1810 } else{
1811 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
1812 }
1813 }
1814 self::render_other_fields($postdata);
1815 }
1816
1817
1818 /**
1819 * Initilize Video Meta Fields
1820 * @param mixed $postdata
1821 *
1822 * @return array
1823 * @since 8.0.0
1824 */
1825 public static function get__video_setting_fields($postdata)
1826 {
1827 $vidurl = '';
1828 if (isset($postdata['vidid'])) {
1829 $vidurl = $postdata['vidurl'];
1830 }
1831 $meta_fields = array(
1832 'panovideo' => array(
1833 'class' => 'single-settings videosetup',
1834 'title' => __('Enable Video','wpvr'),
1835 'type' => 'radio_button',
1836 'lists' => array(
1837 array(
1838 'input_class' => 'styled-radio video_off',
1839 'input_id' => 'styled-radio',
1840 'value' => 'off',
1841 'checked' => isset($postdata['vidid']),
1842 'label_value' => 'Off'
1843 ),
1844 array(
1845 'input_class' => 'styled-radio video_on',
1846 'input_id' => 'styled-radio-0',
1847 'value' => 'on',
1848 'checked' => isset($postdata['vidid']),
1849 'label_value' => 'On'
1850 )
1851 ),
1852
1853 ),
1854 'video-attachment-url' => array(
1855 'class' => 'video-setting',
1856 'title' => __('Upload or Add Link','wpvr'),
1857 'placeholder' => __('Paste Youtube or Vimeo link or upload','wpvr'),
1858 'input_class' => 'video-attachment-url',
1859 'type' => 'video_text_input',
1860 'value' => $vidurl
1861 )
1862 );
1863 return apply_filters( 'extend_video_meta_fields', $meta_fields, $postdata, $vidurl );
1864 }
1865
1866
1867 /**
1868 * Render Video Settings Meta Fields
1869 * @param mixed $postdata
1870 *
1871 * @return void
1872 * @since 8.0.0
1873 */
1874 public static function render_video_setting_meta_fields($postdata)
1875 {
1876 $fields = self::get__video_setting_fields($postdata);
1877
1878 foreach($fields as $name => $val) {
1879 self::{ 'render_' . $val['type'] }( $name, $val );
1880 }
1881
1882 }
1883
1884
1885 /**
1886 * Render Scene Settings Select Field
1887 * @param mixed $name input name
1888 * @param mixed $val options
1889 *
1890 * @return void
1891 * @since 8.0.0
1892 */
1893 public static function render_scene_select_field($name, $val)
1894 {
1895 extract($val);
1896 ob_start();
1897 ?>
1898 <div class="<?= $class; ?>">
1899 <div class="wpvr-global-tooltip-area">
1900 <label><?= __($title .': ', 'wpvr'); ?></label>
1901 <?php if(!empty($have_tooltip)) { ?>
1902 <div class="field-tooltip">
1903 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
1904
1905 <span>
1906 <?php
1907 // Ensure tooltip_text text is set
1908 if (!empty($tooltip_text['text'])) {
1909 echo esc_html($tooltip_text['text']);
1910
1911 // Check if URL exists before rendering the link
1912 if (!empty($tooltip_text['url'])) {
1913 printf(
1914 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
1915 esc_url($tooltip_text['url']),
1916 __('View Doc', 'wpvr')
1917 );
1918 }
1919 }
1920 ?>
1921 </span>
1922 </div>
1923 <?php } ?>
1924 </div>
1925
1926 <select class="<?= $select_class; ?>" name="<?= $name; ?>">
1927 <option value="on" <?php selected( $selected, 'on' ); ?> > <?php echo __('Yes','wpvr') ?> </option>
1928 <option value="off" <?php selected( $selected, 'off' ); ?> > <?php echo __('No','wpvr') ?></option>
1929 </select>
1930 </div>
1931 <?php
1932 ob_end_flush();
1933 }
1934
1935
1936 /**
1937 * Render Scene Type selection field on Scene tab content
1938 *
1939 * @param mixed $name
1940 * @param mixed $val
1941 *
1942 * @return void
1943 * @since 8.0.0
1944 */
1945 public static function render_scene_type_select_field($name, $val)
1946 {
1947 extract($val);
1948 ob_start();
1949 ?>
1950 <div class="scene-setting">
1951 <div class="wpvr-global-tooltip-area">
1952 <label for="scene-type"><?= __($title .': ', 'wpvr'); ?></label>
1953 <?php if(!empty($have_tooltip)) { ?>
1954 <div class="field-tooltip">
1955 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
1956
1957 <span>
1958 <?php
1959 // Ensure tooltip_text text is set
1960 if (!empty($tooltip_text['text'])) {
1961 echo esc_html($tooltip_text['text']);
1962
1963 // Check if URL exists before rendering the link
1964 if (!empty($tooltip_text['url'])) {
1965 printf(
1966 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
1967 esc_url($tooltip_text['url']),
1968 __('View Doc', 'wpvr')
1969 );
1970 }
1971 }
1972 ?>
1973 </span>
1974 </div>
1975 <?php } ?>
1976 </div>
1977
1978 <select class="wpvr-pro-select-scene-type" name="scene-type" id="">
1979 <option value="equirectangular" <?= $selected == 'equirectangular' ? 'selected' : '' ?> > <?php echo __('Equirectangular','wpvr') ?></option>
1980 <option value="cubemap" <?= $selected == 'cubemap' ? 'selected' : '' ?> > <?php echo __('Cubemap','wpvr') ?></option>
1981 </select>
1982 </div>
1983 <?php
1984 ob_end_flush();
1985 }
1986
1987
1988 /**
1989 * Render Scene Settings Text Field
1990 * @param mixed $name input name
1991 * @param mixed $val options
1992 *
1993 * @return void
1994 * @since 8.0.0
1995 */
1996 public static function render_scene_text_field($name, $val)
1997 {
1998 extract($val);
1999 ob_start();
2000 if($label_for === 'scene-type') {
2001 ?>
2002 <div class="scene-setting">
2003 <div class="wpvr-global-tooltip-area">
2004
2005 <label for="<?= $label_for; ?>"><?= __($title .': ', 'wpvr'); ?></label>
2006
2007 <?php if(!empty($have_tooltip)) { ?>
2008 <div class="field-tooltip">
2009 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2010
2011 <span>
2012 <?php
2013 // Ensure tooltip_text text is set
2014 if (!empty($tooltip_text['text'])) {
2015 echo esc_html($tooltip_text['text']);
2016
2017 // Check if URL exists before rendering the link
2018 if (!empty($tooltip_text['url'])) {
2019 printf(
2020 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2021 esc_url($tooltip_text['url']),
2022 __('View Doc', 'wpvr')
2023 );
2024 }
2025 }
2026 ?>
2027 </span>
2028 </div>
2029 <?php } ?>
2030
2031 </div>
2032
2033 <select class="disable-scene-type">
2034 <option value="" selected=""> Equirectangular</option>
2035 <option value="" disabled> Cubemap (Pro)</option>
2036 </select>
2037 <input hidden type="text" class="<?= $input_class; ?>" name="<?= $name; ?>" value="<?= $value; ?>" <?= $disabled; ?> />
2038 </div>
2039 <?php
2040 ob_end_flush();
2041 }else{
2042 ?>
2043
2044 <div class="scene-setting">
2045
2046 <div class="wpvr-global-tooltip-area">
2047 <label for="<?= $label_for; ?>"><?= __($title .': ', 'wpvr'); ?></label>
2048
2049 <?php if(!empty($have_tooltip)) { ?>
2050 <div class="field-tooltip">
2051 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2052
2053 <span>
2054 <?php
2055 // Ensure tooltip_text text is set
2056 if (!empty($tooltip_text['text'])) {
2057 echo esc_html($tooltip_text['text']);
2058
2059 // Check if URL exists before rendering the link
2060 if (!empty($tooltip_text['url'])) {
2061 printf(
2062 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2063 esc_url($tooltip_text['url']),
2064 __('View Doc', 'wpvr')
2065 );
2066 }
2067 }
2068 ?>
2069 </span>
2070 </div>
2071 <?php } ?>
2072
2073 </div>
2074 <input type="text" class="<?= $input_class; ?>" name="<?= $name; ?>" value="<?= $value; ?>" />
2075 </div>
2076
2077 <?php }
2078 ob_end_flush();
2079 }
2080
2081
2082 /**
2083 * Render Scene Settings Upload Field
2084 * @param mixed $name input name
2085 * @param mixed $val options
2086 *
2087 * @return void
2088 * @since 8.0.0
2089 */
2090 public static function render_scene_upload_field($name, $val)
2091 {
2092 extract($val);
2093 ob_start();
2094 ?>
2095 <div class="scene-setting">
2096 <div class="wpvr-global-tooltip-area">
2097 <label for="scene-upload"><?= __($title .': ', 'wpvr'); ?></label>
2098 <?php if(!empty($have_tooltip)) { ?>
2099 <div class="field-tooltip">
2100 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2101
2102 <span>
2103 <?php
2104 // Ensure tooltip_text text is set
2105 if (!empty($tooltip_text['text'])) {
2106 echo esc_html($tooltip_text['text']);
2107
2108 // Check if URL exists before rendering the link
2109 if (!empty($tooltip_text['url'])) {
2110 printf(
2111 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2112 esc_url($tooltip_text['url']),
2113 __('View Doc', 'wpvr')
2114 );
2115 }
2116 }
2117 ?>
2118 </span>
2119 </div>
2120 <?php } ?>
2121 </div>
2122
2123 <div class="form-group">
2124 <img loading="lazy" src="<?= $value; ?>" style="display: <?= $display; ?>;"><br>
2125 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2126 <input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="<?= $value; ?>">
2127 </div>
2128 </div>
2129 <?php
2130 ob_end_flush();
2131 }
2132
2133
2134 /**
2135 * Render Scene upload wrapper fields for pro version
2136 *
2137 * @param mixed $name
2138 * @param mixed $val
2139 *
2140 * @return void
2141 * @since 8.0.0
2142 */
2143 public static function render_scene_upload_wrapper_field($name, $val)
2144 {
2145 extract($val);
2146 ob_start();
2147 ?>
2148 <div class="scene-setting scene-upload-wrapper">
2149 <?php
2150 foreach($wrappers as $key => $val) {
2151 self::{ 'render_scene_' . $key }( $key, $val );
2152 }
2153 ?>
2154 </div>
2155 <?php
2156 ob_end_flush();
2157 }
2158
2159
2160 /**
2161 * Render equirectangular scene upload section for pro version
2162 *
2163 * @param mixed $key
2164 * @param mixed $val
2165 *
2166 * @return void
2167 * @since 8.0.0
2168 */
2169 public static function render_scene_equirectangular_upload($key, $val)
2170 {
2171 extract($val);
2172 ob_start();
2173 ?>
2174 <div class="equirectangular-upload" style="display:<?= $display?>;">
2175 <div class="wpvr-global-tooltip-area">
2176 <label for="scene-upload"><?= __('Scene Upload:', 'wpvr')?></label>
2177
2178 <div class="field-tooltip">
2179 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
2180 <span>
2181 <?= __('Upload an image to be used as the scene media (video is not supported).', 'wpvr') ?>
2182
2183 <?php
2184 $tooltip_url = 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/';
2185 if (!empty($tooltip_url)) :
2186 ?>
2187 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
2188 <?= __('View Doc', 'wpvr'); ?>
2189 </a>
2190 <?php endif; ?>
2191 </span>
2192 </div>
2193
2194 </div>
2195
2196
2197 <div class="form-group">
2198 <img loading="lazy" src="<?= $value?>" style="display: <?= $img_display?>;"><br>
2199 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2200 <input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="<?= $value?>">
2201 </div>
2202 </div>
2203 <?php
2204 ob_end_flush();
2205 }
2206
2207
2208 /**
2209 * Render cubemap scene upload section for pro version
2210 *
2211 * @param mixed $key
2212 * @param mixed $val
2213 *
2214 * @return void
2215 * @since 8.0.0
2216 */
2217 public static function render_scene_cubemap_upload($key, $val)
2218 {
2219 extract($val);
2220 ob_start();
2221 ?>
2222 <div class="cubemap-upload" style="display:<?= $display?>;">
2223 <?php
2224 foreach($cubemaps as $cubemap){ extract($cubemap) ?>
2225 <div class="<?= $class ?>">
2226
2227 <div class="wpvr-global-tooltip-area">
2228 <label for="scene-upload"><?= __($title , 'wpvr-pro') ?></label>
2229 <?php if(!empty($have_tooltip)) { ?>
2230 <div class="field-tooltip">
2231 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2232
2233 <span>
2234 <?php
2235 // Ensure tooltip_text text is set
2236 if (!empty($tooltip_text['text'])) {
2237 echo esc_html($tooltip_text['text']);
2238
2239 // Check if URL exists before rendering the link
2240 if (!empty($tooltip_text['url'])) {
2241 printf(
2242 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2243 esc_url($tooltip_text['url']),
2244 __('View Doc', 'wpvr')
2245 );
2246 }
2247 }
2248 ?>
2249 </span>
2250 </div>
2251 <?php } ?>
2252 </div>
2253
2254 <div class="form-group">
2255 <img loading="lazy" src="<?= $value ?>" style="display: block;">
2256 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2257 <input type="hidden" name="<?= $name ?>" class="scene-attachment-url" value="<?= $value ?>">
2258 </div>
2259
2260
2261 </div>
2262 <?php }
2263 ?>
2264 </div>
2265 <?php
2266 ob_end_flush();
2267
2268 }
2269
2270
2271 /**
2272 * Render Radio Button Field
2273 * @param mixed $name input name
2274 * @param mixed $val options
2275 *
2276 * @return void
2277 * @since 8.0.0
2278 */
2279 public static function render_radio_button($name, $val)
2280 {
2281 extract( $val );
2282 ob_start();
2283 ?>
2284 <div class="<?= $class; ?>">
2285 <span><?= __($title .': ', 'wpvr'); ?></span>
2286 <ul>
2287
2288 <?php foreach($lists as $list) { extract( $list ); ?>
2289 <li class="radio-btn">
2290 <input class="<?= $input_class; ?>" id="<?= $input_id; ?>" type="radio" name="<?= $name; ?>" value="<?= $value; ?>" <?php if(empty($checked) && $value == 'off') { echo 'checked'; } ;?> <?php if(!empty($checked) && $value == 'on') { echo 'checked'; };?> >
2291 <label for="<?= $input_id; ?>"><?= $label_value; ?></label>
2292 </li>
2293
2294 <?php } ?>
2295
2296 </ul>
2297 </div>
2298 <?php
2299 ob_end_flush();
2300 }
2301
2302
2303 /**
2304 * Render Radio Button Field for pro version
2305 * @param mixed $name input name
2306 * @param mixed $val options
2307 *
2308 * @return void
2309 * @since 8.0.0
2310 */
2311 public static function render_pro_radio_button($name, $val)
2312 {
2313 extract( $val );
2314 ob_start();
2315 ?>
2316 <div class="<?= $class; ?>">
2317 <span><?= __($title .': ', 'wpvr'); ?></span>
2318 <ul>
2319
2320 <?php foreach($lists as $list) { extract( $list ); ?>
2321 <li class="radio-btn">
2322 <input class="<?= $input_class; ?>" id="<?= $input_id; ?>" type="radio" name="<?= $name; ?>" value="<?= $value; ?>" <?php if(($checked == 'off' || empty($checked)) && $value == 'off') { echo 'checked'; } ;?> <?php if($checked == 'on' && $value == 'on') { echo 'checked'; };?> >
2323 <label for="<?= $input_id; ?>"><?= $label_value; ?></label>
2324 </li>
2325
2326 <?php } ?>
2327
2328 </ul>
2329 </div>
2330 <?php
2331 ob_end_flush();
2332 }
2333
2334
2335 /**
2336 * Render Video Text Input Field
2337 * @param mixed $name input name
2338 * @param mixed $val options
2339 *
2340 * @return void
2341 * @since 8.0.0
2342 */
2343 public static function render_video_text_input($name, $val)
2344 {
2345 extract( $val );
2346 ob_start();
2347 ?>
2348 <div class="<?= $class; ?>" style="display:none;">
2349 <div class="single-settings">
2350 <span><?= __($title .': ', 'wpvr'); ?></span>
2351 <div class="form-group">
2352 <input type="text" placeholder="<?= $placeholder; ?>" name="<?= $name; ?>" class="<?= $input_class; ?>" value="<?= $value; ?>">
2353 <input type="button" class="video-upload" data-info="" value="Upload"/>
2354 </div>
2355 </div>
2356 </div>
2357 <?php
2358
2359 ob_end_flush();
2360
2361 }
2362
2363 /**
2364 * Render Checkbox Field
2365 *
2366 * @param string $name input name
2367 * @param string $val options
2368 *
2369 * @return void
2370 * @since 8.0.0
2371 */
2372 public static function render_checkbox_field($name, $val)
2373 {
2374 extract( $val );
2375 ob_start();
2376 ?>
2377 <div class="<?= $class;?>">
2378
2379 <div class="wpvr-tooltip-area">
2380 <span><?= __($title.': ', 'wpvr'); ?></span>
2381
2382 <?php if(!empty($have_tooltip)) {?>
2383
2384 <div class="field-tooltip">
2385 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2386
2387 <span>
2388 <?php
2389 // Ensure tooltip_text text is set
2390 if (!empty($tooltip_text['text'])) {
2391 echo esc_html($tooltip_text['text']);
2392
2393 // Check if URL exists before rendering the link
2394 if (!empty($tooltip_text['url'])) {
2395 printf(
2396 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2397 esc_url($tooltip_text['url']),
2398 __('View Doc', 'wpvr')
2399 );
2400 }
2401 }
2402 ?>
2403 </span>
2404 </div>
2405 <?php } ?>
2406
2407 </div>
2408
2409 <span class="wpvr-switcher">
2410 <input id="<?= $id;?>" class="vr-switcher-check" value="off" name="<?= $name;?>" type="checkbox" disabled />
2411 <label for="<?= $id;?>" title="Pro Feature"></label>
2412 </span>
2413
2414
2415 </div>
2416 <?php
2417 ob_end_flush();
2418 }
2419
2420
2421 /**
2422 * Render checkbox for advanced control pro version meta fields
2423 *
2424 * @param mixed $name
2425 * @param mixed $val
2426 *
2427 * @return void
2428 * @since 8.0.0
2429 */
2430 public static function render_pro_checkbox_field($name, $val)
2431 {
2432 extract($val);
2433 ob_start();
2434 ?>
2435 <div class="<?= $class; ?>">
2436
2437 <div class="wpvr-tooltip-area">
2438 <span><?= __($title .': ', 'wpvr'); ?></span>
2439
2440 <?php if(!empty($have_tooltip)) { ?>
2441 <div class="field-tooltip">
2442 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2443
2444 <span>
2445 <?php
2446 // Ensure tooltip_text text is set
2447 if (!empty($tooltip_text['text'])) {
2448 echo esc_html($tooltip_text['text']);
2449
2450 // Check if URL exists before rendering the link
2451 if (!empty($tooltip_text['url'])) {
2452 printf(
2453 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2454 esc_url($tooltip_text['url']),
2455 __('View Doc', 'wpvr')
2456 );
2457 }
2458 }
2459 ?>
2460 </span>
2461 </div>
2462 <?php } ?>
2463
2464 </div>
2465
2466 <span class="wpvr-switcher">
2467 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
2468 <label for="<?= $id; ?>"></label>
2469 </span>
2470
2471
2472 </div>
2473 <?php
2474 ob_end_flush();
2475 }
2476
2477
2478 public static function render_explainer_info_wrapper_field($name, $val)
2479 {
2480 extract($val);
2481 ob_start();
2482 ?>
2483 <div class="explainer-info-wrapper">
2484 <div class="single-settings cp-details">
2485 <span><?= __($title .': ', 'wpvr'); ?></span>
2486 <textarea rows="5" cols="40" name="explaine-content" id="explaine-content"><?= $value?></textarea>
2487 </div>
2488 </div>
2489 <?php
2490 ob_end_flush();
2491 }
2492
2493
2494 /**
2495 * Render checkbox for advanced control pro version meta fields
2496 *
2497 * @param mixed $name
2498 * @param mixed $val
2499 *
2500 * @return void
2501 * @since 8.0.0
2502 */
2503 public static function render_pro_inner_checkbox_field($name, $val)
2504 {
2505 extract($val);
2506 ob_start();
2507 ?>
2508 <!-- <div class="<?= $root_class; ?>">
2509
2510 </div> -->
2511
2512 <div class="<?= $class; ?>">
2513 <div class="wpvr-tooltip-area">
2514 <span><?= __($title .': ', 'wpvr'); ?></span>
2515
2516 <?php if(!empty($have_tooltip)) { ?>
2517 <div class="field-tooltip">
2518 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2519
2520 <span>
2521 <?php
2522 // Ensure tooltip_text text is set
2523 if (!empty($tooltip_text['text'])) {
2524 echo esc_html($tooltip_text['text']);
2525
2526 // Check if URL exists before rendering the link
2527 if (!empty($tooltip_text['url'])) {
2528 printf(
2529 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2530 esc_url($tooltip_text['url']),
2531 __('View Doc', 'wpvr')
2532 );
2533 }
2534 }
2535 ?>
2536 </span>
2537 </div>
2538 <?php } ?>
2539
2540 </div>
2541
2542 <span class="wpvr-switcher">
2543 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value; ?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo 'checked'; } else { echo ''; } ?> />
2544 <label for="<?= $id; ?>"></label>
2545 </span>
2546
2547 </div>
2548
2549 <?php
2550 ob_end_flush();
2551 }
2552
2553
2554 /**
2555 * Render background music field on Advanced Controls section
2556 *
2557 * @param mixed $name
2558 * @param mixed $val
2559 *
2560 * @return void
2561 * @since 8.0.0
2562 */
2563 public static function render_bg_music_content_field($name, $val)
2564 {
2565 extract($val);
2566 ob_start();
2567 ?>
2568 <div class="bg-music-content" style="display:none">
2569 <?php
2570 foreach($inner_fields as $name => $val) {
2571 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
2572 }
2573 ?>
2574 </div>
2575 <?php
2576 ob_end_flush();
2577 }
2578
2579
2580 /**
2581 * Render Upload or Set Audio Link field on Advanced Controls section
2582 *
2583 * @param mixed $name
2584 * @param mixed $val
2585 *
2586 * @return void
2587 * @since 8.0.0
2588 */
2589 public static function render_upload_audio_link_field($name, $val)
2590 {
2591 extract($val);
2592 ob_start();
2593 ?>
2594 <div class="single-settings audio-setting">
2595 <!-- <span><?= __($title .': ', 'wpvr'); ?></span> -->
2596 <img loading="lazy" class="audio-img" src="<?= $value; ?>" style="display: none;">
2597 <input type="text" name="<?= $name; ?>" placeholder="Paste URL" class="audio-attachment-url" value="<?= $value; ?>">
2598
2599 <button type="button" class="audio-upload" data-info=""> <span><?php echo __('Upload','wpvr')?></span><img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/upload.svg' ?>" alt="icon" /></button>
2600
2601 </div>
2602 <?php
2603 ob_end_flush();
2604 }
2605
2606
2607 /**
2608 * Render Add Company information field on Advanced Controls section
2609 *
2610 * @param mixed $name
2611 * @param mixed $val
2612 *
2613 * @return void
2614 * @since 8.0.0
2615 */
2616 public static function render_company_info_wrapper_field($name, $val)
2617 {
2618 extract($val);
2619 ob_start();
2620 ?>
2621 <div class="company-info-wrapper">
2622 <div class="single-settings cp-logo-area">
2623 <span class="logo-title"><?= __($title .': ', 'wpvr'); ?>
2624 <span class="hints"><?= __('You can add any logo size. But recommended size is below 100x100 px for perfect look.', 'wpvr-pro') ?></span>
2625 </span>
2626
2627 <div class="form-group">
2628 <input type="text" name="cp-logo-attachment-url" class="cp-logo-attachment-url" value="<?= $value ?>">
2629 <input type="button" class="cp-logo-upload" id="cp-logo-upload" data-info="" value="Upload"/>
2630
2631 <div class="logo-upload-frame" >
2632 <label for="cp-logo-upload">
2633 <img loading="lazy" class="cp-logo-img" src="<?= $value ?>">
2634 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/upload-icon.svg' ?>" class="placeholder-icon" alt="icon" style="display: <?php if($value != null) { echo 'none'; } ?>;" />
2635 <span class="vr-upload-text">
2636 Click to <strong>Upload an Image</strong>
2637 </span>
2638 </label>
2639 </div>
2640 </div>
2641 </div>
2642 <div class="single-settings cp-details">
2643 <span><?= __('Company Details : ', 'wpvr-pro') ?></span>
2644 <textarea rows="5" cols="40" name="cp-logo-content" id="cp-logo-content"><?= $cpLogoContent;?></textarea>
2645 </div>
2646 </div>
2647 <?php
2648 ob_end_flush();
2649 }
2650
2651
2652 /**
2653 * Render text input fields while ro version is active
2654 *
2655 * @param mixed $name
2656 * @param mixed $val
2657 *
2658 * @return void
2659 * @since 8.0.0
2660 */
2661 public static function render_pro_input_field($name, $val)
2662 {
2663 extract($val);
2664 ob_start();
2665 ?>
2666 <div class="<?= $class ?>" >
2667 <div class="wpvr-tooltip-area">
2668 <span><?= __($title .': ', 'wpvr'); ?></span>
2669 <div class="field-tooltip">
2670 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2671
2672 <span>
2673 <?php
2674 // Ensure tooltip_text text is set
2675 if (!empty($tooltip_text['text'])) {
2676 echo esc_html($tooltip_text['text']);
2677
2678 // Check if URL exists before rendering the link
2679 if (!empty($tooltip_text['url'])) {
2680 printf(
2681 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2682 esc_url($tooltip_text['url']),
2683 __('View Doc', 'wpvr')
2684 );
2685 }
2686 }
2687 ?>
2688 </span>
2689 </div>
2690 </div>
2691
2692 <input type="text" class="<?= $input_class ?>" name="<?= $name ?>" placeholder="<?= $placeholder ?>" value="<?= $value ?>" />
2693
2694
2695
2696
2697 </div>
2698 <?php
2699 ob_end_flush();
2700 }
2701
2702
2703 /**
2704 * Render Checkbox Field With Icon
2705 *
2706 * @param string $name input name
2707 * @param string $val options
2708 *
2709 * @return void
2710 * @since 8.0.0
2711 */
2712 public static function render_checkbox_with_icon($name, $val)
2713 {
2714 extract( $val );
2715 ob_start();
2716 ?>
2717 <div class="single-settings controls custom-data-set">
2718 <span><?= __($title . ': ', 'wpvr'); ?></span>
2719
2720 <div class="color-icon">
2721 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/'. $icon; ?>" alt="icon" />
2722 </div>
2723
2724 <span class="wpvr-switcher">
2725 <input id="<?= $id; ?>" class="vr-switcher-check" value="off" name="<?= $name; ?>" type="checkbox" disabled />
2726 <label for="<?= $id; ?>" title="Pro Feature"></label>
2727 </span>
2728
2729 </div>
2730 <?php
2731 ob_end_flush();
2732 }
2733
2734
2735 /**
2736 * Render checkbox fields on Control Buttons section while pro version is active
2737 *
2738 * @param mixed $name
2739 * @param mixed $val
2740 *
2741 * @return void
2742 * @since 8.0.0
2743 */
2744 public static function render_pro_checkbox_with_icon($name, $val)
2745 {
2746 extract( $val );
2747 ob_start();
2748 ?>
2749 <div class="single-settings controls custom-data-set">
2750 <span><?= __($title . ': ', 'wpvr'); ?></span>
2751
2752 <span class="wpvr-switcher">
2753 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value ?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo 'checked'; } ?> />
2754 <label for="<?= $id; ?>"></label>
2755 </span>
2756
2757 <div class="color-icon">
2758 <div class="colors">
2759 <span><?php echo __('Color','wpvr')?></span>
2760
2761 <input type="color" class="<?= $color_name; ?>" name="<?= $color_name; ?>" value="<?= $color_value; ?>" />
2762 <input type="hidden" class="<?= $icon_name ?> icon-found-value" name="<?= $icon_name ?>" value="<?= $color_value; ?>" />
2763 </div>
2764
2765 <div class="icons">
2766 <span><?php echo __('Icon','wpvr')?></span>
2767 <select class="<?= $icon_select_class ?>" name="<?= $icon_select_name ?>">
2768 <?php
2769 foreach ($custom_icons as $cikey => $civalue) {
2770 if ($cikey == $icon) { ?>
2771 <option value="<?= $cikey ?>" selected> <?= $civalue ?></option>
2772 <?php } else { ?>
2773 <option value="<?= $cikey ?>"> <?= $civalue ?></option>
2774 <?php }
2775 }
2776 ?>
2777 </select>
2778 </div>
2779 </div>
2780
2781 </div>
2782 <?php
2783 ob_end_flush();
2784 }
2785
2786
2787 /**
2788 * Render Basic Setting Preview Image
2789 * @param mixed $name input name
2790 * @param mixed $val options
2791 *
2792 * @return void
2793 * @since 8.0.0
2794 */
2795 public static function render_preview_image($name, $val)
2796 {
2797 extract( $val );
2798 ob_start();
2799 ?>
2800 <div class="<?= $class; ?>">
2801 <div class="wpvr-set-pre-img">
2802 <span><?= __($title.' : ', 'wpvr'); ?></span>
2803
2804 <?php if(!empty($have_tooltip)) { ?>
2805 <div class="field-tooltip">
2806 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2807
2808 <span>
2809 <?php
2810 // Ensure tooltip_text text is set
2811 if (!empty($tooltip_text['text'])) {
2812 echo esc_html($tooltip_text['text']);
2813
2814 // Check if URL exists before rendering the link
2815 if (!empty($tooltip_text['url'])) {
2816 printf(
2817 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2818 esc_url($tooltip_text['url']),
2819 __('View Doc', 'wpvr')
2820 );
2821 }
2822 }
2823 ?>
2824 </span>
2825 </div>
2826 <?php } ?>
2827
2828 </div>
2829
2830 <div class="wpvr-set-pre-img-area">
2831
2832 <div class="form-group">
2833 <input type="text" name="<?= $name; ?>" class="preview-attachment-url" value="<?= $value;?>">
2834 <input type="button" class="preview-upload" id="vr-preview-img" data-info="" value="Upload"/>
2835 <div class="img-upload-frame <?php if(!empty($value)) { echo 'img-uploaded'; } ?>" style="background-image: url(<?= $value; ?>)">
2836 <span class="remove-attachment">x</span>
2837 <label for="vr-preview-img">
2838 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/upload-icon.svg'; ?>" alt="<?= esc_attr__('Upload icon', 'wpvr'); ?>" loading="lazy"/>
2839 <span class="vr-upload-text">
2840 <?= __('Click to', 'wpvr'); ?> <strong><?= __('Upload an Image', 'wpvr'); ?></strong>
2841 </span>
2842 </label>
2843 </div>
2844 </div>
2845 <span class="hints"><?= __('This option will not work if the "Tour Autoload" is turned on.', 'wpvr'); ?></span>
2846 </div>
2847
2848 </div>
2849 <?php
2850 ob_end_flush();
2851 }
2852
2853
2854 /**
2855 * Render Basic Setting Preview Message
2856 * @param mixed $name input name
2857 * @param mixed $val options
2858 *
2859 * @return void
2860 * @since 8.0.0
2861 */
2862 public static function render_preview_image_msg($name, $val)
2863 {
2864 extract( $val );
2865 ob_start();
2866 ?>
2867 <div class="<?= $class; ?>">
2868 <div class="wpvr-pre-img">
2869 <span><?= __($title.': ', 'wpvr'); ?></span>
2870 <?php if(!empty($have_tooltip)) { ?>
2871 <div class="field-tooltip">
2872 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2873
2874 <span>
2875 <?php
2876 // Ensure tooltip_text text is set
2877 if (!empty($tooltip_text['text'])) {
2878 echo esc_html($tooltip_text['text']);
2879
2880 // Check if URL exists before rendering the link
2881 if (!empty($tooltip_text['url'])) {
2882 printf(
2883 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2884 esc_url($tooltip_text['url']),
2885 __('View Doc', 'wpvr')
2886 );
2887 }
2888 }
2889 ?>
2890 </span>
2891 </div>
2892 <?php } ?>
2893 </div>
2894
2895 <input class="previewtext" type="text" name="<?= $name; ?>" value="<?= $value; ?>"/>
2896
2897 </div>
2898 <?php
2899 ob_end_flush();
2900 }
2901
2902
2903 /**
2904 * Render Basc Setting Checkbox
2905 * @param mixed $name input name
2906 * @param mixed $val options
2907 *
2908 * @return void
2909 * @since 8.0.0
2910 */
2911 public static function render_basic_setting_checkbox($name, $val)
2912 {
2913 extract( $val );
2914 ob_start();
2915 ?>
2916 <div class="<?= $class; ?>">
2917 <?php if(isset($val['package']) && $val['package'] == 'pro' && !defined('WPVR_PRO_VERSION')){?>
2918 <div class="basic-setting-checkbox-pro-tag">pro</div>
2919 <?php } ?>
2920
2921 <div class="wpvr-tooltip-area">
2922 <span><?= __($title.': ', 'wpvr'); ?></span>
2923
2924 <?php if(!empty($have_tooltip)) { ?>
2925 <div class="field-tooltip">
2926 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2927
2928 <span>
2929 <?php
2930 // Ensure tooltip_text text is set
2931 if (!empty($tooltip_text['text'])) {
2932 echo esc_html($tooltip_text['text']);
2933
2934 // Check if URL exists before rendering the link
2935 if (!empty($tooltip_text['url'])) {
2936 printf(
2937 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2938 esc_url($tooltip_text['url']),
2939 __('View Doc', 'wpvr')
2940 );
2941 }
2942 }
2943 ?>
2944 </span>
2945 </div>
2946 <?php } ?>
2947
2948 </div>
2949
2950 <span class="wpvr-switcher">
2951 <input id="<?= $id;?>" class="vr-switcher-check" name="<?= $name; ?>" type="checkbox" value="1" <?php checked( $checked, 1 ); ?> />
2952 <label for="<?= $id;?>"></label>
2953 </span>
2954
2955 </div>
2956 <?php if(isset($val['id']) && $val['id'] === 'wpvr_scene_animation') { ?>
2957 <div class="scene-animation-settings-wrapper">
2958 <?php WPVR_Meta_Field::render_scene_animation_transition_data_wrapper_fields($postdata) ;?>
2959 </div>
2960 <?php } ?>
2961 <?php
2962 ob_end_flush();
2963 }
2964
2965 /**
2966 * Render Basc Setting Checkbox for scene animation
2967 * @param mixed $name input name
2968 * @param mixed $val options
2969 *
2970 * @return void
2971 * @since 8.5.16
2972 */
2973 public static function render_basic_setting_checkbox_for_scene_animation($name, $val, $postdata)
2974 {
2975 extract( $val );
2976 ob_start();
2977 ?>
2978 <div class="<?= $class; ?>">
2979 <?php if(isset($val['package']) && $val['package'] == 'pro' && !defined('WPVR_PRO_VERSION')){?>
2980 <div class="basic-setting-checkbox-pro-tag">pro</div>
2981 <?php } ?>
2982 <div class="wpvr-tooltip-area">
2983 <span><?= __($title.': ', 'wpvr'); ?></span>
2984
2985 <?php if(!empty($have_tooltip)) { ?>
2986 <div class="field-tooltip">
2987 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
2988
2989 <span>
2990 <?php
2991 // Ensure tooltip_text text is set
2992 if (!empty($tooltip_text['text'])) {
2993 echo esc_html($tooltip_text['text']);
2994
2995 // Check if URL exists before rendering the link
2996 if (!empty($tooltip_text['url'])) {
2997 printf(
2998 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2999 esc_url($tooltip_text['url']),
3000 __('View Doc', 'wpvr')
3001 );
3002 }
3003 }
3004 ?>
3005 </span>
3006 </div>
3007 <?php } ?>
3008 </div>
3009
3010 <span class="wpvr-switcher">
3011 <input id="<?= $id;?>" class="vr-switcher-check" name="<?= $name; ?>" type="checkbox" value="1" <?php checked( $checked, 1 ); ?> />
3012 <label for="<?= $id;?>"></label>
3013 </span>
3014
3015
3016 </div>
3017 <?php if(isset($val['id']) && $val['id'] === 'wpvr_scene_animation') { ?>
3018 <div class="scene-animation-settings-wrapper">
3019 <?php WPVR_Meta_Field::render_scene_animation_transition_data_wrapper_fields($postdata) ;?>
3020 </div>
3021 <?php } ?>
3022 <?php
3023 ob_end_flush();
3024 }
3025
3026 public static function render_generic_form_checkbox($name, $val)
3027 {
3028 extract( $val );
3029 ob_start();
3030 ?>
3031 <div class="<?= $class; ?>">
3032
3033 <div class="wpvr-tooltip-area">
3034 <span><?= __($title.': ', 'wpvr'); ?></span>
3035 <?php if(!empty($have_tooltip)) { ?>
3036 <div class="field-tooltip">
3037 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3038
3039 <span>
3040 <?php
3041 // Ensure tooltip_text text is set
3042 if (!empty($tooltip_text['text'])) {
3043 echo esc_html($tooltip_text['text']);
3044
3045 // Check if URL exists before rendering the link
3046 if (!empty($tooltip_text['url'])) {
3047 printf(
3048 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3049 esc_url($tooltip_text['url']),
3050 __('View Doc', 'wpvr')
3051 );
3052 }
3053 }
3054 ?>
3055 </span>
3056 </div>
3057 <?php } ?>
3058 </div>
3059
3060 <span class="wpvr-switcher">
3061 <input id="<?= $id;?>" class="vr-switcher-check" name="<?= $name; ?>" type="checkbox" value="<?= $val['checked']; ?>" <?php echo $val['checked']=='on'? 'checked' : '' ?> <?= !$is_disable ? 'disabled' : '' ?>/>
3062 <label for="<?= $id;?>"></label>
3063 </span>
3064
3065 </div>
3066 <?php
3067 ob_end_flush();
3068 }
3069
3070
3071 /**
3072 * Render Numder Input Field
3073 * @param mixed $name input name
3074 * @param mixed $val options
3075 *
3076 * @return void
3077 * @since 8.0.0
3078 */
3079 public static function render_number_field($name, $val)
3080 {
3081 extract( $val );
3082 ob_start();
3083 ?>
3084 <div class="<?= $class; ?>">
3085
3086 <div class="wpvr-tooltip-area">
3087 <span><?= __($title.': ', 'wpvr'); ?></span>
3088
3089 <?php if(!empty($have_tooltip)) { ?>
3090 <div class="field-tooltip">
3091 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3092
3093 <span>
3094 <?php
3095 // Ensure tooltip_text text is set
3096 if (!empty($tooltip_text['text'])) {
3097 echo esc_html($tooltip_text['text']);
3098
3099 // Check if URL exists before rendering the link
3100 if (!empty($tooltip_text['url'])) {
3101 printf(
3102 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3103 esc_url($tooltip_text['url']),
3104 __('View Doc', 'wpvr')
3105 );
3106 }
3107 }
3108 ?>
3109 </span>
3110 </div>
3111 <?php } ?>
3112 </div>
3113 <input type="number" name="<?= $name; ?>" min="0" value="<?= $value; ?>" placeholder="<?= $placeholder;?>" />
3114
3115
3116 </div>
3117 <?php
3118 ob_end_flush();
3119 }
3120
3121 public static function render_tour_layout_select($name, $val)
3122 {
3123 extract( $val );
3124 ob_start();
3125 $preview = '';
3126 if(defined('WPVR_PRO_VERSION')){
3127 $preview = '<span class="wpvr-layout__hover-text">'. __('Preview','wpvr').'</span>';
3128 }
3129 ?>
3130 <div class="<?= $class; ?>">
3131 <?php if(!defined('WPVR_PRO_VERSION')){
3132 echo '<div class="tour-layout-pro-tag">pro</div>';
3133 }?>
3134 <div class="wpvr-layout">
3135 <div class="wpvr-tooltip-area">
3136 <span lass="wpvr-layout__label"><?= __($title.': ', 'wpvr'); ?></span>
3137 <?php if(!empty($have_tooltip)) { ?>
3138 <div class="field-tooltip">
3139 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3140
3141 <span>
3142 <?php
3143 // Ensure tooltip_text text is set
3144 if (!empty($tooltip_text['text'])) {
3145 echo esc_html($tooltip_text['text']);
3146
3147 // Check if URL exists before rendering the link
3148 if (!empty($tooltip_text['url'])) {
3149 printf(
3150 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3151 esc_url($tooltip_text['url']),
3152 __('View Doc', 'wpvr')
3153 );
3154 }
3155 }
3156 ?>
3157 </span>
3158 </div>
3159 <?php } ?>
3160
3161 </div>
3162
3163 <div class="wpvr-layout__container">
3164 <input type="hidden" id="layout_icon_bg_color" name="layout_icon_bg_color" value=<?php echo $value['layout_icon_bg_color'] ?> >
3165 <input type="hidden" id="layout_icon_color" name="layout_icon_color" value=<?php echo $value['layout_icon_color'] ?> >
3166
3167 <div class="wpvr-layout__radio-container">
3168 <input type="radio" id="default" name="tourLayout" value="default" <?php echo $value['layout'] =='default'? 'checked' : '' ?>>
3169 <div class="wpvr-layout__img">
3170 <label for="default" class="wpvr-layout__radio-label" data-layout='default' data-preview-image=<?php echo WPVR_PLUGIN_DIR_URL .'admin/icon/default-layout-preview.png' ?>>
3171 <img src="<?php echo WPVR_PLUGIN_DIR_URL .'admin/icon/default-layout.png' ?>" alt="Default" class="wpvr-layout__radio-image <?php echo $value['layout'] =='default'? 'active' : '' ?>">
3172 <?php echo $preview; ?>
3173 </label>
3174 <span class="wpvr-layout__radio-text"><?php echo __('Classic Layout','wpvr')?></span>
3175 </div>
3176 </div>
3177
3178 <div class="wpvr-layout__radio-container">
3179 <input type="radio" id="layout1" name="tourLayout" value="layout1" <?php echo $value['layout'] =='layout1'? 'checked' : '' ?>>
3180
3181 <div class="wpvr-layout__img">
3182 <label for="layout1" class="wpvr-layout__radio-label" data-layout='layout1' data-bg-color='<?php echo $value['layout_icon_bg_color'] ?>' data-icon-color='<?php echo $value['layout_icon_color'] ?>'>
3183 <img src="<?php echo WPVR_PLUGIN_DIR_URL .'admin/icon/layout-1.png' ?>" alt="Layout 1" class="wpvr-layout__radio-image <?php echo $value['layout'] =='layout1'? 'active' : '' ?>">
3184 <?php echo $preview; ?>
3185 </label>
3186
3187 <span class="wpvr-layout__radio-text"><?php echo __('Modern Layout','wpvr')?></span>
3188 </div>
3189
3190 </div>
3191
3192
3193 <!---->
3194 <!-- <div class="wpvr-layout__radio-container">-->
3195 <!-- <input type="radio" id="comingsoon" name="tourLayout" value="comingsoon" disabled>-->
3196 <!-- <label for="comingsoon" class="wpvr-layout__radio-label">-->
3197 <!-- <img src="--><?php //echo WPVR_PLUGIN_DIR_URL .'admin/icon/coming_soon_layout.png' ?><!--" alt="Coming Soon" class="wpvr-layout__radio-image">-->
3198 <!-- </label>-->
3199 <!-- <span class="layout__radio-text">--><?php //echo __('Coming Soon','wpvr')?><!--</span>-->
3200 <!-- </div>-->
3201
3202 </div>
3203 <!-- .wpvr-layout__container end -->
3204
3205 </div>
3206
3207 </div>
3208
3209 <?php
3210 ob_end_flush();
3211 }
3212
3213 public static function render_text_field($name, $val)
3214 {
3215 extract( $val );
3216 ob_start();
3217 ?>
3218 <div class="<?= $class; ?>">
3219
3220 <div class="wpvr-tooltip-area">
3221 <span><?= __($title.': ', 'wpvr'); ?></span>
3222
3223 <?php if(!empty($have_tooltip)) { ?>
3224 <div class="field-tooltip">
3225 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3226
3227 <span>
3228 <?php
3229 // Ensure tooltip_text text is set
3230 if (!empty($tooltip_text['text'])) {
3231 echo esc_html($tooltip_text['text']);
3232
3233 // Check if URL exists before rendering the link
3234 if (!empty($tooltip_text['url'])) {
3235 printf(
3236 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3237 esc_url($tooltip_text['url']),
3238 __('View Doc', 'wpvr')
3239 );
3240 }
3241 }
3242 ?>
3243 </span>
3244 </div>
3245 <?php } ?>
3246 </div>
3247
3248 <input type="text" name="<?= $name; ?>" value='<?= $value; ?>' placeholder="<?= $placeholder;?>" />
3249
3250 </div>
3251 <?php
3252 ob_end_flush();
3253 }
3254
3255
3256 /**
3257 * Render Hotspot Setting Text Fields
3258 * @param mixed $name input field name
3259 * @param mixed $val options
3260 *
3261 * @return void
3262 * @since 8.0.0
3263 */
3264 public static function render_hotspot_text_field($name, $val)
3265 {
3266 extract($val);
3267 ob_start();
3268 ?>
3269
3270 <div class="hotspot-setting">
3271
3272 <div class="wpvr-global-tooltip-area">
3273 <label for="<?= $input_id;?>"><?= __($title.': ', 'wpvr'); ?></label>
3274
3275 <?php if(!empty($have_tooltip)) { ?>
3276 <div class="field-tooltip">
3277 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3278
3279 <span>
3280 <?php
3281 // Ensure tooltip_text text is set
3282 if (!empty($tooltip_text['text'])) {
3283 echo esc_html($tooltip_text['text']);
3284
3285 // Check if URL exists before rendering the link
3286 if (!empty($tooltip_text['url'])) {
3287 printf(
3288 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3289 esc_url($tooltip_text['url']),
3290 __('View Doc', 'wpvr')
3291 );
3292 }
3293 }
3294 ?>
3295 </span>
3296 </div>
3297 <?php } ?>
3298
3299 </div>
3300
3301 <input type="text" id="<?= $input_id;?>" value="<?= $value;?>" class="<?= $input_class;?>" name="<?= $name;?>"/>
3302 </div>
3303
3304 <?php
3305 ob_end_flush();
3306 }
3307
3308
3309 /**
3310 * Render checkbox for same tab feature on hotspot
3311 *
3312 * @param mixed $name
3313 * @param mixed $val
3314 *
3315 * @return void
3316 * @since 8.0.0
3317 */
3318 public static function render_hotspot_same_tab_checkbox_field($name, $val)
3319 {
3320 extract($val);
3321 ob_start();
3322 ?>
3323
3324 <div class="single-settings s_tab" style="display:<?= $display ?>;">
3325
3326 <div class="wpvr-global-tooltip-area">
3327 <span><?= __($title.': ', 'wpvr'); ?></span>
3328
3329 <?php if(!empty($have_tooltip)) { ?>
3330 <div class="field-tooltip">
3331 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3332
3333 <span>
3334 <?php
3335 // Ensure tooltip_text text is set
3336 if (!empty($tooltip_text['text'])) {
3337 echo esc_html($tooltip_text['text']);
3338
3339 // Check if URL exists before rendering the link
3340 if (!empty($tooltip_text['url'])) {
3341 printf(
3342 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3343 esc_url($tooltip_text['url']),
3344 __('View Doc', 'wpvr')
3345 );
3346 }
3347 }
3348 ?>
3349 </span>
3350 </div>
3351 <?php } ?>
3352
3353 </div>
3354
3355 <label class="wpvr-switcher-v2">
3356 <input type="checkbox" class="wpvr_url_open" name="<?= $name;?>" value="<?= $value;?>" <?php if($value == 'on') { echo 'checked'; } ?> >
3357 <span class="switcher-box"></span>
3358 </label>
3359 </div>
3360
3361 <?php
3362 ob_end_flush();
3363 }
3364
3365
3366 /**
3367 * Render Hotspot Setting Pro Version Text Fields
3368 * @param mixed $name input field name
3369 * @param mixed $val options
3370 *
3371 * @return void
3372 * @since 8.0.0
3373 */
3374 public static function render_hotspot_pro_text_field($name, $val)
3375 {
3376 extract($val);
3377 ob_start();
3378 ?>
3379
3380 <div class="hotspot-scene" style="display:none;">
3381
3382 <div class="wpvr-global-tooltip-area">
3383 <label for="<?= $name;?>"><?= __($title.': ', 'wpvr'); ?></label>
3384
3385 <?php if(!empty($have_tooltip)) { ?>
3386 <div class="field-tooltip">
3387 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3388
3389 <span>
3390 <?php
3391 // Ensure tooltip_text text is set
3392 if (!empty($tooltip_text['text'])) {
3393 echo esc_html($tooltip_text['text']);
3394
3395 // Check if URL exists before rendering the link
3396 if (!empty($tooltip_text['url'])) {
3397 printf(
3398 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3399 esc_url($tooltip_text['url']),
3400 __('View Doc', 'wpvr')
3401 );
3402 }
3403 }
3404 ?>
3405 </span>
3406 </div>
3407 <?php } ?>
3408 </div>
3409
3410 <input class="<?= $name;?>" type="text" name="<?= $name;?>"/>
3411 </div>
3412
3413 <?php
3414 ob_end_flush();
3415 }
3416
3417
3418 /**
3419 * Render Hotspot Setting Terget Scene related text fields
3420 * @param mixed $name input field name
3421 * @param mixed $val options
3422 *
3423 * @return void
3424 * @since 8.0.0
3425 */
3426 public static function render_hotspot_terget_scene_pro_text_field($name, $val)
3427 {
3428 extract($val);
3429 ob_start();
3430 ?>
3431
3432 <div class="hotspot-scene" style="display:block;" >
3433 <label for="<?= $name;?>"><?= __($title.': ', 'wpvr'); ?></label>
3434
3435 <?php if(!empty($have_tooltip)) { ?>
3436 <div class="field-tooltip">
3437 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3438
3439 <span>
3440 <?php
3441 // Ensure tooltip_text text is set
3442 if (!empty($tooltip_text['text'])) {
3443 echo esc_html($tooltip_text['text']);
3444
3445 // Check if URL exists before rendering the link
3446 if (!empty($tooltip_text['url'])) {
3447 printf(
3448 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3449 esc_url($tooltip_text['url']),
3450 __('View Doc', 'wpvr')
3451 );
3452 }
3453 }
3454 ?>
3455 </span>
3456 </div>
3457 <?php } ?>
3458
3459 <input class="<?= $name;?>" type="text" name="<?= $name;?>" value="<?= $value ?>" />
3460 </div>
3461
3462 <?php
3463 ob_end_flush();
3464 }
3465
3466
3467 /**
3468 * Render Hotspot Info Type Selct Field
3469 * @param mixed $name input field name
3470 * @param mixed $val options
3471 *
3472 * @return void
3473 * @since 8.0.0
3474 */
3475 public static function render_hotspot_info_type_select_field($name, $val)
3476 {
3477 extract($val);
3478 $default_type = apply_filters('wpvr_hotspot_types', array(
3479 'info' => __('Info', 'wpvr-pro'),
3480 'scene' => __('Scene', 'wpvr-pro'),
3481 ));
3482 ob_start();
3483 ?>
3484
3485 <div class="wpvr-global-tooltip-area">
3486 <label for="hotspot-type"><?= __($title .': ', 'wpvr'); ?></label>
3487
3488 <div class="field-tooltip">
3489 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
3490 <span>
3491 <?= __('Choose the type of hotspot: Info (displays information) or Scene (links to another scene).', 'wpvr') ?>
3492
3493 <?php
3494 $tooltip_url = 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/#0-toc-title'; // Replace with the actual documentation link
3495 if (!empty($tooltip_url)) :
3496 ?>
3497 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
3498 <?= __('View Doc', 'wpvr'); ?>
3499 </a>
3500 <?php endif; ?>
3501 </span>
3502 </div>
3503
3504 </div>
3505
3506 <select name="<?= $name;?>">
3507 <?php
3508 $hotspot_type = 'info';
3509 foreach ($default_type as $key => $value) {
3510 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
3511 } ?>
3512 </select>
3513
3514 <?php
3515 do_action('hotspot_info_before_hover_content', 'info', array());
3516 ob_end_flush();
3517 }
3518
3519
3520 /**
3521 * Render Hotspot Scene Type Selct Field
3522 * @param mixed $name input field name
3523 * @param mixed $val options
3524 *
3525 * @return void
3526 * @since 8.0.0
3527 */
3528 public static function render_hotspot_scene_type_select_field($name, $val)
3529 {
3530 extract($val);
3531 $default_type = apply_filters('wpvr_hotspot_types', array(
3532 'info' => __('Info', 'wpvr-pro'),
3533 'scene' => __('Scene', 'wpvr-pro'),
3534 ));
3535 ob_start();
3536 ?>
3537
3538 <label for="hotspot-type"><?= __($title .': ', 'wpvr'); ?></label>
3539 <select class="trtr" name="<?= $name;?>">
3540 <?php
3541 $hotspot_type = 'scene';
3542 foreach ($default_type as $key => $value) {
3543 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
3544 } ?>
3545 </select>
3546
3547 <?php
3548 do_action('hotspot_info_before_hover_content', 'scene', array());
3549 ob_end_flush();
3550 }
3551
3552
3553 /**
3554 * Render Hotspot Info Type URL field
3555 * @param mixed $name input field name
3556 * @param mixed $val options
3557 *
3558 * @return void
3559 * @since 8.0.o
3560 */
3561 public static function render_hotspot_info_url_field($name, $val)
3562 {
3563 extract($val);
3564 ob_start();
3565 ?>
3566
3567 <div class="hotspot-url" style="display:<?= $display;?>;">
3568
3569 <div class="wpvr-global-tooltip-area">
3570 <label for="hotspot-url"><?= __($title .': ', 'wpvr'); ?></label>
3571
3572 <?php if(!empty($have_tooltip)) { ?>
3573 <div class="field-tooltip">
3574 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3575
3576 <span>
3577 <?php
3578 // Ensure tooltip_text text is set
3579 if (!empty($tooltip_text['text'])) {
3580 echo esc_html($tooltip_text['text']);
3581
3582 // Check if URL exists before rendering the link
3583 if (!empty($tooltip_text['url'])) {
3584 printf(
3585 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3586 esc_url($tooltip_text['url']),
3587 __('View Doc', 'wpvr')
3588 );
3589 }
3590 }
3591 ?>
3592 </span>
3593 </div>
3594 <?php } ?>
3595 </div>
3596
3597 <input type="url" name="<?= $name;?>" value="<?= $value;?>" />
3598 </div>
3599
3600 <?php
3601 ob_end_flush();
3602 }
3603
3604
3605 /**
3606 * Render Hotspot Textarea Field
3607 * @param mixed $name input field name
3608 * @param mixed $val options
3609 *
3610 * @return void
3611 * @since 8.0.0
3612 */
3613 public static function render_hotspot_textarea_field($name, $val)
3614 {
3615 extract($val);
3616 ob_start();
3617 ?>
3618
3619 <div class="<?= $class;?>">
3620
3621 <div class="wpvr-global-tooltip-area">
3622 <label for="hotspot-content"><?= __($title .': ', 'wpvr'); ?></label>
3623
3624 <?php if(!empty($have_tooltip)) { ?>
3625 <div class="field-tooltip">
3626 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3627
3628 <span>
3629 <?php
3630 // Ensure tooltip_text text is set
3631 if (!empty($tooltip_text['text'])) {
3632 echo esc_html($tooltip_text['text']);
3633
3634 // Check if URL exists before rendering the link
3635 if (!empty($tooltip_text['url'])) {
3636 printf(
3637 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3638 esc_url($tooltip_text['url']),
3639 __('View Doc', 'wpvr')
3640 );
3641 }
3642 }
3643 ?>
3644 </span>
3645 </div>
3646 <?php } ?>
3647 </div>
3648
3649 <textarea name="<?= $name;?>"></textarea>
3650 </div>
3651
3652 <?php
3653 ob_end_flush();
3654 }
3655
3656
3657 /**
3658 * Render Hotspot Info Type Textarea Field
3659 * @param mixed $name input field name
3660 * @param mixed $val options
3661 *
3662 * @return void
3663 * @since 8.0.0
3664 */
3665 public static function render_hotspot_info_textarea_field($name, $val)
3666 {
3667 extract($val);
3668 ob_start();
3669 ?>
3670 <div class="<?= esc_attr($class); ?>" style="display:<?= esc_attr($display); ?>;">
3671 <div class="wpvr-global-tooltip-area">
3672 <label for="hotspot-content"><?= esc_html__($title . ': ', 'wpvr'); ?></label>
3673
3674 <?php if (!empty($have_tooltip)) { ?>
3675 <div class="field-tooltip">
3676 <img loading="lazy" src="<?= esc_url(WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'); ?>" alt="icon" />
3677 <span>
3678 <?php
3679 if (!empty($tooltip_text['text'])) {
3680 echo esc_html($tooltip_text['text']);
3681
3682 if (!empty($tooltip_text['url'])) {
3683 printf(
3684 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3685 esc_url($tooltip_text['url']),
3686 __('View Doc', 'wpvr')
3687 );
3688 }
3689 }
3690 ?>
3691 </span>
3692 </div>
3693 <?php } ?>
3694 </div>
3695
3696 <textarea name="<?= esc_attr($name); ?>"><?= esc_textarea(wp_kses($value ?? '', wp_kses_allowed_html('post'))); ?></textarea>
3697 </div>
3698 <?php
3699 ob_end_flush();
3700 }
3701
3702
3703
3704 /**
3705 * Render Hotspot Scene Type Textarea Field
3706 * @param mixed $name input field name
3707 * @param mixed $val options
3708 *
3709 * @return void
3710 * @since 8.0.0
3711 */
3712 public static function render_hotspot_scene_content_field($name, $val)
3713 {
3714 extract($val);
3715 ob_start();
3716 ?>
3717
3718 <div class="<?= $class;?>" style="display:<?= $display;?>;">
3719 <label for="hotspot-content"><?= __($title .': ', 'wpvr'); ?></label>
3720 <textarea name="<?= $name;?>"></textarea>
3721 </div>
3722
3723 <?php
3724 ob_end_flush();
3725 }
3726
3727
3728 /**
3729 * Render Hotspot Scene Select Field
3730 * @param mixed $name input field name
3731 * @param mixed $val options
3732 *
3733 * @return void
3734 */
3735 public static function render_hotspot_scene_select_field($name, $val)
3736 {
3737 extract($val);
3738 ob_start();
3739 ?>
3740
3741 <div class="hotspot-scene" style="display:none;" >
3742 <div class="wpvr-global-tooltip-area">
3743 <label for="hotspot-scene"><?= __($title .': ', 'wpvr'); ?></label>
3744
3745 <?php if(!empty($have_tooltip)) { ?>
3746 <div class="field-tooltip">
3747 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3748
3749 <span>
3750 <?php
3751 // Ensure tooltip_text text is set
3752 if (!empty($tooltip_text['text'])) {
3753 echo esc_html($tooltip_text['text']);
3754
3755 // Check if URL exists before rendering the link
3756 if (!empty($tooltip_text['url'])) {
3757 printf(
3758 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3759 esc_url($tooltip_text['url']),
3760 __('View Doc', 'wpvr')
3761 );
3762 }
3763 }
3764 ?>
3765 </span>
3766 </div>
3767 <?php } ?>
3768 </div>
3769
3770 <select class="hotspotscene" name="<?= $name;?>">
3771 <option value="none" selected> None</option>
3772 </select>
3773 </div>
3774
3775 <?php
3776 ob_end_flush();
3777 }
3778
3779
3780 /**
3781 * Render Hotspot Scene List Select Field
3782 * @param mixed $name input field name
3783 * @param mixed $val options
3784 *
3785 * @return void
3786 */
3787 public static function render_hotspot_scene_list_field($name, $val)
3788 {
3789 extract($val);
3790 ob_start();
3791 ?>
3792
3793 <div class="hotspot-scene" style="display:<?= $display;?>;" >
3794
3795 <div class="wpvr-global-tooltip-area">
3796 <label for="hotspot-scene"><?= __($title .': ', 'wpvr'); ?></label>
3797 <?php if(!empty($have_tooltip)) { ?>
3798 <div class="field-tooltip">
3799 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3800
3801 <span>
3802 <?php
3803 // Ensure tooltip_text text is set
3804 if (!empty($tooltip_text['text'])) {
3805 echo esc_html($tooltip_text['text']);
3806
3807 // Check if URL exists before rendering the link
3808 if (!empty($tooltip_text['url'])) {
3809 printf(
3810 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3811 esc_url($tooltip_text['url']),
3812 __('View Doc', 'wpvr')
3813 );
3814 }
3815 }
3816 ?>
3817 </span>
3818 </div>
3819 <?php } ?>
3820 </div>
3821 <select class="hotspotscene" name="<?= $name;?>">
3822 <option value="none" selected> None</option>
3823 </select>
3824 </div>
3825
3826 <?php
3827 ob_end_flush();
3828 }
3829
3830
3831 /**
3832 * Render Hotspot Disabled Select Field
3833 * @param mixed $name input field name
3834 * @param mixed $val options
3835 *
3836 * @return void
3837 * @since 8.0.0
3838 */
3839 public static function render_hotspot_disabled_text_field($name, $val)
3840 {
3841 extract($val);
3842 ob_start();
3843 ?>
3844
3845 <div class="hotspot-scene" style="display:<?= $display;?>;" >
3846
3847 <div class="wpvr-global-tooltip-area">
3848 <label for="hotspot-scene"><?= __($title .': ', 'wpvr'); ?></label>
3849 <?php if(!empty($have_tooltip)) { ?>
3850 <div class="field-tooltip">
3851 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
3852
3853 <span>
3854 <?php
3855 // Ensure tooltip_text text is set
3856 if (!empty($tooltip_text['text'])) {
3857 echo esc_html($tooltip_text['text']);
3858
3859 // Check if URL exists before rendering the link
3860 if (!empty($tooltip_text['url'])) {
3861 printf(
3862 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3863 esc_url($tooltip_text['url']),
3864 __('View Doc', 'wpvr')
3865 );
3866 }
3867 }
3868 ?>
3869 </span>
3870 </div>
3871 <?php } ?>
3872 </div>
3873
3874 <input class="<?= $input_class;?>" type="text" value="<?= $value;?>" name="<?= $name;?>" disabled/>
3875 </div>
3876
3877 <?php
3878 ob_end_flush();
3879 }
3880
3881
3882 /**
3883 * Render Hotspot Custom Icon Field
3884 * @param mixed $name input field name
3885 * @param mixed $val options
3886 *
3887 * @return void
3888 * @since 8.0.0
3889 */
3890 public static function render_hotspot_custom_icon_field($name, $val)
3891 {
3892 extract($val);
3893 ob_start();
3894 ?>
3895
3896 <div class="hotspot-setting custom-icon">
3897 <div class="wpvr-global-tooltip-area">
3898 <label for="hotspot-customclass-pro"><?= __($title .': ', 'wpvr'); ?></label>
3899
3900 <div class="field-tooltip">
3901 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
3902 <span>
3903 <?= __('Select a custom icon for the hotspot.', 'wpvr') ?>
3904
3905 <?php
3906 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/';
3907 if (!empty($tooltip_url)) :
3908 ?>
3909 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
3910 <?= __('View Doc', 'wpvr'); ?>
3911 </a>
3912 <?php endif; ?>
3913 </span>
3914 </div>
3915
3916 </div>
3917
3918 <select class="hotspot-customclass-pro-select" name="<?= $name;?>">
3919 <?php
3920 foreach ($custom_icons as $cikey => $civalue) {
3921 if ($cikey == $hotspot_custom_class_pro) { ?>
3922 <option value="<?= $cikey ?>" selected> <?= $civalue ?></option>
3923 <?php } else { ?>
3924 <option value="<?= $cikey ?>"> <?= $civalue ?></option>
3925 <?php }
3926 }
3927 ?>
3928 </select>
3929
3930 <span class="change-icon"><i class="<?= $hotspot_custom_class_pro ?>"></i></span>
3931
3932
3933 </div>
3934
3935 <?php
3936 ob_end_flush();
3937 }
3938
3939
3940 /**
3941 * Render Hotspot Custom Icon Color Field
3942 * @param mixed $name input field name
3943 * @param mixed $val options
3944 *
3945 * @return void
3946 * @since 8.0.0
3947 */
3948 public static function render_hotspot_custom_icon_color_field($name, $val)
3949 {
3950 extract($val);
3951 ob_start();
3952 ?>
3953
3954 <div class="hotspot-setting hotspot-icon">
3955 <div class="wpvr-global-tooltip-area">
3956 <label for="hotspot-customclass-color"><?= __($title .': ', 'wpvr'); ?></label>
3957
3958 <div class="field-tooltip">
3959 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
3960 <span>
3961 <?= __('Set a custom background color for the hotspot.', 'wpvr') ?>
3962
3963 <?php
3964 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
3965 if (!empty($tooltip_url)) :
3966 ?>
3967 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
3968 <?= __('View Doc', 'wpvr'); ?>
3969 </a>
3970 <?php endif; ?>
3971 </span>
3972 </div>
3973
3974 </div>
3975
3976 <input type="color" class="hotspot-customclass-color" name="hotspot-customclass-color" value="<?= $value;?>" />
3977 <input type="hidden" class="hotspot-customclass-color-icon-value" name="<?= $name;?>" value="<?= $value;?>" />
3978 </div>
3979
3980 <?php
3981 ob_end_flush();
3982 }
3983 /**
3984 * Render Hotspot Custom Icon Color Field
3985 * @param mixed $name input field name
3986 * @param mixed $val options
3987 *
3988 * @return void
3989 * @since 8.0.0
3990 */
3991 public static function render_hotspot_wpvr_custom_icon_color_field($name, $val)
3992 {
3993 extract($val);
3994 ob_start();
3995 ?>
3996
3997 <div class="hotspot-setting hotspot-icon">
3998
3999 <div class="wpvr-global-tooltip-area">
4000 <label for="hotspot-custom-color"><?= __($title .': ', 'wpvr'); ?></label>
4001
4002 <div class="field-tooltip">
4003 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
4004 <span>
4005 <?= __('Set a custom color for the hotspot icon.', 'wpvr') ?>
4006
4007 <?php
4008 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4009 if (!empty($tooltip_url)) :
4010 ?>
4011 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4012 <?= __('View Doc', 'wpvr'); ?>
4013 </a>
4014 <?php endif; ?>
4015 </span>
4016 </div>
4017 </div>
4018
4019 <input type="color" class="hotspot-custom-color" name="hotspot-customc-color" value="<?= $value;?>" />
4020 <input type="hidden" class="hotspot-custom-icon-color-value" name="<?= $name;?>" value="<?= $value;?>" />
4021 </div>
4022
4023 <?php
4024 ob_end_flush();
4025 }
4026
4027
4028 /**
4029 * Render Hotspot Animation Field
4030 * @param mixed $name input field name
4031 * @param mixed $val options
4032 *
4033 * @return void
4034 * @since 8.0.0
4035 */
4036 public static function render_hotspot_animation_field($name, $val)
4037 {
4038 extract($val);
4039 ob_start();
4040 ?>
4041
4042 <div class="hotspot-setting">
4043
4044 <div class="wpvr-global-tooltip-area">
4045 <label for="hotspot-blink"><?= __($title .': ', 'wpvr'); ?></label>
4046
4047 <div class="field-tooltip">
4048 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
4049 <span>
4050 <?= __('Enable an animation for the hotspot.', 'wpvr') ?>
4051
4052 <?php
4053 $tooltip_url = 'https://rextheme.com/docs/individual-hotspot-icon-color-animation-panorama/#0-toc-title'; // Replace with the actual documentation link
4054 if (!empty($tooltip_url)) :
4055 ?>
4056 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4057 <?= __('View Doc', 'wpvr'); ?>
4058 </a>
4059 <?php endif; ?>
4060 </span>
4061 </div>
4062 </div>
4063
4064 <select name="<?= $name;?>" class="hotspot-blink" >
4065 <option value="on" <?php if($selected == 'on') { echo 'selected'; } ?> > On</option>
4066 <option value="off" <?php if($selected == 'off') { echo 'selected'; } ?> > Off</option>
4067 </select>
4068 </div>
4069
4070 <?php
4071 ob_end_flush();
4072 }
4073
4074 /**
4075 * Render Hotspot Animation Field
4076 * @param mixed $name input field name
4077 * @param mixed $val options
4078 *
4079 * @return void
4080 * @since 8.0.0
4081 */
4082 public static function render_hotspot_border_field($name, $val)
4083 {
4084 extract($val);
4085 ob_start();
4086 ?>
4087
4088 <div class="hotspot-setting">
4089 <div class="wpvr-global-tooltip-area">
4090 <label for="hotspot-border"><?= __($title .': ', 'wpvr'); ?></label>
4091
4092 <div class="field-tooltip">
4093 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
4094 <span>
4095 <?= __('Add a border around the hotspot with customizable color, style, and thickness.', 'wpvr') ?>
4096
4097 <?php
4098 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4099 if (!empty($tooltip_url)) :
4100 ?>
4101 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4102 <?= __('View Doc', 'wpvr'); ?>
4103 </a>
4104 <?php endif; ?>
4105 </span>
4106 </div>
4107 </div>
4108
4109
4110 <select name="<?= $name;?>" class="hotspot-border" >
4111 <option value="on" <?php if($selected == 'on') { echo 'selected'; } ?> > On</option>
4112 <option value="off" <?php if($selected == 'off') { echo 'selected'; } ?> > Off</option>
4113 </select>
4114 </div>
4115
4116 <?php
4117 ob_end_flush();
4118 }
4119 /**
4120 * Render Hotspot Animation Field
4121 * @param mixed $name input field name
4122 * @param mixed $val options
4123 *
4124 * @return void
4125 * @since 8.0.0
4126 */
4127 public static function render_hotspot_border_style_field($name, $val)
4128 {
4129 extract($val);
4130 ob_start();
4131 ?>
4132
4133 <div class='hotspot-border-style' >
4134 <label for="<?= $name; ?>"><?= __($title .': ', 'wpvr'); ?></label>
4135 <select name="<?= $name; ?>">
4136 <option value="none" <?= !$selected ? 'selected' : ''; ?>>None</option>
4137 <option value="hidden" <?= $selected == 'hidden' ? 'selected' : ''; ?>>Hidden</option>
4138 <option value="dotted" <?= $selected == 'dotted' ? 'selected' : ''; ?>>Dotted</option>
4139 <option value="dashed" <?= $selected == 'dashed' ? 'selected' : ''; ?>>Dashed</option>
4140 <option value="solid" <?= $selected == 'solid' ? 'selected' : ''; ?>>Solid</option>
4141 <option value="double" <?= $selected == 'double' ? 'selected' : ''; ?>>Double</option>
4142 <option value="groove" <?= $selected == 'groove' ? 'selected' : ''; ?>>Groove</option>
4143 <option value="ridge" <?= $selected == 'ridge' ? 'selected' : ''; ?>>Ridge</option>
4144 <option value="inset" <?= $selected == 'inset' ? 'selected' : ''; ?>>Inset</option>
4145 <option value="outset" <?= $selected == 'outset' ? 'selected' : ''; ?>>Outset</option>
4146 </select>
4147 </div>
4148
4149 <?php
4150 ob_end_flush();
4151 }
4152
4153 public static function render_hotspot_border_color_field($name, $val)
4154 {
4155 extract($val);
4156 ob_start();
4157 ?>
4158 <div class='hotspot-border-color'>
4159 <label for="hotspot-border-color"><?= __($title .': ', 'wpvr'); ?></label>
4160 <input type="color" class="hotspot-border-color-for-view" name="hotspot-border-color-for-view" value="<?= $value;?>" />
4161 <input type="hidden" class="hotspot-border-color" name="<?= $name;?>" value="<?= $value;?>" />
4162 </div>
4163 </div>
4164 <?php
4165 ob_end_flush();
4166 }
4167
4168 public static function render_hotspot_border_width_field($name, $val)
4169 {
4170 extract($val);
4171 ob_start();
4172 ?>
4173 <div class="hotspot-setting hotspot-border-setting" style='<?php echo $hotspot_border_data == 'off' ? 'display:none': '' ?>'>
4174 <div class='hotspot-setting-border-width'>
4175 <label for="hotspot-border-width"><?= __($title .': ', 'wpvr'); ?></label>
4176 <input type="text" class="hotspot-border-width" name="hotspot-border-width" value="<?= $value;?>" />
4177 </div>
4178
4179
4180 <?php
4181 ob_end_flush();
4182 }
4183
4184 /**
4185 * Render Hotspot Animation Field
4186 * @param mixed $name input field name
4187 * @param mixed $val options
4188 *
4189 * @return void
4190 * @since 8.0.0
4191 */
4192 public static function render_hotspot_shape_field($name, $val)
4193 {
4194 extract($val);
4195 ob_start();
4196 ?>
4197
4198 <div class="hotspot-setting">
4199
4200 <div class="wpvr-global-tooltip-area">
4201 <label for="hotspot-shape"><?= __($title .': ', 'wpvr'); ?></label>
4202
4203 <div class="field-tooltip">
4204 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
4205 <span>
4206 <?= __('Select the shape of the hotspot (e.g., Rounded, square, and Hexagon).', 'wpvr') ?>
4207
4208 <?php
4209 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4210 if (!empty($tooltip_url)) :
4211 ?>
4212 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4213 <?= __('View Doc', 'wpvr'); ?>
4214 </a>
4215 <?php endif; ?>
4216 </span>
4217 </div>
4218 </div>
4219
4220 <select name="<?= $name;?>" class="hotspot-shape" >
4221 <option value="round" <?php if($selected == 'round') { echo 'selected'; } ?> > Rounded</option>
4222 <option value="square" <?php if($selected == 'square') { echo 'selected'; } ?> > Square</option>
4223 <option value="hexagon" <?php if($selected == 'hexagon') { echo 'selected'; } ?> > Hexagon</option>
4224 </select>
4225 </div>
4226
4227 <?php
4228 ob_end_flush();
4229 }
4230
4231 /**
4232 * Render Fluent form Field
4233 * @param mixed $name input field name
4234 * @param mixed $val options
4235 *
4236 * @return void
4237 * @since 8.0.0
4238 */
4239 public static function render_hotspot_fluent_form_type_field($name , $val){
4240 extract($val);
4241 $default_type = apply_filters('wpvr_hotspot_types', array(
4242 'info' => __('Info', 'wpvr-pro'),
4243 'scene' => __('Scene', 'wpvr-pro'),
4244 ));
4245 ob_start();
4246 ?>
4247
4248 <div class="wpvr-global-tooltip-area">
4249 <label for="hotspot-type"><?= __($title .': ', 'wpvr'); ?></label>
4250
4251 <div class="field-tooltip">
4252 <img src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
4253 <span>
4254 <?= __('Choose the type of hotspot: Info (displays information) or Scene (links to another scene).', 'wpvr') ?>
4255
4256 <?php
4257 $tooltip_url = 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/#0-toc-title'; // Replace with the actual documentation link
4258 if (!empty($tooltip_url)) :
4259 ?>
4260 <a href="<?= esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4261 <?= __('View Doc', 'wpvr'); ?>
4262 </a>
4263 <?php endif; ?>
4264 </span>
4265 </div>
4266 </div>
4267
4268 <select name="<?= $name;?>">
4269 <?php
4270 $hotspot_type = 'fluent_form';
4271 foreach ($default_type as $key => $value) {
4272 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
4273 } ?>
4274 </select>
4275
4276 <?php
4277 ob_end_flush();
4278 }
4279
4280 /**
4281 * Render Hotspot Fluent form id
4282 * @param mixed $name input field name
4283 * @param mixed $val options
4284 *
4285 * @return void
4286 * @since 8.0.0
4287 */
4288 public static function render_hotspot_fluent_form_select_field($name , $val){
4289 extract($val);
4290 do_action("hotspot_info_before_hover_content","fluent_form",$value);
4291 }
4292 /**
4293 * Render woocommerce Field
4294 * @param mixed $name input field name
4295 * @param mixed $val options
4296 *
4297 * @return void
4298 * @since 8.0.0
4299 */
4300 public static function render_hotspot_wc_product_type_field($name , $val){
4301 extract($val);
4302 $default_type = apply_filters('wpvr_hotspot_types', array(
4303 'info' => __('Info', 'wpvr-pro'),
4304 'scene' => __('Scene', 'wpvr-pro'),
4305 ));
4306 ob_start();
4307 ?>
4308
4309 <label for="hotspot-type"><?= __($title .': ', 'wpvr'); ?></label>
4310 <select name="<?= $name;?>">
4311 <?php
4312 $hotspot_type = 'wc_product';
4313 foreach ($default_type as $key => $value) {
4314 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
4315 } ?>
4316 </select>
4317
4318 <?php
4319 ob_end_flush();
4320 }
4321
4322 /**
4323 * Render Hotspot Woocommerce Product
4324 * @param mixed $name input field name
4325 * @param mixed $val options
4326 *
4327 * @return void
4328 * @since 8.0.0
4329 */
4330 public static function render_hotspot_wc_product_select_field($name , $val){
4331 extract($val);
4332 do_action("hotspot_info_before_hover_content","wc_product",$value);
4333 }
4334
4335 public static function render_call_to_form_checkbox($name, $val)
4336 {
4337 extract( $val );
4338 ob_start();
4339 ?>
4340 <div class="<?= $class; ?>">
4341 <div class="wpvr-tooltip-area">
4342 <span><?= __($title.': ', 'wpvr'); ?></span>
4343 <?php if(!empty($have_tooltip)) { ?>
4344 <div class="field-tooltip">
4345 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
4346
4347 <span>
4348 <?php
4349 // Ensure tooltip_text text is set
4350 if (!empty($tooltip_text['text'])) {
4351 echo esc_html($tooltip_text['text']);
4352
4353 // Check if URL exists before rendering the link
4354 if (!empty($tooltip_text['url'])) {
4355 printf(
4356 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4357 esc_url($tooltip_text['url']),
4358 __('View Doc', 'wpvr')
4359 );
4360 }
4361 }
4362 ?>
4363 </span>
4364 </div>
4365 <?php } ?>
4366
4367 </div>
4368
4369 <span class="wpvr-switcher">
4370 <input id="<?= $id;?>" class="vr-switcher-check" name="<?= $name; ?>" type="checkbox" value="<?= $val['checked']; ?>" <?php echo $val['checked']=='on'? 'checked' : '' ?> <?= !$is_disable ? 'disabled' : '' ?>/>
4371 <label for="<?= $id;?>"></label>
4372 </span>
4373
4374
4375
4376 </div>
4377 <?php
4378 ob_end_flush();
4379 }
4380
4381 public static function render_text_area_field($name, $val)
4382 {
4383 extract( $val );
4384 ob_start();
4385 ?>
4386 <div class="<?= $class; ?>">
4387 <div id="<?= $code_mirror_id ?>" ></div>
4388 <!-- --><?php //if(!empty($have_tooltip)) {?>
4389 <!-- <div class="field-tooltip">-->
4390 <!-- <img src="--><?php //= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'; ?><!--" alt="icon" />-->
4391 <!-- <span>--><?php //= __($tooltip_text, 'wpvr'); ?><!--</span>-->
4392 <!-- </div>-->
4393 <!-- --><?php //} ?>
4394 </div>
4395 <style>
4396 /* Adjust the styling of line numbers */
4397 .CodeMirror-linenumber {
4398 padding: 0 5px; /* Adjust padding as needed */
4399 color: #999; /* Adjust color as needed */
4400 }
4401
4402 </style>
4403 <?php
4404 ob_end_flush();
4405 }
4406
4407
4408 public static function render_custom_css_form_checkbox($name, $val)
4409 {
4410 extract( $val );
4411 ob_start();
4412 ?>
4413 <div class="<?= $class; ?>">
4414 <div class="wpvr-tooltip-area">
4415 <span><?= __($title.': ', 'wpvr'); ?></span>
4416 <?php if(!empty($have_tooltip)) { ?>
4417 <div class="field-tooltip">
4418 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
4419
4420 <span>
4421 <?php
4422 // Ensure tooltip_text text is set
4423 if (!empty($tooltip_text['text'])) {
4424 echo esc_html($tooltip_text['text']);
4425
4426 // Check if URL exists before rendering the link
4427 if (!empty($tooltip_text['url'])) {
4428 printf(
4429 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4430 esc_url($tooltip_text['url']),
4431 __('View Doc', 'wpvr')
4432 );
4433 }
4434 }
4435 ?>
4436 </span>
4437 </div>
4438 <?php } ?>
4439
4440 </div>
4441
4442 <span class="wpvr-switcher">
4443 <input id="<?= $id;?>" class="vr-switcher-check" name="<?= $name; ?>" type="checkbox" value="<?= $val['checked']; ?>" <?php echo $val['checked']=='on'? 'checked' : '' ?> <?= !$is_disable ? 'disabled' : '' ?>/>
4444 <label for="<?= $id;?>"></label>
4445 </span>
4446
4447 </div>
4448 <?php
4449 ob_end_flush();
4450 }
4451
4452 public static function render_button_configuration_field($name, $val)
4453 {
4454 extract( $val );
4455 ob_start();
4456 $button_style =$val['value'];
4457 $selectedBgColor = isset($button_style['button_background_color']) ? $button_style['button_background_color'] : '#201cfe';
4458 $selectedColor = isset($button_style['button_font_color']) ? $button_style['button_font_color'] : '#ffffff';
4459 $selectedFontSize = isset($button_style['button_font_size']) ? $button_style['button_font_size'] : 14;
4460 $selectedFontWeight = isset($button_style['button_font_weight']) ? $button_style['button_font_weight'] : 400;
4461 $selectedLineHeight = isset($button_style['button_line_height']) ? $button_style['button_line_height'] : 1;
4462 $selectedTextDecoration = isset($button_style['button_text_decoration']) ? $button_style['button_text_decoration'] : 'none';
4463 $selectedTransform = isset($button_style['button_transform']) ? $button_style['button_transform'] : 'none';
4464 $selectedAlignment = isset($button_style['button_alignment']) ? $button_style['button_alignment'] : 'left';
4465 $selectedFontStyle = isset($button_style['button_text_style']) ? $button_style['button_text_style'] : 'normal';
4466 $selectedLetterSpacing = isset($button_style['button_letter_spacing']) ? $button_style['button_letter_spacing'] : 1;
4467 $selectedWordSpacing = isset($button_style['button_word_spacing']) ? $button_style['button_word_spacing'] : 0;
4468 $selectedBorderWidth = isset($button_style['button_border_width']) ? $button_style['button_border_width'] : 1;
4469 $selectedBorderStyle = isset($button_style['button_border_style']) ? $button_style['button_border_style'] : 'solid';
4470 $selectedBorderColor = isset($button_style['button_border_style']) ? $button_style['button_border_color'] : '#201cfe';
4471 $selectedBorderRadius = isset($button_style['button_border_radius']) ? $button_style['button_border_radius'] : 6;
4472
4473 $selectedPaddingTop = isset($button_style['button_pt']) ? $button_style['button_pt'] : 10;
4474 $selectedPaddingRight = isset($button_style['button_pr']) ? $button_style['button_pr'] : 15;
4475 $selectedPaddingBottom = isset($button_style['button_pb']) ? $button_style['button_pb'] : 10;
4476 $selectedPaddingLeft = isset($button_style['button_pl']) ? $button_style['button_pl'] : 15;
4477
4478 $selectedNewTab = isset($button_style['button_open_new_tab']) ? $button_style['button_open_new_tab'] : 'off';
4479 ?>
4480 <div class="<?= $class; ?>">
4481
4482 <div class="button-style-configaration">
4483 <div class="single-cta-control new-tab">
4484 <span class="wpvr-switcher">
4485 <span class="control-title"><?php echo __('Open in new tab','wpvr') ?></span>
4486 <input id="button_open_new_tab" class="vr-switcher-check" name="button_open_new_tab" type="checkbox" value="<?php echo $selectedNewTab ; ?>" <?php echo $selectedNewTab == 'on' ? 'checked' : '' ?> />
4487 <label for="button_open_new_tab"></label>
4488 </span>
4489 </div>
4490
4491 <div class="single-cta-control bg-color color-box">
4492 <label class="control-title"><?php echo __('Background Color :','wpvr') ?></label>
4493 <div class="colors">
4494 <span><?php echo __('Color','wpvr')?></span>
4495 <input type="color" name="button_background_color" value="<?php echo $selectedBgColor; ?>">
4496 </div>
4497
4498 </div>
4499
4500 <div class="single-cta-control font-color color-box">
4501 <label class="control-title"><?php echo __('Font color :','wpvr') ?></label>
4502
4503 <div class="colors">
4504 <span><?php echo __('Color','wpvr')?></span>
4505 <input type="color" name="button_font_color" value="<?php echo $selectedColor; ?>">
4506 </div>
4507
4508 </div>
4509
4510 <div class="single-cta-control font-size">
4511 <label class="control-title"><?php echo __('Font Size (px) :','wpvr') ?></label>
4512 <input type="number" name="button_font_size" value="<?php echo $selectedFontSize; ?>" min="0">
4513 </div>
4514
4515 <div class="single-cta-control font-weight">
4516 <label class="control-title"><?php echo __('Font Weight :','wpvr') ?></label>
4517 <select name="button_font_weight" id="button_font_weight">
4518 <option value="400" <?php echo ($selectedFontWeight == '400') ? 'selected' : ''; ?>>400</option>
4519 <option value="500" <?php echo ($selectedFontWeight == '500') ? 'selected' : ''; ?>>500</option>
4520 <option value="600" <?php echo ($selectedFontWeight == '600') ? 'selected' : ''; ?>>600</option>
4521 <option value="700" <?php echo ($selectedFontWeight == '700') ? 'selected' : ''; ?>>700</option>
4522 <option value="800" <?php echo ($selectedFontWeight == '800') ? 'selected' : ''; ?>>800</option>
4523 <option value="900" <?php echo ($selectedFontWeight == '900') ? 'selected' : ''; ?>>900</option>
4524 </select>
4525 </div>
4526
4527 <div class="single-cta-control line-height">
4528 <label class="control-title"><?php echo __('Line Height :','wpvr') ?></label>
4529 <input type="number" name="button_line_height" value="<?php echo $selectedLineHeight; ?>" min="0">
4530 </div>
4531
4532 <div class="single-cta-control text-decoration">
4533 <label class="control-title"><?php echo __('Text Decoration :','wpvr') ?></label>
4534 <select name="button_text_decoration" id="button_text_decoration">
4535 <option value="none" <?php echo ($selectedTextDecoration == 'none') ? 'selected' : ''; ?>><?php echo __('None','wpvr') ?></option>
4536 <option value="underline" <?php echo ($selectedTextDecoration == 'underline') ? 'selected' : ''; ?>> <?php echo __('Underline','wpvr') ?></option>
4537 <option value="overline" <?php echo ($selectedTextDecoration == 'overline') ? 'selected' : ''; ?>><?php echo __('Overline','wpvr') ?></option>
4538 <option value="line-through" <?php echo ($selectedTextDecoration == 'line-through') ? 'selected' : ''; ?>><?php echo __('Line Through','wpvr') ?></option>
4539 </select>
4540 </div>
4541
4542 <div class="single-cta-control text-transform">
4543 <label class="control-title"><?php echo __('Text Transform :','wpvr') ?></label>
4544 <select name="button_transform" id="button_transform">
4545 <option value="none" <?php echo ($selectedTransform == 'none') ? 'selected' : ''; ?>><?php echo __('None','wpvr') ?></option>
4546 <option value="uppercase" <?php echo ($selectedTransform == 'uppercase') ? 'selected' : ''; ?>><?php echo __('Uppercase','wpvr') ?></option>
4547 <option value="lowercase" <?php echo ($selectedTransform == 'lowercase') ? 'selected' : ''; ?>><?php echo __('Lowercase','wpvr') ?></option>
4548 <option value="capitalize" <?php echo ($selectedTransform == 'capitalize') ? 'selected' : ''; ?>><?php echo __('Capitalize','wpvr') ?></option>
4549 </select>
4550 </div>
4551
4552 <div class="single-cta-control text-align">
4553 <label class="control-title"> <?php echo __('Button Alignment :','wpvr') ?></label>
4554 <select name="button_alignment" id="button_alignment">
4555 <option value="left" <?php echo ($selectedAlignment == 'left') ? 'selected' : ''; ?>> <?php echo __('Left','wpvr') ?></option>
4556 <option value="right" <?php echo ($selectedAlignment == 'right') ? 'selected' : ''; ?>> <?php echo __('Right','wpvr') ?></option>
4557 <option value="center" <?php echo ($selectedAlignment == 'center') ? 'selected' : ''; ?>> <?php echo __('Center','wpvr') ?></option>
4558 <option value="justified" <?php echo ($selectedAlignment == 'justified') ? 'selected' : ''; ?>> <?php echo __('Justified','wpvr') ?></option>
4559 </select>
4560 </div>
4561
4562 <div class="single-cta-control font-style">
4563 <label class="control-title"> <?php echo __('Font Style :','wpvr') ?></label>
4564 <select name="button_text_style" id="button_text_style">
4565 <option value="normal" <?php echo ($selectedFontStyle == 'normal') ? 'selected' : ''; ?>> <?php echo __('Normal','wpvr') ?></option>
4566 <option value="italic" <?php echo ($selectedFontStyle == 'italic') ? 'selected' : ''; ?>> <?php echo __('Italic','wpvr') ?></option>
4567 <option value="oblique" <?php echo ($selectedFontStyle == 'oblique') ? 'selected' : ''; ?>> <?php echo __('Oblique','wpvr') ?></option>
4568 </select>
4569 </div>
4570
4571 <div class="single-cta-control letter-spacing">
4572 <label class="control-title"> <?php echo __('Letter Spacing (px) :','wpvr') ?></label>
4573 <input type="number" name="button_letter_spacing" value="<?php echo $selectedLetterSpacing; ?>" min="0">
4574 </div>
4575
4576 <div class="single-cta-control word-spacing">
4577 <label class="control-title"> <?php echo __('Word Spacing (px) :','wpvr') ?></label>
4578 <input type="number" name="button_word_spacing" value="<?php echo $selectedWordSpacing; ?>" min="0">
4579 </div>
4580
4581 <div class="single-cta-control border-radius">
4582 <label class="control-title"> <?php echo __('Border Radius (px) :','wpvr') ?></label>
4583 <input type="number" name="button_border_radius" value="<?php echo $selectedBorderRadius; ?>" min="0">
4584 </div>
4585
4586 <div class="single-cta-control control-group border">
4587 <label class="control-title"> <?php echo __('Border :','wpvr') ?></label>
4588 <div class="border-property-area">
4589 <div class="border-property border-width">
4590 <label class="control-inner-title"> <?php echo __('Width (px)','wpvr') ?></label>
4591 <input type="number" name="button_border_width" value="<?php echo $selectedBorderWidth; ?>" min="0">
4592 </div>
4593
4594 <div class="border-property border-style">
4595 <label class="control-inner-title"> <?php echo __('Style','wpvr') ?></label>
4596 <select name="button_border_style" id="button_border_style">
4597 <option value="solid" <?php echo ($selectedBorderStyle == 'solid') ? 'selected' : ''; ?>> <?php echo __('','wpvr') ?>Solid</option>
4598 <option value="dashed" <?php echo ($selectedBorderStyle == 'dashed') ? 'selected' : ''; ?>> <?php echo __('','wpvr') ?>Dashed</option>
4599 <option value="dotted" <?php echo ($selectedBorderStyle == 'dotted') ? 'selected' : ''; ?>> <?php echo __('','wpvr') ?>Dotted</option>
4600 <option value="double" <?php echo ($selectedBorderStyle == 'double') ? 'selected' : ''; ?>> <?php echo __('','wpvr') ?>Double</option>
4601 <option value="none" <?php echo ($selectedBorderStyle == 'none') ? 'selected' : ''; ?>> <?php echo __('','wpvr') ?>None</option>
4602 </select>
4603 </div>
4604
4605 <div class="border-property border-color color-box">
4606 <label class="control-inner-title"> <?php echo __('Color','wpvr') ?></label>
4607 <input type="color" name="button_border_color" value="<?php echo $selectedBorderColor; ?>">
4608 </div>
4609
4610 </div>
4611
4612 </div>
4613
4614 <div class="single-cta-control control-group padding">
4615 <label class="control-title"> <?php echo __('Padding (px) :','wpvr') ?></label>
4616 <div class="border-property-area">
4617 <div class="padding-property padding-top">
4618 <label class="control-inner-title"> <?php echo __('Top','wpvr') ?></label>
4619 <input type="number" name="button_pt" value="<?php echo $selectedPaddingTop; ?>" min="0">
4620 </div>
4621
4622 <div class="padding-property padding-right">
4623 <label class="control-inner-title"> <?php echo __('Right','wpvr') ?></label>
4624 <input type="number" name="button_pr" value="<?php echo $selectedPaddingRight; ?>">
4625 </div>
4626
4627 <div class="padding-property padding-bottom">
4628 <label class="control-inner-title"> <?php echo __('Bottom','wpvr') ?></label>
4629 <input type="number" name="button_pb" value="<?php echo $selectedPaddingBottom; ?>">
4630 </div>
4631
4632 <div class="padding-property padding-left">
4633 <label class="control-inner-title"> <?php echo __('Left','wpvr') ?></label>
4634 <input type="number" name="button_pl" value="<?php echo $selectedPaddingLeft; ?>">
4635 </div>
4636 </div>
4637
4638 </div>
4639
4640 </div>
4641 </div>
4642 <?php
4643 ob_end_flush();
4644 }
4645
4646
4647
4648 /**
4649 * Render background music field on Advanced Controls section
4650 *
4651 * @param mixed $name
4652 * @param mixed $val
4653 *
4654 * @return void
4655 * @since 8.0.0
4656 */
4657 public static function render_vrscene_navigation_option_field($name, $val)
4658 {
4659 extract($val);
4660 ob_start();
4661 ?>
4662 <div class="wpvr-scene-navigation-content" style="display:none">
4663 <?php
4664 foreach($inner_fields as $name => $val) {
4665 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
4666 }
4667 ?>
4668 </div>
4669 <?php
4670 ob_end_flush();
4671 }
4672
4673
4674 /**
4675 * Render checkbox for advanced control pro version meta fields
4676 *
4677 * @param mixed $name
4678 * @param mixed $val
4679 *
4680 * @return void
4681 * @since 8.0.0
4682 */
4683 public static function render_pro_radio_field($name, $val)
4684 {
4685 extract($val);
4686 ob_start();
4687 ?>
4688 <div class="<?= $class; ?>">
4689 <span><?= __($title .'', 'wpvr'); ?></span>
4690
4691 <span class="wpvr-switchers">
4692 <input id="<?= $id; ?>" class="vr-switcher-radio" value="<?= $value?>" name="vr_scene_navigation_content_type" type="radio" <?php echo $checked ?> />
4693 <label for="<?= $id; ?>" class="custom-radio-label"></label>
4694 </span>
4695
4696 <?php if(!empty($have_tooltip)) { ?>
4697 <div class="field-tooltip">
4698 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ?>" alt="icon" />
4699 <span><?= __($tooltip_text, 'wpvr'); ?></span>
4700 </div>
4701 <?php } ?>
4702 </div>
4703 <?php
4704 ob_end_flush();
4705 }
4706
4707
4708 /**
4709 * Render Hotspot Scene Select Field
4710 * @param mixed $name input field name
4711 * @param mixed $val options
4712 *
4713 * @return void
4714 */
4715 public static function render_animation_name_select($name, $val)
4716 {
4717 extract($val);
4718 ob_start();
4719 $default_type = apply_filters('wpvr_scene_animation', array(
4720 'none' => __('None', 'wpvr-pro'),
4721 'circle_crop' => __('Circle Crop', 'wpvr-pro'),
4722
4723 'zoom_in' => __('Zoom In', 'wpvr-pro'),
4724 'zoom_in_up' => __('Zoom In Up', 'wpvr-pro'),
4725 'zoom_in_down' => __('Zoom In Down', 'wpvr-pro'),
4726 'zoom_in_left' => __('Zoom In Left', 'wpvr-pro'),
4727 'zoom_in_right' => __('Zoom In Right', 'wpvr-pro'),
4728
4729 'slide_in_up' => __('Slide In Up', 'wpvr-pro'),
4730 'slide_in_down' => __('Slide In Down', 'wpvr-pro'),
4731 'slide_in_left' => __('Slide In Left', 'wpvr-pro'),
4732 'slide_in_right' => __('Slide In Right', 'wpvr-pro'),
4733
4734 'fade_blur' => __('Fade With Blur', 'wpvr-pro'),
4735 'fade_in' => __('Fade In', 'wpvr-pro'),
4736 'fade_in_up' => __('Fade In Up', 'wpvr-pro'),
4737 'fade_in_down' => __('Fade In Down', 'wpvr-pro'),
4738 'fade_in_left' => __('Fade In Left', 'wpvr-pro'),
4739 'fade_in_right' => __('Fade In Right', 'wpvr-pro'),
4740 'fade_in_top_left' => __('Fade In Top Left', 'wpvr-pro'),
4741 'fade_in_top_right' => __('Fade In Top Right', 'wpvr-pro'),
4742 'fade_in_bottom_left' => __('Fade In Bottom Left', 'wpvr-pro'),
4743 'fade_in_bottom_right' => __('Fade In Bottom Right', 'wpvr-pro'),
4744
4745 'back_in_left' => __('Back In Left', 'wpvr-pro'),
4746 'back_in_right' => __('Back In Right', 'wpvr-pro'),
4747 'back_in_up' => __('Back In Up', 'wpvr-pro'),
4748 'back_in_down' => __('Back In Down', 'wpvr-pro'),
4749
4750 'bounce_in' => __('Bounce In', 'wpvr-pro'),
4751 'bounce_in_up' => __('Bounce In Up', 'wpvr-pro'),
4752 'bounce_in_down' => __('Bounce In Down', 'wpvr-pro'),
4753 'bounce_in_left' => __('Bounce In Left', 'wpvr-pro'),
4754 'bounce_in_right' => __('Bounce In Right', 'wpvr-pro'),
4755
4756 'flip' => __('Flip', 'wpvr-pro'),
4757 'flip_x' => __('Flip X', 'wpvr-pro'),
4758 'flip_y' => __('Flip Y', 'wpvr-pro'),
4759
4760 'light_speed_in_left' => __('Light Speed In Left', 'wpvr-pro'),
4761 'light_speed_in_right' => __('Light Speed In Right', 'wpvr-pro'),
4762
4763 'rotate_in' => __('Rotate In', 'wpvr-pro'),
4764 'rotate_in_up_left' => __('Rotate In Up Left', 'wpvr-pro'),
4765 'rotate_in_up_right' => __('Rotate In Up Right', 'wpvr-pro'),
4766 'rotate_in_down_left' => __('Rotate In Down Left', 'wpvr-pro'),
4767 'rotate_in_down_right' => __('Rotate In Down Right', 'wpvr-pro'),
4768
4769 ));
4770
4771 ?>
4772
4773 <div class='single-settings'>
4774
4775 <div class="wpvr-tooltip-area">
4776 <span for="scene-animation-name"><?= __($title .': ', 'wpvr'); ?></span>
4777 <?php if(!empty($have_tooltip)) { ?>
4778 <div class="field-tooltip">
4779 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
4780
4781 <span>
4782 <?php
4783 // Ensure tooltip_text text is set
4784 if (!empty($tooltip_text['text'])) {
4785 echo esc_html($tooltip_text['text']);
4786
4787 // Check if URL exists before rendering the link
4788 if (!empty($tooltip_text['url'])) {
4789 printf(
4790 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4791 esc_url($tooltip_text['url']),
4792 __('View Doc', 'wpvr')
4793 );
4794 }
4795 }
4796 ?>
4797 </span>
4798 </div>
4799 <?php } ?>
4800 </div>
4801
4802 <select class='scene-animation-name' name="<?= $name;?>">
4803 <?php
4804 foreach ($default_type as $key => $type) {
4805 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $value, true), esc_attr($key), esc_attr($type));
4806 } ?>
4807 </select>
4808 </div>
4809
4810 <?php
4811 ob_end_flush();
4812 }
4813
4814
4815 public static function render_membership_access_name_select($name, $val)
4816 {
4817 extract($val);
4818 ob_start(); // Start output buffering
4819
4820 $membership_access_control_types = apply_filters('get_membership_access_control_types', array(
4821 'none' => __('All Membership Levels', 'wpvr'),
4822 ));
4823 ?>
4824
4825 <div class='single-settings'>
4826 <span for="membership-access-name"><?= __($title .': ', 'wpvr'); ?></span>
4827 <select class=<?= esc_attr($val['class']) ?> id="<?= esc_attr($val['id']) ?>" name="<?= esc_attr($name); ?>">
4828 <?php
4829 foreach ($membership_access_control_types as $key => $type) {
4830 echo sprintf(
4831 "<option %s value='%s'>%s</option>\n",
4832 selected($key, $value, false),
4833 esc_attr($key),
4834 esc_html($type)
4835 );
4836 }
4837 ?>
4838 </select>
4839 </div>
4840
4841 <?php
4842 ob_end_flush();
4843 }
4844
4845 /**
4846 * Render other fields
4847 *
4848 * @param mixed $postdata
4849 *
4850 * @return void
4851 * @since 8.5.27
4852 */
4853 public static function render_other_fields($postdata){
4854 ?>
4855 <?php WPVR_Meta_Field::render_basic_setting_generic_form_fields($postdata);?>
4856 <div class="generic-form-associates">
4857 <?php WPVR_Meta_Field::render_generic_form_associate_fields($postdata) ;?>
4858 </div>
4859
4860 <?php WPVR_Meta_Field::render_basic_setting_call_to_action_fields($postdata);?>
4861 <div class="call-to-action">
4862 <?php WPVR_Meta_Field::render_call_to_action_associate_fields($postdata) ;?>
4863 </div>
4864
4865 <?php WPVR_Meta_Field::render_basic_setting_custom_css_fields($postdata);?>
4866 <div class="custom-css-field">
4867 <?php WPVR_Meta_Field::render_custom_css_associate_fields($postdata) ;?>
4868 </div>
4869 <?php
4870 }
4871
4872
4873 /**
4874 * Renders a checkbox field for keyboard control settings in the advanced settings section
4875 *
4876 * This method renders a checkbox with an optional tooltip. If the checkbox ID is 'wpvr_diskeyboard',
4877 * it also renders additional keyboard control settings.
4878 *
4879 * @param string $name The name attribute for the checkbox input field
4880 * @param array $val Array of field attributes including:
4881 * - class: CSS class for the wrapper div
4882 * - id: HTML ID for the checkbox input
4883 * - title: Text to display as the field label
4884 * - value: Current value of the checkbox ('on' or 'off')
4885 * - have_tooltip: Whether to show tooltip
4886 * - tooltip_text: Array with 'text' and optional 'url' for tooltip content
4887 * @param array $postdata The post data for rendering additional fields
4888 *
4889 * @return void Outputs HTML directly
4890 * @since 8.5.27
4891 */
4892 public static function render_advanced_setting_checkbox_for_mouse_dragg_control_field($name, $val, $postdata)
4893 {
4894 extract( $val );
4895 ob_start();
4896 ?>
4897 <div class="<?= $class; ?>">
4898
4899 <div class="wpvr-tooltip-area">
4900 <span><?= __($title .': ', 'wpvr'); ?></span>
4901
4902 <?php if(!empty($have_tooltip)) { ?>
4903 <div class="field-tooltip">
4904 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
4905
4906 <span>
4907 <?php
4908 // Ensure tooltip_text text is set
4909 if (!empty($tooltip_text['text'])) {
4910 echo esc_html($tooltip_text['text']);
4911
4912 // Check if URL exists before rendering the link
4913 if (!empty($tooltip_text['url'])) {
4914 printf(
4915 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4916 esc_url($tooltip_text['url']),
4917 __('View Doc', 'wpvr')
4918 );
4919 }
4920 }
4921 ?>
4922 </span>
4923 </div>
4924 <?php } ?>
4925
4926 </div>
4927
4928 <span class="wpvr-switcher">
4929 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
4930 <label for="<?= $id; ?>"></label>
4931 </span>
4932 </div>
4933 <?php if(isset($val['id']) && $val['id'] === 'wpvr_draggable') { ?>
4934 <div class="mouse-dragable-control-settings-wrapper">
4935 <?php WPVR_Meta_Field::render_mouse_dragable_control_data_wrapper_fields($postdata) ;?>
4936 </div>
4937 <?php } ?>
4938 <?php
4939 ob_end_flush();
4940 }
4941
4942 /**
4943 * Renders keyboard control related fields wrapped in a container
4944 *
4945 * This method fetches keyboard control fields using get_keyboard_control_data_wrapper_fields method
4946 * and renders each field using the appropriate rendering method based on field type.
4947 * Each field is rendered with an icon using the render_[field_type]_with_icon method.
4948 *
4949 * @param array $postdata Post data containing field values and configurations
4950 *
4951 * @return void Outputs HTML directly
4952 * @since 8.5.27
4953 */
4954 public static function render_mouse_dragable_control_data_wrapper_fields($postdata)
4955 {
4956 $fields = self::get_mouse_dragable_control_data_wrapper_fields($postdata);
4957
4958 foreach($fields as $name => $val) {
4959 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val );
4960 }
4961 }
4962
4963 /**
4964 * Get keyboard control data wrapper fields
4965 *
4966 * Retrieves the fields related to keyboard control settings by applying a filter.
4967 * This function is used to gather all the keyboard control options that can be modified.
4968 *
4969 * @param array $postdata The post data containing the current settings
4970 *
4971 * @return array Filtered array of keyboard control fields and their settings
4972 * @since 8.5.27
4973 */
4974 public static function get_mouse_dragable_control_data_wrapper_fields($postdata){
4975 return apply_filters('update_mouse_dragable_control_options', $postdata);
4976 }
4977
4978
4979 /**
4980 * Render Advanced Keyboard Zoom Control Field
4981 *
4982 * This function renders a checkbox toggle for keyboard zoom control with tooltip and
4983 * additional settings when enabled.
4984 *
4985 * @param string $name The name attribute for the input field
4986 * @param array $val Array of values containing field attributes and settings
4987 * @param array $postdata Post data containing all panorama settings
4988 *
4989 * @return void Outputs HTML for the keyboard zoom control field
4990 * @since 8.5.27
4991 */
4992 public static function render_advanced_mouse_zoom_control_field($name, $val, $postdata)
4993 {
4994 extract( $val );
4995 ob_start();
4996 ?>
4997 <div class="<?= $class; ?>">
4998
4999 <div class="wpvr-tooltip-area">
5000 <span><?= __($title .': ', 'wpvr'); ?></span>
5001
5002 <?php if(!empty($have_tooltip)) { ?>
5003 <div class="field-tooltip">
5004 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
5005
5006 <span>
5007 <?php
5008 // Ensure tooltip_text text is set
5009 if (!empty($tooltip_text['text'])) {
5010 echo esc_html($tooltip_text['text']);
5011
5012 // Check if URL exists before rendering the link
5013 if (!empty($tooltip_text['url'])) {
5014 printf(
5015 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5016 esc_url($tooltip_text['url']),
5017 __('View Doc', 'wpvr')
5018 );
5019 }
5020 }
5021 ?>
5022 </span>
5023 </div>
5024 <?php } ?>
5025
5026 </div>
5027
5028 <span class="wpvr-switcher">
5029 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5030 <label for="<?= $id; ?>"></label>
5031 </span>
5032
5033
5034 </div>
5035 <?php if(isset($val['id']) && $val['id'] === 'wpvr_mouseZoom') { ?>
5036 <div class="mouse-zoom-control-settings-wrapper">
5037 <?php WPVR_Meta_Field::render_mouse_zoom_control_data_wrapper_fields($postdata) ;?>
5038 </div>
5039 <?php } ?>
5040 <?php
5041 ob_end_flush();
5042 }
5043
5044 /**
5045 * Render Advanced Keyboard Zoom Control Field
5046 *
5047 * This method renders a toggle switch for controlling keyboard zoom functionality in the VR panorama.
5048 * When enabled, it displays additional keyboard zoom control settings through the
5049 * render_keyboard_zoom_control_data_wrapper_fields method.
5050 *
5051 * @param string $name The HTML name attribute for the input field
5052 * @param array $val Array containing field configuration values including:
5053 * - class: CSS class for the field wrapper
5054 * - id: HTML ID for the input element
5055 * - title: Display title for the field
5056 * - value: Current value of the field ('on' or 'off')
5057 * - have_tooltip: Whether field has tooltip
5058 * - tooltip_text: Array with tooltip text and URL
5059 * @param array $postdata Complete panorama post data containing all settings
5060 *
5061 * @return void Outputs HTML for the keyboard zoom control field and its settings
5062 * @since 8.5.27
5063 */
5064 public static function render_mouse_zoom_control_data_wrapper_fields($postdata)
5065 {
5066 $fields = self::get_render_mouse_zoom_control_data_wrapper_fields_fields($postdata);
5067
5068 foreach($fields as $name => $val) {
5069 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val );
5070 }
5071 }
5072
5073 /**
5074 * Get keyboard zoom control fields configuration
5075 *
5076 * Retrieves the fields configuration for keyboard zoom control settings by applying
5077 * the 'updated_key_board_zoom_control_options' filter to the panorama post data.
5078 *
5079 * @param array $postdata The post data containing all panorama settings
5080 *
5081 * @return array An array of keyboard zoom control field configurations
5082 * @since 8.5.27
5083 */
5084 public static function get_render_mouse_zoom_control_data_wrapper_fields_fields($postdata)
5085 {
5086 return apply_filters('updated_mouse_zoom_control_options', $postdata);
5087 }
5088
5089 /**
5090 * Render Advanced Gyroscope Control Field
5091 *
5092 * This method renders a toggle switch for enabling/disabling gyroscope controls in VR panoramas.
5093 * When enabled, it displays additional gyroscope-specific settings through the
5094 * render_wpvr_gyro_data_wrapper_fields method.
5095 *
5096 * @param string $name The HTML name attribute for the input field
5097 * @param array $val Array of field configuration values including:
5098 * - class: CSS class for the field wrapper
5099 * - id: HTML ID for the input element
5100 * - title: Display title for the field
5101 * - value: Current value of the field ('on' or 'off')
5102 * - have_tooltip: Whether field has tooltip
5103 * - tooltip_text: Array with tooltip text and URL
5104 * @param array $postdata Complete panorama post data containing all settings
5105 *
5106 * @return void Outputs HTML for the gyroscope control field and its settings
5107 * @since 8.5.27
5108 */
5109 public static function render_advanced_gyro_control_field($name, $val, $postdata)
5110 {
5111 extract( $val );
5112 ob_start();
5113 ?>
5114 <div class="<?= $class; ?>">
5115
5116 <div class="wpvr-tooltip-area">
5117 <span><?= __($title .': ', 'wpvr'); ?></span>
5118
5119 <?php if(!empty($have_tooltip)) { ?>
5120 <div class="field-tooltip">
5121 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
5122
5123 <span>
5124 <?php
5125 // Ensure tooltip_text text is set
5126 if (!empty($tooltip_text['text'])) {
5127 echo esc_html($tooltip_text['text']);
5128
5129 // Check if URL exists before rendering the link
5130 if (!empty($tooltip_text['url'])) {
5131 printf(
5132 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5133 esc_url($tooltip_text['url']),
5134 __('View Doc', 'wpvr')
5135 );
5136 }
5137 }
5138 ?>
5139 </span>
5140 </div>
5141 <?php } ?>
5142
5143 </div>
5144
5145 <span class="wpvr-switcher">
5146 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5147 <label for="<?= $id; ?>"></label>
5148 </span>
5149
5150
5151 </div>
5152 <?php if(isset($val['id']) && $val['id'] === 'wpvr_gyro') { ?>
5153 <div class="zyro-settings-wrapper">
5154 <?php WPVR_Meta_Field::render_wpvr_gyro_data_wrapper_fields($postdata) ;?>
5155 </div>
5156 <?php } ?>
5157 <?php
5158 ob_end_flush();
5159 }
5160
5161 /**
5162 * Renders gyroscope control settings fields
5163 *
5164 * This method fetches the gyroscope control configuration fields using
5165 * get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields and renders each field
5166 * using the appropriate render method based on the field type.
5167 *
5168 * @param array $postdata The post data containing all panorama settings
5169 *
5170 * @return void Outputs HTML for the gyroscope control settings fields
5171 * @since 8.5.27
5172 */
5173 public static function render_wpvr_gyro_data_wrapper_fields($postdata)
5174 {
5175 $fields = self::get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields($postdata);
5176 foreach($fields as $name => $val) {
5177 if('pro_checkbox' === $val['type']){
5178 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val );
5179 }else{
5180 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5181 }
5182
5183 }
5184 }
5185
5186 /**
5187 * Get gyroscope control fields configuration data
5188 *
5189 * Retrieves the fields configuration for gyroscope control settings by applying
5190 * the 'updated_gyro_control_options' filter to the panorama post data.
5191 *
5192 * @param array $postdata The post data containing all panorama settings
5193 *
5194 * @return array An array of gyroscope control field configurations
5195 * @since 8.5.27
5196 */
5197 public static function get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields($postdata)
5198 {
5199 return apply_filters('updated_gyro_control_options', $postdata);
5200 }
5201
5202 /**
5203 * Render Advanced Scene Gallery Control Field
5204 *
5205 * This method renders a toggle switch for enabling/disabling scene gallery in VR panoramas.
5206 * When enabled, it displays additional scene gallery settings through the
5207 * render_wpvr_scene_gallery_data_wrapper_fields method.
5208 *
5209 * @param string $name The HTML name attribute for the input field
5210 * @param array $val Array of field configuration values including:
5211 * - class: CSS class for the field wrapper
5212 * - id: HTML ID for the input element
5213 * - title: Display title for the field
5214 * - value: Current value of the field ('on' or 'off')
5215 * - have_tooltip: Whether field has tooltip
5216 * - tooltip_text: Array with tooltip text and URL
5217 * @param array $postdata Complete panorama post data containing all settings
5218 *
5219 * @return void Outputs HTML for the scene gallery control field and its settings
5220 * @since 8.5.27
5221 */
5222 public static function render_advanced_setting_scene_gallery_field($name, $val, $postdata)
5223 {
5224 extract( $val );
5225 ob_start();
5226 ?>
5227 <div class="<?= $class; ?>">
5228
5229 <div class="wpvr-tooltip-area">
5230 <span><?= __($title .': ', 'wpvr'); ?></span>
5231 <?php if(!empty($have_tooltip)) { ?>
5232 <div class="field-tooltip">
5233 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
5234
5235 <span>
5236 <?php
5237 // Ensure tooltip_text text is set
5238 if (!empty($tooltip_text['text'])) {
5239 echo esc_html($tooltip_text['text']);
5240
5241 // Check if URL exists before rendering the link
5242 if (!empty($tooltip_text['url'])) {
5243 printf(
5244 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5245 esc_url($tooltip_text['url']),
5246 __('View Doc', 'wpvr')
5247 );
5248 }
5249 }
5250 ?>
5251 </span>
5252 </div>
5253 <?php } ?>
5254 </div>
5255
5256 <span class="wpvr-switcher">
5257 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5258 <label for="<?= $id; ?>"></label>
5259 </span>
5260
5261
5262 </div>
5263 <?php if(isset($val['id']) && $val['id'] === 'wpvr_vrgallery') { ?>
5264 <div class="scene-gallery-settings-wrapper">
5265 <?php WPVR_Meta_Field::render_wpvr_scene_gallery_data_wrapper_fields($postdata) ;?>
5266 </div>
5267 <?php } ?>
5268 <?php
5269 ob_end_flush();
5270 }
5271
5272 /**
5273 * Renders scene gallery control settings fields
5274 *
5275 * This method retrieves the scene gallery configuration fields and renders each field
5276 * using the appropriate render method based on the field type.
5277 *
5278 * @param array $postdata The complete panorama post data containing all settings
5279 *
5280 * @return void Outputs HTML for the scene gallery settings fields
5281 * @since 8.5.27
5282 */
5283 public static function render_wpvr_scene_gallery_data_wrapper_fields($postdata)
5284 {
5285 $fields = self::get_render_wpvr_scene_gallery_data_wrapper_fields($postdata);
5286 foreach($fields as $name => $val) {
5287 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5288 }
5289 }
5290
5291 /**
5292 * Get scene gallery control fields configuration
5293 *
5294 * Retrieves the fields configuration for scene gallery settings by applying
5295 * the 'updated_scene_gallery_control_options' filter to the panorama post data.
5296 *
5297 * @param array $postdata The post data containing all panorama settings
5298 *
5299 * @return array An array of scene gallery control field configurations
5300 * @since 8.5.27
5301 */
5302 public static function get_render_wpvr_scene_gallery_data_wrapper_fields($postdata)
5303 {
5304 return apply_filters('updated_scene_gallery_control_options', $postdata);
5305 }
5306
5307 /**
5308 * Render Advanced Explainer Video Control Field
5309 *
5310 * This method renders a toggle switch for enabling/disabling explainer video in VR panoramas.
5311 * When enabled, it displays additional explainer video settings through the
5312 * render_advanced_setting_explainer_video_data_wrapper_fields method.
5313 *
5314 * @param string $name The HTML name attribute for the input field
5315 * @param array $val Array of field configuration values including:
5316 * - class: CSS class for the field wrapper
5317 * - id: HTML ID for the input element
5318 * - title: Display title for the field
5319 * - value: Current value of the field ('on' or 'off')
5320 * - have_tooltip: Whether field has tooltip
5321 * - tooltip_text: Array with tooltip text and URL
5322 * @param array $postdata Complete panorama post data containing all settings
5323 *
5324 * @return void Outputs HTML for the explainer video control field and its settings
5325 * @since 8.5.27
5326 */
5327 public static function render_advanced_setting_explainer_video_field($name, $val, $postdata)
5328 {
5329 extract( $val );
5330 ob_start();
5331 ?>
5332 <div class="<?= $class; ?>">
5333
5334 <div class="wpvr-tooltip-area">
5335 <span><?= __($title .': ', 'wpvr'); ?></span>
5336
5337 <?php if(!empty($have_tooltip)) { ?>
5338 <div class="field-tooltip">
5339 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
5340
5341 <span>
5342 <?php
5343 // Ensure tooltip_text text is set
5344 if (!empty($tooltip_text['text'])) {
5345 echo esc_html($tooltip_text['text']);
5346
5347 // Check if URL exists before rendering the link
5348 if (!empty($tooltip_text['url'])) {
5349 printf(
5350 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5351 esc_url($tooltip_text['url']),
5352 __('View Doc', 'wpvr')
5353 );
5354 }
5355 }
5356 ?>
5357 </span>
5358 </div>
5359 <?php } ?>
5360
5361 </div>
5362
5363 <span class="wpvr-switcher">
5364 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5365 <label for="<?= $id; ?>"></label>
5366 </span>
5367
5368
5369
5370 </div>
5371 <?php if(isset($val['id']) && $val['id'] === 'wpvr_explainerSwitch') { ?>
5372 <div class="explainer-video-settings-wrapper">
5373 <?php WPVR_Meta_Field::render_advanced_setting_explainer_video_data_wrapper_fields($postdata) ;?>
5374 </div>
5375 <?php } ?>
5376 <?php
5377 ob_end_flush();
5378 }
5379
5380 /**
5381 * Renders explainer video control settings fields
5382 *
5383 * This method retrieves the explainer video configuration fields and renders each field
5384 * using the appropriate render method based on the field type.
5385 *
5386 * @param array $postdata The complete panorama post data containing all settings
5387 *
5388 * @return void Outputs HTML for the explainer video settings fields
5389 * @since 8.5.27
5390 */
5391 public static function render_advanced_setting_explainer_video_data_wrapper_fields($postdata)
5392 {
5393 $fields = self::get_render_advanced_setting_explainer_video_data_wrapper_fields($postdata);
5394 foreach($fields as $name => $val) {
5395 if('pro_checkbox' == $val['type']){
5396 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val );
5397 }else{
5398 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5399 }
5400 }
5401 }
5402
5403 /**
5404 * Get explainer video control fields configuration
5405 *
5406 * Retrieves the fields configuration for explainer video settings by applying
5407 * the 'updated_explainer_video_control_options' filter to the panorama post data.
5408 *
5409 * @param array $postdata The post data containing all panorama settings
5410 *
5411 * @return array An array of explainer video control field configurations
5412 * @since 8.5.27
5413 */
5414 public static function get_render_advanced_setting_explainer_video_data_wrapper_fields($postdata)
5415 {
5416 return apply_filters('updated_explainer_video_control_options', $postdata);
5417 }
5418
5419 /**
5420 * Render Advanced Set Zoom Preference Control Field
5421 *
5422 * This method renders a toggle switch for enabling/disabling zoom preference in VR panoramas.
5423 * When enabled, it displays additional zoom preference settings through the
5424 * render_wpvr_set_zoom_control_data_wrapper_fields method.
5425 *
5426 * @param string $name The HTML name attribute for the input field
5427 * @param array $val Array of field configuration values including:
5428 * - class: CSS class for the field wrapper
5429 * - id: HTML ID for the input element
5430 * - title: Display title for the field
5431 * - value: Current value of the field ('on' or 'off')
5432 * - have_tooltip: Whether field has tooltip
5433 * - tooltip_text: Array with tooltip text and URL
5434 * @param array $postdata Complete panorama post data containing all settings
5435 *
5436 * @return void Outputs HTML for the set zoom preference control field and its settings
5437 * @since 8.5.27
5438 */
5439 public static function render_advanced_setting_set_zoom_preference_field($name, $val, $postdata)
5440 {
5441 extract( $val );
5442 ob_start();
5443 ?>
5444 <div class="<?= $class; ?>">
5445 <div class="wpvr-tooltip-area">
5446 <span><?= __($title .': ', 'wpvr'); ?></span>
5447
5448 <?php if(!empty($have_tooltip)) { ?>
5449 <div class="field-tooltip">
5450 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
5451
5452 <span>
5453 <?php
5454 // Ensure tooltip_text text is set
5455 if (!empty($tooltip_text['text'])) {
5456 echo esc_html($tooltip_text['text']);
5457
5458 // Check if URL exists before rendering the link
5459 if (!empty($tooltip_text['url'])) {
5460 printf(
5461 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5462 esc_url($tooltip_text['url']),
5463 __('View Doc', 'wpvr')
5464 );
5465 }
5466 }
5467 ?>
5468 </span>
5469 </div>
5470 <?php } ?>
5471
5472
5473 </div>
5474
5475 <span class="wpvr-switcher">
5476 <input id="<?= $id; ?>" class="vr-switcher-check" value="<?= $value?>" name="<?= $name; ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5477 <label for="<?= $id; ?>"></label>
5478 </span>
5479
5480
5481 </div>
5482 <?php if(isset($val['id']) && $val['id'] === 'wpvr_globalzoom') { ?>
5483 <div class="set-zoom-perference-control-settings-wrapper">
5484 <?php WPVR_Meta_Field::render_wpvr_set_zoom_control_data_wrapper_fields($postdata) ;?>
5485 </div>
5486 <?php } ?>
5487 <?php
5488 ob_end_flush();
5489 }
5490
5491 /**
5492 * Renders set zoom preference control settings fields
5493 *
5494 * This method retrieves the set zoom preference configuration fields and renders each field
5495 * using the appropriate render method based on the field type.
5496 *
5497 * @param array $postdata The complete panorama post data containing all settings
5498 *
5499 * @return void Outputs HTML for the set zoom preference settings fields
5500 * @since 8.5.27
5501 */
5502 public static function render_wpvr_set_zoom_control_data_wrapper_fields($postdata)
5503 {
5504 $fields = self::get_render_wpvr_set_zoom_control_data_wrapper_fields($postdata);
5505 foreach($fields as $name => $val) {
5506 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5507 }
5508 }
5509
5510 /**
5511 * Get set zoom preference control fields configuration
5512 *
5513 * Retrieves the fields configuration for set zoom preference settings by applying
5514 * the 'updated_set_zoom_preference_control_options' filter to the panorama post data.
5515 *
5516 * @param array $postdata The post data containing all panorama settings
5517 *
5518 * @return array An array of set zoom preference control field configurations
5519 * @since 8.5.27
5520 */
5521 public static function get_render_wpvr_set_zoom_control_data_wrapper_fields($postdata)
5522 {
5523 return apply_filters('updated_zoom_control_options', $postdata);
5524 }
5525
5526 /**
5527 * Render Pro Inner Scene Gallery Icon Size Field
5528 *
5529 * This method renders a toggle switch for enabling/disabling the large/small icon size for the inner scene gallery.
5530 *
5531 * @param string $name The HTML name attribute for the input field
5532 * @param array $val Array of field configuration values including:
5533 * - class: CSS class for the field wrapper
5534 * - id: HTML ID for the input element
5535 * - title: Display title for the field
5536 * - value: Current value of the field ('on' or 'off')
5537 * - have_tooltip: Whether field has tooltip
5538 * - tooltip_text: Array with tooltip text and URL
5539 *
5540 * @return void Outputs HTML for the pro inner scene gallery icon size field
5541 * @since 8.5.27
5542 */
5543 public static function render_pro_inner_scene_gallery_icon_size_field($name, $val){
5544 extract($val);
5545 ob_start();
5546 $default_type = array(
5547 'on' => __('Large', 'wpvr-pro'),
5548 'off' => __('Small', 'wpvr-pro'),
5549 );
5550 ?>
5551
5552 <div class='single-settings'>
5553 <div class="wpvr-tooltip-area">
5554 <span for="scene-gallery-icon-size-name"><?= __($title .': ', 'wpvr'); ?></span>
5555 <?php if(!empty($have_tooltip)) { ?>
5556 <div class="field-tooltip">
5557 <img loading="lazy" src="<?= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'?>" alt="icon" />
5558
5559 <span>
5560 <?php
5561 // Ensure tooltip_text text is set
5562 if (!empty($tooltip_text['text'])) {
5563 echo esc_html($tooltip_text['text']);
5564
5565 // Check if URL exists before rendering the link
5566 if (!empty($tooltip_text['url'])) {
5567 printf(
5568 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5569 esc_url($tooltip_text['url']),
5570 __('View Doc', 'wpvr')
5571 );
5572 }
5573 }
5574 ?>
5575 </span>
5576 </div>
5577 <?php } ?>
5578 </div>
5579
5580 <select class='scene-gallery-icon-size-name' name="<?= $name;?>">
5581 <?php
5582 foreach ($default_type as $key => $type) {
5583 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $value, true), esc_attr($key), esc_attr($type));
5584 } ?>
5585 </select>
5586 </div>
5587
5588 <?php
5589 ob_end_flush();
5590 }
5591
5592 }