PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 8.5.76
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v8.5.76
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 8.5.4 All 221 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.76, at admin/classes/class-wpvr-meta-field.php

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