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

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

5,837 lines 237.8 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'] ?? 'off',
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 $is_video = ( isset( $postdata['tour-type'] ) && $postdata['tour-type'] === 'video' )
1912 || ! empty( $postdata['vidid'] )
1913 || ! empty( $postdata['vidurl'] );
1914
1915 $vidurl = ! empty( $postdata['vidurl'] ) ? $postdata['vidurl'] : '';
1916
1917 $meta_fields = array(
1918 'panovideo' => array(
1919 'class' => 'single-settings videosetup',
1920 'title' => __('Video Tour','wpvr'),
1921 'type' => 'radio_button',
1922 'lists' => array(
1923 array(
1924 'input_class' => 'styled-radio video_off',
1925 'input_id' => 'styled-radio',
1926 'value' => 'off',
1927 'checked' => $is_video,
1928 'label_value' => 'Off'
1929 ),
1930 array(
1931 'input_class' => 'styled-radio video_on',
1932 'input_id' => 'styled-radio-0',
1933 'value' => 'on',
1934 'checked' => $is_video,
1935 'label_value' => 'On'
1936 )
1937 ),
1938 'have_tooltip' => true,
1939 'tooltip_text' => array(
1940 'text' => __('Enable or disable video mode using self-hosted, YouTube, or Vimeo.', 'wpvr'),
1941 'url' => ''
1942 ),
1943
1944 ),
1945 'video-attachment-url' => array(
1946 'class' => 'single-settings video-setting',
1947 'title' => __('Upload or Add Link','wpvr'),
1948 'placeholder' => __('Paste Youtube or Vimeo link or upload','wpvr'),
1949 'input_class' => 'video-attachment-url',
1950 'type' => 'video_text_input',
1951 'value' => $vidurl,
1952 'have_tooltip' => true,
1953 'tooltip_text' => array(
1954 'text' => __('Use a self-hosted file or paste a YouTube/Vimeo link.', 'wpvr'),
1955 'url' => ''
1956 ),
1957 )
1958 );
1959 return apply_filters( 'extend_video_meta_fields', $meta_fields, $postdata, $vidurl );
1960 }
1961
1962
1963 /**
1964 * Render Video Settings Meta Fields
1965 * @param mixed $postdata
1966 *
1967 * @return void
1968 * @since 8.0.0
1969 */
1970 public static function render_video_setting_meta_fields($postdata)
1971 {
1972 $fields = self::get__video_setting_fields($postdata);
1973
1974 foreach($fields as $name => $val) {
1975 self::{ 'render_' . $val['type'] }( $name, $val );
1976 }
1977
1978 }
1979
1980
1981 /**
1982 * Render Scene Settings Select Field
1983 * @param mixed $name input name
1984 * @param mixed $val options
1985 *
1986 * @return void
1987 * @since 8.0.0
1988 */
1989 public static function render_scene_select_field($name, $val)
1990 {
1991 extract($val);
1992 ob_start();
1993 ?>
1994 <div class="<?php echo esc_attr( $class ); ?>">
1995 <div class="wpvr-global-tooltip-area">
1996 <label><?php echo esc_html( $title ) . ': '; ?></label>
1997 <?php if(!empty($have_tooltip)) { ?>
1998 <div class="field-tooltip">
1999 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2000
2001 <span>
2002 <?php
2003 // Ensure tooltip_text text is set
2004 if (!empty($tooltip_text['text'])) {
2005 echo esc_html($tooltip_text['text']);
2006
2007 // Check if URL exists before rendering the link
2008 if (!empty($tooltip_text['url'])) {
2009 printf(
2010 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2011 esc_url($tooltip_text['url']),
2012 esc_html__( 'View Doc', 'wpvr' )
2013 );
2014 }
2015 }
2016 ?>
2017 </span>
2018 </div>
2019 <?php } ?>
2020 </div>
2021
2022 <select class="<?php echo esc_attr( $select_class ); ?>" name="<?php echo esc_attr( $name ); ?>">
2023 <option value="on" <?php selected( $selected, 'on' ); ?> > <?php echo esc_html__('Yes','wpvr') ?> </option>
2024 <option value="off" <?php selected( $selected, 'off' ); ?> > <?php echo esc_html__('No','wpvr') ?></option>
2025 </select>
2026 </div>
2027 <?php
2028 ob_end_flush();
2029 }
2030
2031
2032 /**
2033 * Render Scene Type selection field on Scene tab content
2034 *
2035 * @param mixed $name
2036 * @param mixed $val
2037 *
2038 * @return void
2039 * @since 8.0.0
2040 */
2041 public static function render_scene_type_select_field($name, $val)
2042 {
2043 extract($val);
2044 ob_start();
2045 ?>
2046 <div class="scene-setting">
2047 <div class="wpvr-global-tooltip-area">
2048 <label for="scene-type"><?php echo esc_html( $title ) . ': '; ?></label>
2049 <?php if(!empty($have_tooltip)) { ?>
2050 <div class="field-tooltip">
2051 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2052
2053 <span>
2054 <?php
2055 // Ensure tooltip_text text is set
2056 if (!empty($tooltip_text['text'])) {
2057 echo esc_html($tooltip_text['text']);
2058
2059 // Check if URL exists before rendering the link
2060 if (!empty($tooltip_text['url'])) {
2061 printf(
2062 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2063 esc_url($tooltip_text['url']),
2064 esc_html__( 'View Doc', 'wpvr' )
2065 );
2066 }
2067 }
2068 ?>
2069 </span>
2070 </div>
2071 <?php } ?>
2072 </div>
2073
2074 <select class="wpvr-pro-select-scene-type" name="scene-type" id="">
2075 <option value="equirectangular" <?php selected( $selected, 'equirectangular' ); ?> > <?php echo esc_html__('Equirectangular','wpvr') ?></option>
2076 <option value="cubemap" <?php selected( $selected, 'cubemap' ); ?> > <?php echo esc_html__('Cubemap','wpvr') ?></option>
2077 </select>
2078 </div>
2079 <?php
2080 ob_end_flush();
2081 }
2082
2083
2084 /**
2085 * Render Scene Settings Text Field
2086 * @param mixed $name input name
2087 * @param mixed $val options
2088 *
2089 * @return void
2090 * @since 8.0.0
2091 */
2092 public static function render_scene_text_field($name, $val)
2093 {
2094 extract($val);
2095 ob_start();
2096 if($label_for === 'scene-type') {
2097 ?>
2098 <div class="scene-setting">
2099 <div class="wpvr-global-tooltip-area">
2100
2101 <label for="<?php echo esc_attr( $label_for ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
2102
2103 <?php if(!empty($have_tooltip)) { ?>
2104 <div class="field-tooltip">
2105 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2106
2107 <span>
2108 <?php
2109 // Ensure tooltip_text text is set
2110 if (!empty($tooltip_text['text'])) {
2111 echo esc_html($tooltip_text['text']);
2112
2113 // Check if URL exists before rendering the link
2114 if (!empty($tooltip_text['url'])) {
2115 printf(
2116 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2117 esc_url($tooltip_text['url']),
2118 esc_html__( 'View Doc', 'wpvr' )
2119 );
2120 }
2121 }
2122 ?>
2123 </span>
2124 </div>
2125 <?php } ?>
2126
2127 </div>
2128
2129 <select class="disable-scene-type">
2130 <option value="" selected=""> Equirectangular</option>
2131 <option value="" disabled> Cubemap (Pro)</option>
2132 </select>
2133 <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 ); ?> />
2134 </div>
2135 <?php
2136 ob_end_flush();
2137 }else{
2138 ?>
2139
2140 <div class="scene-setting">
2141
2142 <div class="wpvr-global-tooltip-area">
2143 <label for="<?php echo esc_attr( $label_for ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
2144
2145 <?php if(!empty($have_tooltip)) { ?>
2146 <div class="field-tooltip">
2147 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2148
2149 <span>
2150 <?php
2151 // Ensure tooltip_text text is set
2152 if (!empty($tooltip_text['text'])) {
2153 echo esc_html($tooltip_text['text']);
2154
2155 // Check if URL exists before rendering the link
2156 if (!empty($tooltip_text['url'])) {
2157 printf(
2158 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2159 esc_url($tooltip_text['url']),
2160 esc_html__( 'View Doc', 'wpvr' )
2161 );
2162 }
2163 }
2164 ?>
2165 </span>
2166 </div>
2167 <?php } ?>
2168
2169 </div>
2170 <input type="text" class="<?php echo esc_attr( $input_class ); ?>" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
2171 </div>
2172
2173 <?php }
2174 ob_end_flush();
2175 }
2176
2177
2178 /**
2179 * Render Scene Settings Upload Field
2180 * @param mixed $name input name
2181 * @param mixed $val options
2182 *
2183 * @return void
2184 * @since 8.0.0
2185 */
2186 public static function render_scene_upload_field($name, $val)
2187 {
2188 extract($val);
2189 ob_start();
2190 ?>
2191 <div class="scene-setting">
2192 <div class="wpvr-global-tooltip-area">
2193 <label for="scene-upload"><?php echo esc_html( $title ) . ': '; ?></label>
2194 <?php if(!empty($have_tooltip)) { ?>
2195 <div class="field-tooltip">
2196 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2197
2198 <span>
2199 <?php
2200 // Ensure tooltip_text text is set
2201 if (!empty($tooltip_text['text'])) {
2202 echo esc_html($tooltip_text['text']);
2203
2204 // Check if URL exists before rendering the link
2205 if (!empty($tooltip_text['url'])) {
2206 printf(
2207 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2208 esc_url($tooltip_text['url']),
2209 esc_html__( 'View Doc', 'wpvr' )
2210 );
2211 }
2212 }
2213 ?>
2214 </span>
2215 </div>
2216 <?php } ?>
2217 </div>
2218
2219 <div class="form-group">
2220 <img loading="lazy" src="<?php echo esc_url( $value ); ?>" style="display: <?php echo esc_attr( $display ); ?>;"><br>
2221 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2222 <input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="<?php echo esc_attr( $value ); ?>">
2223 </div>
2224 </div>
2225 <?php
2226 ob_end_flush();
2227 }
2228
2229
2230 /**
2231 * Render Scene upload wrapper fields for pro version
2232 *
2233 * @param mixed $name
2234 * @param mixed $val
2235 *
2236 * @return void
2237 * @since 8.0.0
2238 */
2239 public static function render_scene_upload_wrapper_field($name, $val)
2240 {
2241 extract($val);
2242 ob_start();
2243 ?>
2244 <div class="scene-setting scene-upload-wrapper">
2245 <?php
2246 foreach($wrappers as $key => $val) {
2247 self::{ 'render_scene_' . $key }( $key, $val );
2248 }
2249 ?>
2250 </div>
2251 <?php
2252 ob_end_flush();
2253 }
2254
2255
2256 /**
2257 * Render equirectangular scene upload section for pro version
2258 *
2259 * @param mixed $key
2260 * @param mixed $val
2261 *
2262 * @return void
2263 * @since 8.0.0
2264 */
2265 public static function render_scene_equirectangular_upload($key, $val)
2266 {
2267 extract($val);
2268 ob_start();
2269 ?>
2270 <div class="equirectangular-upload" style="display: <?php echo esc_attr( $display ); ?>;">
2271 <div class="wpvr-global-tooltip-area">
2272 <label for="scene-upload"><?php echo esc_html__('Scene Upload:', 'wpvr')?></label>
2273
2274 <div class="field-tooltip">
2275 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2276 <span>
2277 <?php echo esc_html__('Upload an image to be used as the scene media (video is not supported).', 'wpvr') ?>
2278
2279 <?php
2280 $tooltip_url = 'https://rextheme.com/docs/wp-vr-add-a-scene-virtual-tour/';
2281 if (!empty($tooltip_url)) :
2282 ?>
2283 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
2284 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
2285 </a>
2286 <?php endif; ?>
2287 </span>
2288 </div>
2289
2290 </div>
2291
2292
2293 <div class="form-group">
2294 <img loading="lazy" src="<?php echo esc_url( $value ); ?>" style="display: <?php echo esc_attr( $img_display ); ?>;"><br>
2295 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2296 <input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="<?php echo esc_attr( $value ); ?>">
2297 </div>
2298 </div>
2299 <?php
2300 ob_end_flush();
2301 }
2302
2303
2304 /**
2305 * Render cubemap scene upload section for pro version
2306 *
2307 * @param mixed $key
2308 * @param mixed $val
2309 *
2310 * @return void
2311 * @since 8.0.0
2312 */
2313 public static function render_scene_cubemap_upload($key, $val)
2314 {
2315 extract($val);
2316 ob_start();
2317 ?>
2318 <div class="cubemap-upload" style="display: <?php echo esc_attr( $display ); ?>;">
2319 <?php
2320 foreach($cubemaps as $cubemap){ extract($cubemap) ?>
2321 <div class="<?php echo esc_attr( $class ); ?>">
2322
2323 <div class="wpvr-global-tooltip-area">
2324 <label for="scene-upload"><?php echo esc_html( $title ) ?></label>
2325 <?php if(!empty($have_tooltip)) { ?>
2326 <div class="field-tooltip">
2327 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2328
2329 <span>
2330 <?php
2331 // Ensure tooltip_text text is set
2332 if (!empty($tooltip_text['text'])) {
2333 echo esc_html($tooltip_text['text']);
2334
2335 // Check if URL exists before rendering the link
2336 if (!empty($tooltip_text['url'])) {
2337 printf(
2338 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2339 esc_url($tooltip_text['url']),
2340 esc_html__( 'View Doc', 'wpvr' )
2341 );
2342 }
2343 }
2344 ?>
2345 </span>
2346 </div>
2347 <?php } ?>
2348 </div>
2349
2350 <div class="form-group">
2351 <img loading="lazy" src="<?php echo esc_url( $value ); ?>" style="display: block;">
2352 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2353 <input type="hidden" name="<?php echo esc_attr( $name ); ?>" class="scene-attachment-url" value="<?php echo esc_attr( $value ); ?>">
2354 </div>
2355
2356
2357 </div>
2358 <?php }
2359 ?>
2360 </div>
2361 <?php
2362 ob_end_flush();
2363
2364 }
2365
2366
2367 /**
2368 * Render Radio Button Field
2369 * @param mixed $name input name
2370 * @param mixed $val options
2371 *
2372 * @return void
2373 * @since 8.0.0
2374 */
2375 public static function render_radio_button($name, $val)
2376 {
2377 extract( $val );
2378 ob_start();
2379 ?>
2380 <div class="<?php echo esc_attr( $class ); ?>">
2381
2382 <div class="wpvr-global-tooltip-area">
2383 <span><?php echo esc_html( $title ) . ': '; ?></span>
2384 <?php if(!empty($have_tooltip)) { ?>
2385 <div class="field-tooltip">
2386 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2387
2388 <span>
2389 <?php
2390 // Ensure tooltip_text text is set
2391 if (!empty($tooltip_text['text'])) {
2392 echo esc_html($tooltip_text['text']);
2393
2394 // Check if URL exists before rendering the link
2395 if (!empty($tooltip_text['url'])) {
2396 printf(
2397 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2398 esc_url($tooltip_text['url']),
2399 esc_html__( 'View Doc', 'wpvr' )
2400 );
2401 }
2402 }
2403 ?>
2404 </span>
2405 </div>
2406 <?php } ?>
2407 </div>
2408
2409
2410 <ul>
2411
2412 <?php foreach($lists as $list) { extract( $list ); ?>
2413 <li class="radio-btn">
2414 <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'; };?> >
2415 <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $label_value ); ?></label>
2416 </li>
2417
2418 <?php } ?>
2419
2420 </ul>
2421
2422 </div>
2423 <?php
2424 ob_end_flush();
2425 }
2426
2427
2428 /**
2429 * Render Radio Button Field for pro version
2430 * @param mixed $name input name
2431 * @param mixed $val options
2432 *
2433 * @return void
2434 * @since 8.0.0
2435 */
2436 public static function render_pro_radio_button($name, $val)
2437 {
2438 extract( $val );
2439 ob_start();
2440 ?>
2441 <div class="<?php echo esc_attr( $class ); ?>">
2442 <div class="wpvr-global-tooltip-area">
2443 <span><?php echo esc_html( $title ) . ': '; ?></span>
2444 <?php if(!empty($have_tooltip)) { ?>
2445 <div class="field-tooltip">
2446 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2447
2448 <span>
2449 <?php
2450 // Ensure tooltip_text text is set
2451 if (!empty($tooltip_text['text'])) {
2452 echo esc_html($tooltip_text['text']);
2453
2454 // Check if URL exists before rendering the link
2455 if (!empty($tooltip_text['url'])) {
2456 printf(
2457 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2458 esc_url($tooltip_text['url']),
2459 esc_html__( 'View Doc', 'wpvr' )
2460 );
2461 }
2462 }
2463 ?>
2464 </span>
2465 </div>
2466 <?php } ?>
2467 </div>
2468
2469 <ul>
2470 <?php foreach($lists as $list) { extract( $list ); ?>
2471 <li class="radio-btn">
2472 <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'; };?> >
2473 <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $label_value ); ?></label>
2474 </li>
2475
2476 <?php } ?>
2477 </ul>
2478 </div>
2479 <?php
2480 ob_end_flush();
2481 }
2482
2483
2484 /**
2485 * Render Video Text Input Field
2486 * @param mixed $name input name
2487 * @param mixed $val options
2488 *
2489 * @return void
2490 * @since 8.0.0
2491 */
2492 public static function render_video_text_input($name, $val)
2493 {
2494 extract( $val );
2495 ob_start();
2496 ?>
2497 <div class="<?php echo esc_attr( $class ); ?>" style="display:none;">
2498
2499 <div class="wpvr-global-tooltip-area">
2500 <span><?php echo esc_html( $title ) . ': '; ?></span>
2501 <?php if(!empty($have_tooltip)) { ?>
2502 <div class="field-tooltip">
2503 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2504
2505 <span>
2506 <?php
2507 // Ensure tooltip_text text is set
2508 if (!empty($tooltip_text['text'])) {
2509 echo esc_html($tooltip_text['text']);
2510
2511 // Check if URL exists before rendering the link
2512 if (!empty($tooltip_text['url'])) {
2513 printf(
2514 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2515 esc_url($tooltip_text['url']),
2516 esc_html__( 'View Doc', 'wpvr' )
2517 );
2518 }
2519 }
2520 ?>
2521 </span>
2522 </div>
2523 <?php } ?>
2524 </div>
2525
2526 <div class="form-group">
2527 <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 ); ?>">
2528 <input type="button" class="video-upload" data-info="" value="Upload"/>
2529 </div>
2530
2531 </div>
2532 <?php
2533
2534 ob_end_flush();
2535
2536 }
2537
2538 /**
2539 * Render Checkbox Field
2540 *
2541 * @param string $name input name
2542 * @param string $val options
2543 *
2544 * @return void
2545 * @since 8.0.0
2546 */
2547 public static function render_checkbox_field($name, $val)
2548 {
2549 extract( $val );
2550 ob_start();
2551 ?>
2552 <div class="<?php echo esc_attr( $class ); ?>">
2553
2554 <div class="wpvr-tooltip-area">
2555 <span><?php echo esc_html( $title ) . ': '; ?></span>
2556
2557 <?php if(!empty($have_tooltip)) {?>
2558
2559 <div class="field-tooltip">
2560 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2561
2562 <span>
2563 <?php
2564 // Ensure tooltip_text text is set
2565 if (!empty($tooltip_text['text'])) {
2566 echo esc_html($tooltip_text['text']);
2567
2568 // Check if URL exists before rendering the link
2569 if (!empty($tooltip_text['url'])) {
2570 printf(
2571 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2572 esc_url($tooltip_text['url']),
2573 esc_html__( 'View Doc', 'wpvr' )
2574 );
2575 }
2576 }
2577 ?>
2578 </span>
2579 </div>
2580 <?php } ?>
2581
2582 </div>
2583
2584 <span class="wpvr-switcher">
2585 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="off" name="<?php echo esc_attr( $name ); ?>" type="checkbox" disabled />
2586 <label for="<?php echo esc_attr( $id ); ?>" title="Pro Feature"></label>
2587 </span>
2588
2589
2590 </div>
2591 <?php
2592 ob_end_flush();
2593 }
2594
2595
2596 /**
2597 * Render checkbox for advanced control pro version meta fields
2598 *
2599 * @param mixed $name
2600 * @param mixed $val
2601 *
2602 * @return void
2603 * @since 8.0.0
2604 */
2605 public static function render_pro_checkbox_field($name, $val)
2606 {
2607 extract($val);
2608 ob_start();
2609 ?>
2610 <div class="<?php echo esc_attr( $class ); ?>">
2611
2612 <div class="wpvr-tooltip-area">
2613 <span><?php echo esc_html( $title ) . ': '; ?></span>
2614
2615 <?php if(!empty($have_tooltip)) { ?>
2616 <div class="field-tooltip">
2617 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2618
2619 <span>
2620 <?php
2621 // Ensure tooltip_text text is set
2622 if (!empty($tooltip_text['text'])) {
2623 echo esc_html($tooltip_text['text']);
2624
2625 // Check if URL exists before rendering the link
2626 if (!empty($tooltip_text['url'])) {
2627 printf(
2628 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2629 esc_url($tooltip_text['url']),
2630 esc_html__( 'View Doc', 'wpvr' )
2631 );
2632 }
2633 }
2634 ?>
2635 </span>
2636 </div>
2637 <?php } ?>
2638
2639 </div>
2640
2641 <span class="wpvr-switcher">
2642 <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'; } ?> />
2643 <label for="<?php echo esc_attr( $id ); ?>"></label>
2644 </span>
2645
2646
2647 </div>
2648 <?php
2649 ob_end_flush();
2650 }
2651
2652
2653 public static function render_explainer_info_wrapper_field($name, $val)
2654 {
2655 extract($val);
2656 ob_start();
2657 ?>
2658 <div class="explainer-info-wrapper">
2659 <div class="single-settings cp-details">
2660 <span><?php echo esc_html( $title ) . ': '; ?></span>
2661 <textarea rows="5" cols="40" name="explaine-content" id="explaine-content"><?php echo esc_textarea( $value ); ?></textarea>
2662 </div>
2663 </div>
2664 <?php
2665 ob_end_flush();
2666 }
2667
2668
2669 /**
2670 * Render checkbox for advanced control pro version meta fields
2671 *
2672 * @param mixed $name
2673 * @param mixed $val
2674 *
2675 * @return void
2676 * @since 8.0.0
2677 */
2678 public static function render_pro_inner_checkbox_field($name, $val)
2679 {
2680 extract($val);
2681 ob_start();
2682 ?>
2683 <!-- <div class="<?php echo esc_attr( $root_class ); ?>">
2684
2685 </div> -->
2686
2687 <div class="<?php echo esc_attr( $class ); ?>">
2688 <div class="wpvr-tooltip-area">
2689 <span><?php echo esc_html( $title ) . ': '; ?></span>
2690
2691 <?php if(!empty($have_tooltip)) { ?>
2692 <div class="field-tooltip">
2693 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2694
2695 <span>
2696 <?php
2697 // Ensure tooltip_text text is set
2698 if (!empty($tooltip_text['text'])) {
2699 echo esc_html($tooltip_text['text']);
2700
2701 // Check if URL exists before rendering the link
2702 if (!empty($tooltip_text['url'])) {
2703 printf(
2704 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2705 esc_url($tooltip_text['url']),
2706 esc_html__( 'View Doc', 'wpvr' )
2707 );
2708 }
2709 }
2710 ?>
2711 </span>
2712 </div>
2713 <?php } ?>
2714
2715 </div>
2716
2717 <span class="wpvr-switcher">
2718 <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 ''; } ?> />
2719 <label for="<?php echo esc_attr( $id ); ?>"></label>
2720 </span>
2721
2722 </div>
2723
2724 <?php
2725 ob_end_flush();
2726 }
2727
2728
2729 /**
2730 * Render background music field on Advanced Controls section
2731 *
2732 * @param mixed $name
2733 * @param mixed $val
2734 *
2735 * @return void
2736 * @since 8.0.0
2737 */
2738 public static function render_bg_music_content_field($name, $val)
2739 {
2740 extract($val);
2741 ob_start();
2742 ?>
2743 <div class="bg-music-content" style="display:none">
2744 <?php
2745 foreach($inner_fields as $name => $val) {
2746 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
2747 }
2748 ?>
2749 </div>
2750 <?php
2751 ob_end_flush();
2752 }
2753
2754
2755 /**
2756 * Render Upload or Set Audio Link field on Advanced Controls section
2757 *
2758 * @param mixed $name
2759 * @param mixed $val
2760 *
2761 * @return void
2762 * @since 8.0.0
2763 */
2764 public static function render_upload_audio_link_field($name, $val)
2765 {
2766 extract($val);
2767 ob_start();
2768 ?>
2769 <div class="single-settings audio-setting">
2770 <!-- <span><?php echo esc_html( $title ) . ': '; ?></span> -->
2771 <img loading="lazy" class="audio-img" src="<?php echo esc_url( $value ); ?>" style="display: none;">
2772 <input type="text" name="<?php echo esc_attr( $name ); ?>" placeholder="Paste URL" class="audio-attachment-url" value="<?php echo esc_attr( $value ); ?>">
2773
2774 <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>
2775
2776 </div>
2777 <?php
2778 ob_end_flush();
2779 }
2780
2781
2782 /**
2783 * Render Add Company information field on Advanced Controls section
2784 *
2785 * @param mixed $name
2786 * @param mixed $val
2787 *
2788 * @return void
2789 * @since 8.0.0
2790 */
2791 public static function render_company_info_wrapper_field($name, $val)
2792 {
2793 extract($val);
2794 ob_start();
2795 ?>
2796 <div class="company-info-wrapper">
2797 <div class="single-settings cp-logo-area">
2798 <span class="logo-title"><?php echo esc_html( $title ) . ': '; ?>
2799 <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>
2800 </span>
2801
2802 <div class="form-group">
2803 <input type="text" name="cp-logo-attachment-url" class="cp-logo-attachment-url" value="<?php echo esc_attr( $value ); ?>">
2804 <input type="button" class="cp-logo-upload" id="cp-logo-upload" data-info="" value="Upload"/>
2805
2806 <div class="logo-upload-frame" >
2807 <label for="cp-logo-upload">
2808 <img loading="lazy" class="cp-logo-img" src="<?php echo esc_url( $value ); ?>">
2809 <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'; } ?>;" />
2810 <span class="vr-upload-text">
2811 Click to <strong>Upload an Image</strong>
2812 </span>
2813 </label>
2814 </div>
2815 </div>
2816 </div>
2817 <div class="single-settings cp-details">
2818 <span><?php echo esc_html__('Company Details : ', 'wpvr') ?></span>
2819 <textarea rows="5" cols="40" name="cp-logo-content" id="cp-logo-content"><?php echo esc_attr($cpLogoContent);?></textarea>
2820 </div>
2821 </div>
2822 <?php
2823 ob_end_flush();
2824 }
2825
2826
2827 /**
2828 * Render text input fields while ro version is active
2829 *
2830 * @param mixed $name
2831 * @param mixed $val
2832 *
2833 * @return void
2834 * @since 8.0.0
2835 */
2836 public static function render_pro_input_field($name, $val)
2837 {
2838 extract($val);
2839 ob_start();
2840 ?>
2841 <div class="<?php echo esc_attr( $class ); ?>" >
2842 <div class="wpvr-tooltip-area">
2843 <span><?php echo esc_html( $title ) . ': '; ?></span>
2844 <div class="field-tooltip">
2845 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2846
2847 <span>
2848 <?php
2849 // Ensure tooltip_text text is set
2850 if (!empty($tooltip_text['text'])) {
2851 echo esc_html($tooltip_text['text']);
2852
2853 // Check if URL exists before rendering the link
2854 if (!empty($tooltip_text['url'])) {
2855 printf(
2856 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
2857 esc_url($tooltip_text['url']),
2858 esc_html__( 'View Doc', 'wpvr' )
2859 );
2860 }
2861 }
2862 ?>
2863 </span>
2864 </div>
2865 </div>
2866
2867 <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 ); ?>" />
2868
2869
2870
2871
2872 </div>
2873 <?php
2874 ob_end_flush();
2875 }
2876
2877
2878 /**
2879 * Render Checkbox Field With Icon
2880 *
2881 * @param string $name input name
2882 * @param string $val options
2883 *
2884 * @return void
2885 * @since 8.0.0
2886 */
2887 public static function render_checkbox_with_icon($name, $val, $layout )
2888 {
2889 extract( $val );
2890 ob_start();
2891 ?>
2892 <div class="single-settings controls custom-data-set">
2893 <span><?php echo esc_html( $title ) . ': '; ?></span>
2894
2895 <div class="color-icon">
2896 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/'. $icon ); ?>" alt="icon" />
2897 </div>
2898
2899 <span class="wpvr-switcher">
2900 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="off" name="<?php echo esc_attr( $name ); ?>" type="checkbox" disabled />
2901 <label for="<?php echo esc_attr( $id ); ?>" title="Pro Feature"></label>
2902 </span>
2903
2904 </div>
2905 <?php
2906 ob_end_flush();
2907 }
2908
2909
2910 /**
2911 * Render checkbox fields on Control Buttons section while pro version is active
2912 *
2913 * @param mixed $name
2914 * @param mixed $val
2915 *
2916 * @return void
2917 * @since 8.0.0
2918 */
2919 public static function render_pro_checkbox_with_icon($name, $val, $layout )
2920 {
2921 extract( $val );
2922 // Only disable color and icon inputs for non-Classic layouts.
2923 $is_color_icon_disabled = ( 'layout1' === $layout ) && in_array($name, array('panupControl', 'panDownControl', 'panLeftControl', 'panRightControl', 'panZoomInControl', 'panZoomOutControl')) ? 'disabled' : '';
2924 $is_explainer_button = 'explainer' === $name || ( isset( $id ) && 'wpvr_explainer' === $id );
2925 ob_start();
2926 ?>
2927 <div class="single-settings controls custom-data-set">
2928 <span><?php echo esc_html( $title ) . ': '; ?></span>
2929
2930 <?php if ( $is_explainer_button ) { ?>
2931 <input id="<?php echo esc_attr( $id ); ?>" value="on" name="<?php echo esc_attr( $name ); ?>" type="hidden" />
2932 <?php } else { ?>
2933 <span class="wpvr-switcher">
2934 <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'; } ?> />
2935 <label for="<?php echo esc_attr( $id ); ?>"></label>
2936 </span>
2937 <?php } ?>
2938
2939 <div class="color-icon">
2940 <div class="colors">
2941 <span><?php echo esc_html__('Color','wpvr')?></span>
2942
2943 <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 ); ?>/>
2944 <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 ); ?>" />
2945 </div>
2946
2947 <div class="icons">
2948 <span><?php echo esc_html__('Icon','wpvr')?></span>
2949 <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 ); ?> >
2950 <?php
2951 foreach ($custom_icons as $cikey => $civalue) {
2952 if ($cikey == $icon) { ?>
2953 <option value="<?php echo esc_attr( $cikey ); ?>" selected > <?php echo esc_html( $civalue ); ?></option>
2954 <?php } else { ?>
2955 <option value="<?php echo esc_attr( $cikey ); ?>"> <?php echo esc_html( $civalue ); ?></option>
2956 <?php }
2957 }
2958 ?>
2959 </select>
2960 </div>
2961 </div>
2962
2963 </div>
2964 <?php
2965 ob_end_flush();
2966 }
2967
2968
2969 /**
2970 * Render Basic Setting Preview Image
2971 * @param mixed $name input name
2972 * @param mixed $val options
2973 *
2974 * @return void
2975 * @since 8.0.0
2976 */
2977 public static function render_preview_image($name, $val)
2978 {
2979 extract( $val );
2980 ob_start();
2981 ?>
2982 <div class="<?php echo esc_attr( $class ); ?>">
2983 <div class="wpvr-set-pre-img">
2984 <span><?php echo esc_html($title) . ' : '; ?></span>
2985
2986 <?php if(!empty($have_tooltip)) { ?>
2987 <div class="field-tooltip">
2988 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2989
2990 <span>
2991 <?php
2992 // Ensure tooltip_text text is set
2993 if (!empty($tooltip_text['text'])) {
2994 echo esc_html($tooltip_text['text']);
2995
2996 // Check if URL exists before rendering the link
2997 if (!empty($tooltip_text['url'])) {
2998 printf(
2999 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3000 esc_url($tooltip_text['url']),
3001 esc_html__( 'View Doc', 'wpvr' )
3002 );
3003 }
3004 }
3005 ?>
3006 </span>
3007 </div>
3008 <?php } ?>
3009
3010 </div>
3011
3012 <div class="wpvr-set-pre-img-area">
3013
3014 <div class="form-group">
3015 <input type="text" name="<?php echo esc_attr( $name ); ?>" class="preview-attachment-url" value="<?php echo esc_attr( $value ); ?>">
3016 <input type="button" class="preview-upload" id="vr-preview-img" data-info="" value="Upload"/>
3017 <div class="img-upload-frame <?php if(!empty($value)) { echo 'img-uploaded'; } ?>" style="background-image: url(<?php echo esc_url( $value ); ?>)">
3018 <span class="remove-attachment">x</span>
3019 <label for="vr-preview-img">
3020 <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"/>
3021 <span class="vr-upload-text">
3022 <?php echo esc_html__('Click to', 'wpvr'); ?> <strong><?php echo esc_html__('Upload an Image', 'wpvr'); ?></strong>
3023 </span>
3024 </label>
3025 </div>
3026 </div>
3027 <span class="hints"><?php echo esc_html__('This option will not work if the "Tour Autoload" is turned on.', 'wpvr'); ?></span>
3028 </div>
3029
3030 </div>
3031 <?php
3032 ob_end_flush();
3033 }
3034
3035
3036 /**
3037 * Render Basic Setting Preview Message
3038 * @param mixed $name input name
3039 * @param mixed $val options
3040 *
3041 * @return void
3042 * @since 8.0.0
3043 */
3044 public static function render_preview_image_msg($name, $val)
3045 {
3046 extract( $val );
3047 ob_start();
3048 ?>
3049 <div class="<?php echo esc_attr( $class ); ?>">
3050 <div class="wpvr-pre-img">
3051 <span><?php echo esc_html( $title ) . ': '; ?></span>
3052 <?php if(!empty($have_tooltip)) { ?>
3053 <div class="field-tooltip">
3054 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3055
3056 <span>
3057 <?php
3058 // Ensure tooltip_text text is set
3059 if (!empty($tooltip_text['text'])) {
3060 echo esc_html($tooltip_text['text']);
3061
3062 // Check if URL exists before rendering the link
3063 if (!empty($tooltip_text['url'])) {
3064 printf(
3065 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3066 esc_url($tooltip_text['url']),
3067 esc_html__( 'View Doc', 'wpvr' )
3068 );
3069 }
3070 }
3071 ?>
3072 </span>
3073 </div>
3074 <?php } ?>
3075 </div>
3076
3077 <input class="previewtext" type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>"/>
3078
3079 </div>
3080 <?php
3081 ob_end_flush();
3082 }
3083
3084
3085 /**
3086 * Render Basc Setting Checkbox
3087 * @param mixed $name input name
3088 * @param mixed $val options
3089 *
3090 * @return void
3091 * @since 8.0.0
3092 */
3093 public static function render_basic_setting_checkbox($name, $val)
3094 {
3095 extract( $val );
3096 ob_start();
3097 ?>
3098 <div class="<?php echo esc_attr( $class ); ?>">
3099 <?php if(isset($val['package']) && $val['package'] == 'pro' && !defined('WPVR_PRO_VERSION')){?>
3100 <div class="basic-setting-checkbox-pro-tag">pro</div>
3101 <?php } ?>
3102
3103 <div class="wpvr-tooltip-area">
3104 <span><?php echo esc_html( $title ) . ': '; ?></span>
3105
3106 <?php if(!empty($have_tooltip)) { ?>
3107 <div class="field-tooltip">
3108 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3109
3110 <span>
3111 <?php
3112 // Ensure tooltip_text text is set
3113 if (!empty($tooltip_text['text'])) {
3114 echo esc_html($tooltip_text['text']);
3115
3116 // Check if URL exists before rendering the link
3117 if (!empty($tooltip_text['url'])) {
3118 printf(
3119 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3120 esc_url($tooltip_text['url']),
3121 esc_html__( 'View Doc', 'wpvr' )
3122 );
3123 }
3124 }
3125 ?>
3126 </span>
3127 </div>
3128 <?php } ?>
3129
3130 </div>
3131
3132 <span class="wpvr-switcher">
3133 <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 ); ?> />
3134 <label for="<?php echo esc_attr( $id ); ?>"></label>
3135 </span>
3136
3137 </div>
3138 <?php if(isset($val['id']) && $val['id'] === 'wpvr_scene_animation') { ?>
3139 <div class="scene-animation-settings-wrapper">
3140 <?php WPVR_Meta_Field::render_scene_animation_transition_data_wrapper_fields($postdata) ;?>
3141 </div>
3142 <?php } ?>
3143 <?php
3144 ob_end_flush();
3145 }
3146
3147 /**
3148 * Render Basc Setting Checkbox for scene animation
3149 * @param mixed $name input name
3150 * @param mixed $val options
3151 *
3152 * @return void
3153 * @since 8.5.16
3154 */
3155 public static function render_basic_setting_checkbox_for_scene_animation($name, $val, $postdata)
3156 {
3157 extract( $val );
3158 ob_start();
3159 ?>
3160 <div class="<?php echo esc_attr( $class ); ?>">
3161 <?php if(isset($val['package']) && $val['package'] == 'pro' && !defined('WPVR_PRO_VERSION')){?>
3162 <div class="basic-setting-checkbox-pro-tag">pro</div>
3163 <?php } ?>
3164 <div class="wpvr-tooltip-area">
3165 <span><?php echo esc_html( $title ) . ': '; ?></span>
3166
3167 <?php if(!empty($have_tooltip)) { ?>
3168 <div class="field-tooltip">
3169 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3170
3171 <span>
3172 <?php
3173 // Ensure tooltip_text text is set
3174 if (!empty($tooltip_text['text'])) {
3175 echo esc_html($tooltip_text['text']);
3176
3177 // Check if URL exists before rendering the link
3178 if (!empty($tooltip_text['url'])) {
3179 printf(
3180 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3181 esc_url($tooltip_text['url']),
3182 esc_html__( 'View Doc', 'wpvr' )
3183 );
3184 }
3185 }
3186 ?>
3187 </span>
3188 </div>
3189 <?php } ?>
3190 </div>
3191
3192 <span class="wpvr-switcher">
3193 <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 ); ?> />
3194 <label for="<?php echo esc_attr( $id ); ?>"></label>
3195 </span>
3196
3197
3198 </div>
3199 <?php if(isset($val['id']) && $val['id'] === 'wpvr_scene_animation') { ?>
3200 <div class="scene-animation-settings-wrapper">
3201 <?php WPVR_Meta_Field::render_scene_animation_transition_data_wrapper_fields($postdata) ;?>
3202 </div>
3203 <?php } ?>
3204 <?php
3205 ob_end_flush();
3206 }
3207
3208 public static function render_generic_form_checkbox($name, $val)
3209 {
3210 extract( $val );
3211 ob_start();
3212 ?>
3213 <div class="<?php echo esc_attr( $class ); ?>">
3214
3215 <div class="wpvr-tooltip-area">
3216 <span><?php echo esc_html( $title ) . ': '; ?></span>
3217 <?php if(!empty($have_tooltip)) { ?>
3218 <div class="field-tooltip">
3219 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3220
3221 <span>
3222 <?php
3223 // Ensure tooltip_text text is set
3224 if (!empty($tooltip_text['text'])) {
3225 echo esc_html($tooltip_text['text']);
3226
3227 // Check if URL exists before rendering the link
3228 if (!empty($tooltip_text['url'])) {
3229 printf(
3230 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3231 esc_url($tooltip_text['url']),
3232 esc_html__( 'View Doc', 'wpvr' )
3233 );
3234 }
3235 }
3236 ?>
3237 </span>
3238 </div>
3239 <?php } ?>
3240 </div>
3241
3242 <span class="wpvr-switcher">
3243 <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' : '' ); ?>/>
3244 <label for="<?php echo esc_attr( $id ); ?>"></label>
3245 </span>
3246
3247 </div>
3248 <?php
3249 ob_end_flush();
3250 }
3251
3252
3253 /**
3254 * Render Numder Input Field
3255 * @param mixed $name input name
3256 * @param mixed $val options
3257 *
3258 * @return void
3259 * @since 8.0.0
3260 */
3261 public static function render_number_field($name, $val)
3262 {
3263 extract( $val );
3264 ob_start();
3265 ?>
3266 <div class="<?php echo esc_attr( $class ); ?>">
3267
3268 <div class="wpvr-tooltip-area">
3269 <span><?php echo esc_html( $title ) . ': '; ?></span>
3270
3271 <?php if(!empty($have_tooltip)) { ?>
3272 <div class="field-tooltip">
3273 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3274
3275 <span>
3276 <?php
3277 // Ensure tooltip_text text is set
3278 if (!empty($tooltip_text['text'])) {
3279 echo esc_html($tooltip_text['text']);
3280
3281 // Check if URL exists before rendering the link
3282 if (!empty($tooltip_text['url'])) {
3283 printf(
3284 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3285 esc_url($tooltip_text['url']),
3286 esc_html__( 'View Doc', 'wpvr' )
3287 );
3288 }
3289 }
3290 ?>
3291 </span>
3292 </div>
3293 <?php } ?>
3294 </div>
3295 <input type="number" name="<?php echo esc_attr( $name ); ?>" min="0" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" />
3296
3297
3298 </div>
3299 <?php
3300 ob_end_flush();
3301 }
3302
3303 public static function render_tour_layout_select($name, $val)
3304 {
3305 extract( $val );
3306 ob_start();
3307 $preview = '';
3308 if(defined('WPVR_PRO_VERSION')){
3309 $preview = '<span class="wpvr-layout__hover-text">'. __('Preview','wpvr').'</span>';
3310 }
3311 ?>
3312 <div class="<?php echo esc_attr( $class ); ?>">
3313 <?php if(!defined('WPVR_PRO_VERSION')){
3314 echo wp_kses_post('<div class=\"tour-layout-pro-tag\">pro</div>');
3315 }?>
3316 <div class="wpvr-layout">
3317 <div class="wpvr-tooltip-area">
3318 <span lass="wpvr-layout__label"><?php echo esc_html( $title ) . ': '; ?></span>
3319 <?php if(!empty($have_tooltip)) { ?>
3320 <div class="field-tooltip">
3321 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3322
3323 <span>
3324 <?php
3325 // Ensure tooltip_text text is set
3326 if (!empty($tooltip_text['text'])) {
3327 echo esc_html($tooltip_text['text']);
3328
3329 // Check if URL exists before rendering the link
3330 if (!empty($tooltip_text['url'])) {
3331 printf(
3332 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3333 esc_url($tooltip_text['url']),
3334 esc_html__( 'View Doc', 'wpvr' )
3335 );
3336 }
3337 }
3338 ?>
3339 </span>
3340 </div>
3341 <?php } ?>
3342
3343 </div>
3344
3345 <div class="wpvr-layout__container">
3346 <input type="hidden" id="layout_icon_bg_color" name="layout_icon_bg_color" value="<?php echo esc_attr( $value['layout_icon_bg_color'] ); ?>" >
3347 <input type="hidden" id="layout_icon_color" name="layout_icon_color" value="<?php echo esc_attr( $value['layout_icon_color'] ); ?>" >
3348
3349 <div class="wpvr-layout__radio-container">
3350 <input type="radio" id="default" name="tourLayout" value="default" <?php checked( $value['layout'], 'default' ); ?>>
3351 <div class="wpvr-layout__img">
3352 <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' ); ?>>
3353 <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' : '' ); ?>">
3354 <?php echo wp_kses_post( $preview ); ?>
3355 </label>
3356 <span class="wpvr-layout__radio-text"><?php echo esc_html__('Classic Layout','wpvr')?></span>
3357 </div>
3358 </div>
3359
3360 <div class="wpvr-layout__radio-container">
3361 <input type="radio" id="layout1" name="tourLayout" value="layout1" <?php checked( $value['layout'], 'layout1' ); ?>>
3362
3363 <div class="wpvr-layout__img">
3364 <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'] ); ?>">
3365 <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' : '' ); ?>">
3366 <?php echo wp_kses_post( $preview ); ?>
3367 </label>
3368
3369 <span class="wpvr-layout__radio-text"><?php echo esc_html__('Modern Layout','wpvr')?></span>
3370 </div>
3371
3372 </div>
3373
3374
3375 <!---->
3376 <!-- <div class="wpvr-layout__radio-container">-->
3377 <!-- <input type="radio" id="comingsoon" name="tourLayout" value="comingsoon" disabled>-->
3378 <!-- <label for="comingsoon" class="wpvr-layout__radio-label">-->
3379 <!-- <img src="--><?php //echo WPVR_PLUGIN_DIR_URL .'admin/icon/coming_soon_layout.png' ?><!--" alt="Coming Soon" class="wpvr-layout__radio-image">-->
3380 <!-- </label>-->
3381 <!-- <span class="layout__radio-text">--><?php //echo esc_html__('Coming Soon','wpvr')?><!--</span>-->
3382 <!-- </div>-->
3383
3384 </div>
3385 <!-- .wpvr-layout__container end -->
3386
3387 </div>
3388
3389 </div>
3390
3391 <?php
3392 ob_end_flush();
3393 }
3394
3395 public static function render_text_field($name, $val)
3396 {
3397 extract( $val );
3398 ob_start();
3399 ?>
3400 <div class="<?php echo esc_attr( $class ); ?>">
3401
3402 <div class="wpvr-tooltip-area">
3403 <span><?php echo esc_html( $title ) . ': '; ?></span>
3404
3405 <?php if(!empty($have_tooltip)) { ?>
3406 <div class="field-tooltip">
3407 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3408
3409 <span>
3410 <?php
3411 // Ensure tooltip_text text is set
3412 if (!empty($tooltip_text['text'])) {
3413 echo esc_html($tooltip_text['text']);
3414
3415 // Check if URL exists before rendering the link
3416 if (!empty($tooltip_text['url'])) {
3417 printf(
3418 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3419 esc_url($tooltip_text['url']),
3420 esc_html__( 'View Doc', 'wpvr' )
3421 );
3422 }
3423 }
3424 ?>
3425 </span>
3426 </div>
3427 <?php } ?>
3428 </div>
3429
3430 <input type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" />
3431
3432 </div>
3433 <?php
3434 ob_end_flush();
3435 }
3436
3437
3438 /**
3439 * Render Hotspot Setting Text Fields
3440 * @param mixed $name input field name
3441 * @param mixed $val options
3442 *
3443 * @return void
3444 * @since 8.0.0
3445 */
3446 public static function render_hotspot_text_field($name, $val)
3447 {
3448 extract($val);
3449 ob_start();
3450 ?>
3451
3452 <div class="hotspot-setting">
3453
3454 <div class="wpvr-global-tooltip-area">
3455 <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
3456
3457 <?php if(!empty($have_tooltip)) { ?>
3458 <div class="field-tooltip">
3459 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3460
3461 <span>
3462 <?php
3463 // Ensure tooltip_text text is set
3464 if (!empty($tooltip_text['text'])) {
3465 echo esc_html($tooltip_text['text']);
3466
3467 // Check if URL exists before rendering the link
3468 if (!empty($tooltip_text['url'])) {
3469 printf(
3470 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3471 esc_url($tooltip_text['url']),
3472 esc_html__( 'View Doc', 'wpvr' )
3473 );
3474 }
3475 }
3476 ?>
3477 </span>
3478 </div>
3479 <?php } ?>
3480
3481 </div>
3482
3483 <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 ); ?>"/>
3484 </div>
3485
3486 <?php
3487 ob_end_flush();
3488 }
3489
3490
3491 /**
3492 * Render checkbox for same tab feature on hotspot
3493 *
3494 * @param mixed $name
3495 * @param mixed $val
3496 *
3497 * @return void
3498 * @since 8.0.0
3499 */
3500 public static function render_hotspot_same_tab_checkbox_field($name, $val)
3501 {
3502 extract($val);
3503 ob_start();
3504 ?>
3505
3506 <div class="single-settings s_tab" style="display:<?php echo esc_attr( $display ); ?>;">
3507
3508 <div class="wpvr-global-tooltip-area">
3509 <span><?php echo esc_html( $title ) . ': '; ?></span>
3510
3511 <?php if(!empty($have_tooltip)) { ?>
3512 <div class="field-tooltip">
3513 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3514
3515 <span>
3516 <?php
3517 // Ensure tooltip_text text is set
3518 if (!empty($tooltip_text['text'])) {
3519 echo esc_html($tooltip_text['text']);
3520
3521 // Check if URL exists before rendering the link
3522 if (!empty($tooltip_text['url'])) {
3523 printf(
3524 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3525 esc_url($tooltip_text['url']),
3526 esc_html__( 'View Doc', 'wpvr' )
3527 );
3528 }
3529 }
3530 ?>
3531 </span>
3532 </div>
3533 <?php } ?>
3534
3535 </div>
3536
3537 <label class="wpvr-switcher-v2">
3538 <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'; } ?> >
3539 <span class="switcher-box"></span>
3540 </label>
3541 </div>
3542
3543 <?php
3544 ob_end_flush();
3545 }
3546
3547
3548 /**
3549 * Render Hotspot Setting Pro Version Text Fields
3550 * @param mixed $name input field name
3551 * @param mixed $val options
3552 *
3553 * @return void
3554 * @since 8.0.0
3555 */
3556 public static function render_hotspot_pro_text_field($name, $val)
3557 {
3558 extract($val);
3559 ob_start();
3560 ?>
3561
3562 <div class="hotspot-scene" style="display:none;">
3563
3564 <div class="wpvr-global-tooltip-area">
3565 <label for="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
3566
3567 <?php if(!empty($have_tooltip)) { ?>
3568 <div class="field-tooltip">
3569 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3570
3571 <span>
3572 <?php
3573 // Ensure tooltip_text text is set
3574 if (!empty($tooltip_text['text'])) {
3575 echo esc_html($tooltip_text['text']);
3576
3577 // Check if URL exists before rendering the link
3578 if (!empty($tooltip_text['url'])) {
3579 printf(
3580 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3581 esc_url($tooltip_text['url']),
3582 esc_html__( 'View Doc', 'wpvr' )
3583 );
3584 }
3585 }
3586 ?>
3587 </span>
3588 </div>
3589 <?php } ?>
3590 </div>
3591
3592 <input class="<?php echo esc_attr( $name ); ?>" type="text" name="<?php echo esc_attr( $name ); ?>"/>
3593 </div>
3594
3595 <?php
3596 ob_end_flush();
3597 }
3598
3599
3600 /**
3601 * Render Hotspot Setting Terget Scene related text fields
3602 * @param mixed $name input field name
3603 * @param mixed $val options
3604 *
3605 * @return void
3606 * @since 8.0.0
3607 */
3608 public static function render_hotspot_terget_scene_pro_text_field($name, $val)
3609 {
3610 extract($val);
3611 ob_start();
3612 ?>
3613
3614 <div class="hotspot-scene" style="display:block;" >
3615 <label for="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
3616
3617 <?php if(!empty($have_tooltip)) { ?>
3618 <div class="field-tooltip">
3619 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3620
3621 <span>
3622 <?php
3623 // Ensure tooltip_text text is set
3624 if (!empty($tooltip_text['text'])) {
3625 echo esc_html($tooltip_text['text']);
3626
3627 // Check if URL exists before rendering the link
3628 if (!empty($tooltip_text['url'])) {
3629 printf(
3630 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3631 esc_url($tooltip_text['url']),
3632 esc_html__( 'View Doc', 'wpvr' )
3633 );
3634 }
3635 }
3636 ?>
3637 </span>
3638 </div>
3639 <?php } ?>
3640
3641 <input class="<?php echo esc_attr( $name ); ?>" type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
3642 </div>
3643
3644 <?php
3645 ob_end_flush();
3646 }
3647
3648
3649 /**
3650 * Render Hotspot Info Type Selct Field
3651 * @param mixed $name input field name
3652 * @param mixed $val options
3653 *
3654 * @return void
3655 * @since 8.0.0
3656 */
3657 public static function render_hotspot_info_type_select_field($name, $val)
3658 {
3659 extract($val);
3660 $default_type = apply_filters('wpvr_hotspot_types', array(
3661 'info' => __('Info', 'wpvr'),
3662 'scene' => __('Scene', 'wpvr'),
3663 ));
3664 ob_start();
3665 ?>
3666
3667 <div class="wpvr-global-tooltip-area">
3668 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
3669
3670 <div class="field-tooltip">
3671 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3672 <span>
3673 <?php echo esc_html__('Choose the type of hotspot: Info (displays information) or Scene (links to another scene).', 'wpvr') ?>
3674
3675 <?php
3676 $tooltip_url = 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/#0-toc-title'; // Replace with the actual documentation link
3677 if (!empty($tooltip_url)) :
3678 ?>
3679 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
3680 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
3681 </a>
3682 <?php endif; ?>
3683 </span>
3684 </div>
3685
3686 </div>
3687
3688 <select name="<?php echo esc_attr( $name ); ?>">
3689 <?php
3690 $hotspot_type = 'info';
3691 foreach ($default_type as $key => $value) {
3692 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
3693 } ?>
3694 </select>
3695
3696 <?php
3697 do_action('hotspot_info_before_hover_content', 'info', array());
3698 ob_end_flush();
3699 }
3700
3701
3702 /**
3703 * Render Hotspot Scene Type Selct Field
3704 * @param mixed $name input field name
3705 * @param mixed $val options
3706 *
3707 * @return void
3708 * @since 8.0.0
3709 */
3710 public static function render_hotspot_scene_type_select_field($name, $val)
3711 {
3712 extract($val);
3713 $default_type = apply_filters('wpvr_hotspot_types', array(
3714 'info' => __('Info', 'wpvr'),
3715 'scene' => __('Scene', 'wpvr'),
3716 ));
3717 ob_start();
3718 ?>
3719
3720 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
3721 <select class="trtr" name="<?php echo esc_attr( $name ); ?>">
3722 <?php
3723 $hotspot_type = 'scene';
3724 foreach ($default_type as $key => $value) {
3725 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
3726 } ?>
3727 </select>
3728
3729 <?php
3730 do_action('hotspot_info_before_hover_content', 'scene', array());
3731 ob_end_flush();
3732 }
3733
3734
3735 /**
3736 * Render Hotspot Info Type URL field
3737 * @param mixed $name input field name
3738 * @param mixed $val options
3739 *
3740 * @return void
3741 * @since 8.0.o
3742 */
3743 public static function render_hotspot_info_url_field($name, $val)
3744 {
3745 extract($val);
3746 ob_start();
3747 ?>
3748
3749 <div class="hotspot-url" style="display:<?php echo esc_attr( $display ); ?>;">
3750
3751 <div class="wpvr-global-tooltip-area">
3752 <label for="hotspot-url"><?php echo esc_html( $title ) . ': '; ?></label>
3753
3754 <?php if(!empty($have_tooltip)) { ?>
3755 <div class="field-tooltip">
3756 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3757
3758 <span>
3759 <?php
3760 // Ensure tooltip_text text is set
3761 if (!empty($tooltip_text['text'])) {
3762 echo esc_html($tooltip_text['text']);
3763
3764 // Check if URL exists before rendering the link
3765 if (!empty($tooltip_text['url'])) {
3766 printf(
3767 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3768 esc_url($tooltip_text['url']),
3769 esc_html__( 'View Doc', 'wpvr' )
3770 );
3771 }
3772 }
3773 ?>
3774 </span>
3775 </div>
3776 <?php } ?>
3777 </div>
3778
3779 <input type="url" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
3780 </div>
3781
3782 <?php
3783 ob_end_flush();
3784 }
3785
3786
3787 /**
3788 * Render Hotspot Textarea Field
3789 * @param mixed $name input field name
3790 * @param mixed $val options
3791 *
3792 * @return void
3793 * @since 8.0.0
3794 */
3795 public static function render_hotspot_textarea_field($name, $val)
3796 {
3797 extract($val);
3798 ob_start();
3799 ?>
3800
3801 <div class="<?php echo esc_attr( $class ); ?>">
3802
3803 <div class="wpvr-global-tooltip-area">
3804 <label for="hotspot-content"><?php echo esc_html( $title ) . ': '; ?></label>
3805
3806 <?php if(!empty($have_tooltip)) { ?>
3807 <div class="field-tooltip">
3808 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3809
3810 <span>
3811 <?php
3812 // Ensure tooltip_text text is set
3813 if (!empty($tooltip_text['text'])) {
3814 echo esc_html($tooltip_text['text']);
3815
3816 // Check if URL exists before rendering the link
3817 if (!empty($tooltip_text['url'])) {
3818 printf(
3819 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3820 esc_url($tooltip_text['url']),
3821 esc_html__( 'View Doc', 'wpvr' )
3822 );
3823 }
3824 }
3825 ?>
3826 </span>
3827 </div>
3828 <?php } ?>
3829 </div>
3830
3831 <textarea name="<?php echo esc_attr( $name ); ?>"></textarea>
3832 </div>
3833
3834 <?php
3835 ob_end_flush();
3836 }
3837
3838
3839 /**
3840 * Render Hotspot Info Type Textarea Field
3841 * @param mixed $name input field name
3842 * @param mixed $val options
3843 *
3844 * @return void
3845 * @since 8.0.0
3846 */
3847 public static function render_hotspot_info_textarea_field($name, $val)
3848 {
3849 extract($val);
3850 ob_start();
3851 ?>
3852 <div class="<?php echo esc_attr($class); ?>" style="display:<?php echo esc_attr($display); ?>;">
3853 <div class="wpvr-global-tooltip-area">
3854 <label for="<?php echo esc_attr($name); ?>">
3855 <?php echo esc_html($title . ': '); ?>
3856 </label>
3857
3858 <?php if (!empty($have_tooltip)) : ?>
3859 <div class="field-tooltip">
3860 <img loading="lazy"
3861 src="<?php echo esc_url(WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'); ?>"
3862 alt="<?php echo esc_attr__('Tooltip Icon', 'wpvr'); ?>" />
3863 <span>
3864 <?php
3865 if (!empty($tooltip_text['text'])) {
3866 echo esc_html($tooltip_text['text']);
3867
3868 if (!empty($tooltip_text['url'])) {
3869 printf(
3870 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3871 esc_url($tooltip_text['url']),
3872 esc_html__( 'View Doc', 'wpvr' )
3873 );
3874 }
3875 }
3876 ?>
3877 </span>
3878 </div>
3879 <?php endif; ?>
3880 </div>
3881
3882 <?php
3883 // ---- Safe iframe sanitization ----
3884 $raw_value = $value ?? '';
3885
3886 // Allow <iframe> from safe video sources only
3887 $raw_value = preg_replace_callback('/<iframe[^>]+src=["\']([^"\']+)["\'][^>]*>/i', function ($matches) {
3888 $src = $matches[1];
3889 if (preg_match('/^(https?:)?\/\/(www\.)?(youtube\.com|youtu\.be|player\.vimeo\.com)\//i', $src)) {
3890 return $matches[0]; // allow safe video sources
3891 }
3892 return ''; // remove unsafe iframe
3893 }, $raw_value);
3894
3895 // Extend wp_kses allowed tags to include iframe safely
3896 $allowed_tags = wp_kses_allowed_html('post');
3897 $allowed_tags['iframe'] = [
3898 'src' => true,
3899 'width' => true,
3900 'height' => true,
3901 'frameborder' => true,
3902 'allowfullscreen' => true,
3903 'class' => true,
3904 ];
3905
3906 $sanitized_value = wp_kses($raw_value, $allowed_tags);
3907 ?>
3908
3909 <textarea name="<?php echo esc_attr($name); ?>"><?php echo esc_textarea($sanitized_value); ?></textarea>
3910 </div>
3911 <?php
3912 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3913 echo ob_get_clean();
3914 }
3915
3916
3917
3918
3919 /**
3920 * Render Hotspot Scene Type Textarea Field
3921 * @param mixed $name input field name
3922 * @param mixed $val options
3923 *
3924 * @return void
3925 * @since 8.0.0
3926 */
3927 public static function render_hotspot_scene_content_field($name, $val)
3928 {
3929 extract($val);
3930 ob_start();
3931 ?>
3932
3933 <div class="<?php echo esc_attr( $class ); ?>" style="display:<?php echo esc_attr( $display ); ?>;">
3934 <label for="hotspot-content"><?php echo esc_html( $title ) . ': '; ?></label>
3935 <textarea name="<?php echo esc_attr( $name ); ?>"></textarea>
3936 </div>
3937
3938 <?php
3939 ob_end_flush();
3940 }
3941
3942
3943 /**
3944 * Render Hotspot Scene Select Field
3945 * @param mixed $name input field name
3946 * @param mixed $val options
3947 *
3948 * @return void
3949 */
3950 public static function render_hotspot_scene_select_field($name, $val)
3951 {
3952 extract($val);
3953 ob_start();
3954 ?>
3955
3956 <div class="hotspot-scene" style="display:none;" >
3957 <div class="wpvr-global-tooltip-area">
3958 <label for="hotspot-scene"><?php echo esc_html( $title ) . ': '; ?></label>
3959
3960 <?php if(!empty($have_tooltip)) { ?>
3961 <div class="field-tooltip">
3962 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3963
3964 <span>
3965 <?php
3966 // Ensure tooltip_text text is set
3967 if (!empty($tooltip_text['text'])) {
3968 echo esc_html($tooltip_text['text']);
3969
3970 // Check if URL exists before rendering the link
3971 if (!empty($tooltip_text['url'])) {
3972 printf(
3973 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3974 esc_url($tooltip_text['url']),
3975 esc_html__( 'View Doc', 'wpvr' )
3976 );
3977 }
3978 }
3979 ?>
3980 </span>
3981 </div>
3982 <?php } ?>
3983 </div>
3984
3985 <select class="hotspotscene" name="<?php echo esc_attr( $name ); ?>">
3986 <option value="none" selected> None</option>
3987 </select>
3988 </div>
3989
3990 <?php
3991 ob_end_flush();
3992 }
3993
3994
3995 /**
3996 * Render Hotspot Scene List Select Field
3997 * @param mixed $name input field name
3998 * @param mixed $val options
3999 *
4000 * @return void
4001 */
4002 public static function render_hotspot_scene_list_field($name, $val)
4003 {
4004 extract($val);
4005 ob_start();
4006 ?>
4007
4008 <div class="hotspot-scene" style="display:<?php echo esc_attr( $display ); ?>;" >
4009
4010 <div class="wpvr-global-tooltip-area">
4011 <label for="hotspot-scene"><?php echo esc_html( $title ) . ': '; ?></label>
4012 <?php if(!empty($have_tooltip)) { ?>
4013 <div class="field-tooltip">
4014 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4015
4016 <span>
4017 <?php
4018 // Ensure tooltip_text text is set
4019 if (!empty($tooltip_text['text'])) {
4020 echo esc_html($tooltip_text['text']);
4021
4022 // Check if URL exists before rendering the link
4023 if (!empty($tooltip_text['url'])) {
4024 printf(
4025 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4026 esc_url($tooltip_text['url']),
4027 esc_html__( 'View Doc', 'wpvr' )
4028 );
4029 }
4030 }
4031 ?>
4032 </span>
4033 </div>
4034 <?php } ?>
4035 </div>
4036 <select class="hotspotscene" name="<?php echo esc_attr( $name ); ?>">
4037 <option value="none" selected> None</option>
4038 </select>
4039 </div>
4040
4041 <?php
4042 ob_end_flush();
4043 }
4044
4045
4046 /**
4047 * Render Hotspot Disabled Select Field
4048 * @param mixed $name input field name
4049 * @param mixed $val options
4050 *
4051 * @return void
4052 * @since 8.0.0
4053 */
4054 public static function render_hotspot_disabled_text_field($name, $val)
4055 {
4056 extract($val);
4057 ob_start();
4058 ?>
4059
4060 <div class="hotspot-scene" style="display:<?php echo esc_attr( $display ); ?>;" >
4061
4062 <div class="wpvr-global-tooltip-area">
4063 <label for="hotspot-scene"><?php echo esc_html( $title ) . ': '; ?></label>
4064 <?php if(!empty($have_tooltip)) { ?>
4065 <div class="field-tooltip">
4066 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4067
4068 <span>
4069 <?php
4070 // Ensure tooltip_text text is set
4071 if (!empty($tooltip_text['text'])) {
4072 echo esc_html($tooltip_text['text']);
4073
4074 // Check if URL exists before rendering the link
4075 if (!empty($tooltip_text['url'])) {
4076 printf(
4077 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4078 esc_url($tooltip_text['url']),
4079 esc_html__( 'View Doc', 'wpvr' )
4080 );
4081 }
4082 }
4083 ?>
4084 </span>
4085 </div>
4086 <?php } ?>
4087 </div>
4088
4089 <input class="<?php echo esc_attr( $input_class ); ?>" type="text" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" disabled/>
4090 </div>
4091
4092 <?php
4093 ob_end_flush();
4094 }
4095
4096
4097 /**
4098 * Render Hotspot Custom Icon Field
4099 * @param mixed $name input field name
4100 * @param mixed $val options
4101 *
4102 * @return void
4103 * @since 8.0.0
4104 */
4105 public static function render_hotspot_custom_icon_field($name, $val)
4106 {
4107 extract($val);
4108 ob_start();
4109 ?>
4110
4111 <div class="hotspot-setting custom-icon">
4112 <div class="wpvr-global-tooltip-area">
4113 <label for="hotspot-customclass-pro"><?php echo esc_html( $title ) . ': '; ?></label>
4114
4115 <div class="field-tooltip">
4116 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4117 <span>
4118 <?php echo esc_html__('Select a custom icon for the hotspot.', 'wpvr') ?>
4119
4120 <?php
4121 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/';
4122 if (!empty($tooltip_url)) :
4123 ?>
4124 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4125 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4126 </a>
4127 <?php endif; ?>
4128 </span>
4129 </div>
4130
4131 </div>
4132
4133 <select class="hotspot-customclass-pro-select" name="<?php echo esc_attr( $name ); ?>">
4134 <?php
4135 foreach ($custom_icons as $cikey => $civalue) {
4136 if ($cikey == $hotspot_custom_class_pro) { ?>
4137 <option value="<?php echo esc_attr( $cikey ); ?>" selected> <?php echo esc_html( $civalue ); ?></option>
4138 <?php } else { ?>
4139 <option value="<?php echo esc_attr( $cikey ); ?>"> <?php echo esc_html( $civalue ); ?></option>
4140 <?php }
4141 }
4142 ?>
4143 </select>
4144
4145 <span class="change-icon"><i class="<?php echo esc_attr( $hotspot_custom_class_pro ); ?>"></i></span>
4146
4147
4148 </div>
4149
4150 <?php
4151 ob_end_flush();
4152 }
4153
4154
4155 /**
4156 * Render Hotspot Custom Icon Color Field
4157 * @param mixed $name input field name
4158 * @param mixed $val options
4159 *
4160 * @return void
4161 * @since 8.0.0
4162 */
4163 public static function render_hotspot_custom_icon_color_field($name, $val)
4164 {
4165 extract($val);
4166 ob_start();
4167 ?>
4168
4169 <div class="hotspot-setting hotspot-icon">
4170 <div class="wpvr-global-tooltip-area">
4171 <label for="hotspot-customclass-color"><?php echo esc_html( $title ) . ': '; ?></label>
4172
4173 <div class="field-tooltip">
4174 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4175 <span>
4176 <?php echo esc_html__('Set a custom background color for the hotspot.', 'wpvr') ?>
4177
4178 <?php
4179 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4180 if (!empty($tooltip_url)) :
4181 ?>
4182 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4183 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4184 </a>
4185 <?php endif; ?>
4186 </span>
4187 </div>
4188
4189 </div>
4190
4191 <input type="color" class="hotspot-customclass-color" name="hotspot-customclass-color" value="<?php echo esc_attr( $value ); ?>" />
4192 <input type="hidden" class="hotspot-customclass-color-icon-value" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
4193 </div>
4194
4195 <?php
4196 ob_end_flush();
4197 }
4198 /**
4199 * Render Hotspot Custom Icon Color Field
4200 * @param mixed $name input field name
4201 * @param mixed $val options
4202 *
4203 * @return void
4204 * @since 8.0.0
4205 */
4206 public static function render_hotspot_wpvr_custom_icon_color_field($name, $val)
4207 {
4208 extract($val);
4209 ob_start();
4210 ?>
4211
4212 <div class="hotspot-setting hotspot-icon">
4213
4214 <div class="wpvr-global-tooltip-area">
4215 <label for="hotspot-custom-color"><?php echo esc_html( $title ) . ': '; ?></label>
4216
4217 <div class="field-tooltip">
4218 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4219 <span>
4220 <?php echo esc_html__('Set a custom color for the hotspot icon.', 'wpvr') ?>
4221
4222 <?php
4223 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4224 if (!empty($tooltip_url)) :
4225 ?>
4226 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4227 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4228 </a>
4229 <?php endif; ?>
4230 </span>
4231 </div>
4232 </div>
4233
4234 <input type="color" class="hotspot-custom-color" name="hotspot-customc-color" value="<?php echo esc_attr( $value ); ?>" />
4235 <input type="hidden" class="hotspot-custom-icon-color-value" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
4236 </div>
4237
4238 <?php
4239 ob_end_flush();
4240 }
4241
4242
4243 /**
4244 * Render Hotspot Animation Field
4245 * @param mixed $name input field name
4246 * @param mixed $val options
4247 *
4248 * @return void
4249 * @since 8.0.0
4250 */
4251 public static function render_hotspot_animation_field($name, $val)
4252 {
4253 extract($val);
4254 ob_start();
4255 ?>
4256
4257 <div class="hotspot-setting">
4258
4259 <div class="wpvr-global-tooltip-area">
4260 <label for="hotspot-blink"><?php echo esc_html( $title ) . ': '; ?></label>
4261
4262 <div class="field-tooltip">
4263 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4264 <span>
4265 <?php echo esc_html__('Enable an animation for the hotspot.', 'wpvr') ?>
4266
4267 <?php
4268 $tooltip_url = 'https://rextheme.com/docs/individual-hotspot-icon-color-animation-panorama/#0-toc-title'; // Replace with the actual documentation link
4269 if (!empty($tooltip_url)) :
4270 ?>
4271 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4272 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4273 </a>
4274 <?php endif; ?>
4275 </span>
4276 </div>
4277 </div>
4278
4279 <select name="<?php echo esc_attr( $name ); ?>" class="hotspot-blink" >
4280 <option value="on" <?php if($selected == 'on') { echo esc_attr('selected'); } ?> > On</option>
4281 <option value="off" <?php if($selected == 'off') { echo esc_attr('selected'); } ?> > Off</option>
4282 </select>
4283 </div>
4284
4285 <?php
4286 ob_end_flush();
4287 }
4288
4289 /**
4290 * Render Hotspot Animation Field
4291 * @param mixed $name input field name
4292 * @param mixed $val options
4293 *
4294 * @return void
4295 * @since 8.0.0
4296 */
4297 public static function render_hotspot_border_field($name, $val)
4298 {
4299 extract($val);
4300 ob_start();
4301 ?>
4302
4303 <div class="hotspot-setting">
4304 <div class="wpvr-global-tooltip-area">
4305 <label for="hotspot-border"><?php echo esc_html( $title ) . ': '; ?></label>
4306
4307 <div class="field-tooltip">
4308 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4309 <span>
4310 <?php echo esc_html__('Add a border around the hotspot with customizable color, style, and thickness.', 'wpvr') ?>
4311
4312 <?php
4313 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4314 if (!empty($tooltip_url)) :
4315 ?>
4316 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4317 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4318 </a>
4319 <?php endif; ?>
4320 </span>
4321 </div>
4322 </div>
4323
4324
4325 <select name="<?php echo esc_attr( $name ); ?>" class="hotspot-border" >
4326 <option value="on" <?php if($selected == 'on') { echo esc_attr('selected'); } ?> > On</option>
4327 <option value="off" <?php if($selected == 'off') { echo esc_attr('selected'); } ?> > Off</option>
4328 </select>
4329 </div>
4330
4331 <?php
4332 ob_end_flush();
4333 }
4334 /**
4335 * Render Hotspot Animation Field
4336 * @param mixed $name input field name
4337 * @param mixed $val options
4338 *
4339 * @return void
4340 * @since 8.0.0
4341 */
4342 public static function render_hotspot_border_style_field($name, $val)
4343 {
4344 extract($val);
4345 ob_start();
4346 ?>
4347
4348 <div class='hotspot-border-style' >
4349 <label for="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
4350 <select name="<?php echo esc_attr( $name ); ?>">
4351 <option value="none" <?php echo !$selected ? esc_attr('selected') : ''; ?>>None</option>
4352 <option value="hidden" <?php selected( $selected, 'hidden' ); ?>>Hidden</option>
4353 <option value="dotted" <?php selected( $selected, 'dotted' ); ?>>Dotted</option>
4354 <option value="dashed" <?php selected( $selected, 'dashed' ); ?>>Dashed</option>
4355 <option value="solid" <?php selected( $selected, 'solid' ); ?>>Solid</option>
4356 <option value="double" <?php selected( $selected, 'double' ); ?>>Double</option>
4357 <option value="groove" <?php selected( $selected, 'groove' ); ?>>Groove</option>
4358 <option value="ridge" <?php selected( $selected, 'ridge' ); ?>>Ridge</option>
4359 <option value="inset" <?php selected( $selected, 'inset' ); ?>>Inset</option>
4360 <option value="outset" <?php selected( $selected, 'outset' ); ?>>Outset</option>
4361 </select>
4362 </div>
4363
4364 <?php
4365 ob_end_flush();
4366 }
4367
4368 public static function render_hotspot_border_color_field($name, $val)
4369 {
4370 extract($val);
4371 ob_start();
4372 ?>
4373 <div class='hotspot-border-color'>
4374 <label for="hotspot-border-color"><?php echo esc_html( $title ) . ': '; ?></label>
4375 <input type="color" class="hotspot-border-color-for-view" name="hotspot-border-color-for-view" value="<?php echo esc_attr( $value ); ?>" />
4376 <input type="hidden" class="hotspot-border-color" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
4377 </div>
4378 </div>
4379 <?php
4380 ob_end_flush();
4381 }
4382
4383 public static function render_hotspot_border_width_field($name, $val)
4384 {
4385 extract($val);
4386 ob_start();
4387 ?>
4388 <div class="hotspot-setting hotspot-border-setting" style="<?php echo esc_attr( $hotspot_border_data == 'off' ? 'display:none' : '' ); ?>">
4389 <div class='hotspot-setting-border-width'>
4390 <label for="hotspot-border-width"><?php echo esc_html( $title ) . ': '; ?></label>
4391 <input type="text" class="hotspot-border-width" name="hotspot-border-width" value="<?php echo esc_attr( $value ); ?>" />
4392 </div>
4393
4394
4395 <?php
4396 ob_end_flush();
4397 }
4398
4399 /**
4400 * Render Hotspot Animation Field
4401 * @param mixed $name input field name
4402 * @param mixed $val options
4403 *
4404 * @return void
4405 * @since 8.0.0
4406 */
4407 public static function render_hotspot_shape_field($name, $val)
4408 {
4409 extract($val);
4410 ob_start();
4411 ?>
4412
4413 <div class="hotspot-setting">
4414
4415 <div class="wpvr-global-tooltip-area">
4416 <label for="hotspot-shape"><?php echo esc_html( $title ) . ': '; ?></label>
4417
4418 <div class="field-tooltip">
4419 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4420 <span>
4421 <?php echo esc_html__('Select the shape of the hotspot (e.g., Rounded, square, and Hexagon).', 'wpvr') ?>
4422
4423 <?php
4424 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4425 if (!empty($tooltip_url)) :
4426 ?>
4427 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4428 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4429 </a>
4430 <?php endif; ?>
4431 </span>
4432 </div>
4433 </div>
4434
4435 <select name="<?php echo esc_attr( $name ); ?>" class="hotspot-shape" >
4436 <option value="round" <?php if($selected == 'round') { echo esc_attr('selected'); } ?> > Rounded</option>
4437 <option value="square" <?php if($selected == 'square') { echo esc_attr('selected'); } ?> > Square</option>
4438 <option value="hexagon" <?php if($selected == 'hexagon') { echo esc_attr('selected'); } ?> > Hexagon</option>
4439 </select>
4440 </div>
4441
4442 <?php
4443 ob_end_flush();
4444 }
4445
4446 /**
4447 * Render Fluent form Field
4448 * @param mixed $name input field name
4449 * @param mixed $val options
4450 *
4451 * @return void
4452 * @since 8.0.0
4453 */
4454 public static function render_hotspot_fluent_form_type_field($name , $val){
4455 extract($val);
4456 $default_type = apply_filters('wpvr_hotspot_types', array(
4457 'info' => __('Info', 'wpvr'),
4458 'scene' => __('Scene', 'wpvr'),
4459 ));
4460 ob_start();
4461 ?>
4462
4463 <div class="wpvr-global-tooltip-area">
4464 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
4465
4466 <div class="field-tooltip">
4467 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4468 <span>
4469 <?php echo esc_html__('Choose the type of hotspot: Info (displays information) or Scene (links to another scene).', 'wpvr') ?>
4470
4471 <?php
4472 $tooltip_url = 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/#0-toc-title'; // Replace with the actual documentation link
4473 if (!empty($tooltip_url)) :
4474 ?>
4475 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4476 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4477 </a>
4478 <?php endif; ?>
4479 </span>
4480 </div>
4481 </div>
4482
4483 <select name="<?php echo esc_attr( $name ); ?>">
4484 <?php
4485 $hotspot_type = 'fluent_form';
4486 foreach ($default_type as $key => $value) {
4487 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
4488 } ?>
4489 </select>
4490
4491 <?php
4492 ob_end_flush();
4493 }
4494
4495 /**
4496 * Render Hotspot Fluent form id
4497 * @param mixed $name input field name
4498 * @param mixed $val options
4499 *
4500 * @return void
4501 * @since 8.0.0
4502 */
4503 public static function render_hotspot_fluent_form_select_field($name , $val){
4504 extract($val);
4505 do_action("hotspot_info_before_hover_content","fluent_form",$value);
4506 }
4507 /**
4508 * Render woocommerce Field
4509 * @param mixed $name input field name
4510 * @param mixed $val options
4511 *
4512 * @return void
4513 * @since 8.0.0
4514 */
4515 public static function render_hotspot_wc_product_type_field($name , $val){
4516 extract($val);
4517 $default_type = apply_filters('wpvr_hotspot_types', array(
4518 'info' => __('Info', 'wpvr'),
4519 'scene' => __('Scene', 'wpvr'),
4520 ));
4521 ob_start();
4522 ?>
4523
4524 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
4525 <select name="<?php echo esc_attr( $name ); ?>">
4526 <?php
4527 $hotspot_type = 'wc_product';
4528 foreach ($default_type as $key => $value) {
4529 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
4530 } ?>
4531 </select>
4532
4533 <?php
4534 ob_end_flush();
4535 }
4536
4537 /**
4538 * Render Hotspot Woocommerce Product
4539 * @param mixed $name input field name
4540 * @param mixed $val options
4541 *
4542 * @return void
4543 * @since 8.0.0
4544 */
4545 public static function render_hotspot_wc_product_select_field($name , $val){
4546 extract($val);
4547 do_action("hotspot_info_before_hover_content","wc_product",$value);
4548 }
4549
4550 public static function render_call_to_form_checkbox($name, $val)
4551 {
4552 extract( $val );
4553 ob_start();
4554 ?>
4555 <div class="<?php echo esc_attr( $class ); ?>">
4556 <div class="wpvr-tooltip-area">
4557 <span><?php echo esc_html( $title ) . ': '; ?></span>
4558 <?php if(!empty($have_tooltip)) { ?>
4559 <div class="field-tooltip">
4560 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4561
4562 <span>
4563 <?php
4564 // Ensure tooltip_text text is set
4565 if (!empty($tooltip_text['text'])) {
4566 echo esc_html($tooltip_text['text']);
4567
4568 // Check if URL exists before rendering the link
4569 if (!empty($tooltip_text['url'])) {
4570 printf(
4571 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4572 esc_url($tooltip_text['url']),
4573 esc_html__( 'View Doc', 'wpvr' )
4574 );
4575 }
4576 }
4577 ?>
4578 </span>
4579 </div>
4580 <?php } ?>
4581
4582 </div>
4583
4584 <span class="wpvr-switcher">
4585 <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' : '' ); ?>/>
4586 <label for="<?php echo esc_attr( $id ); ?>"></label>
4587 </span>
4588
4589
4590
4591 </div>
4592 <?php
4593 ob_end_flush();
4594 }
4595
4596 public static function render_text_area_field($name, $val)
4597 {
4598 extract( $val );
4599 ob_start();
4600 ?>
4601 <div class="<?php echo esc_attr( $class ); ?>">
4602 <div id="<?php echo esc_attr( $code_mirror_id ); ?>" ></div>
4603 <!-- --><?php //if(!empty($have_tooltip)) {?>
4604 <!-- <div class="field-tooltip">-->
4605 <!-- <img src="--><?php //= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'; ?><!--" alt="icon" />-->
4606 <!-- <span>--><?php //= esc_html( $tooltip_text ); ?><!--</span>-->
4607 <!-- </div>-->
4608 <!-- --><?php //} ?>
4609 </div>
4610 <style>
4611 /* Adjust the styling of line numbers */
4612 .CodeMirror-linenumber {
4613 padding: 0 5px; /* Adjust padding as needed */
4614 color: #999; /* Adjust color as needed */
4615 }
4616
4617 </style>
4618 <?php
4619 ob_end_flush();
4620 }
4621
4622
4623 public static function render_custom_css_form_checkbox($name, $val)
4624 {
4625 extract( $val );
4626 ob_start();
4627 ?>
4628 <div class="<?php echo esc_attr( $class ); ?>">
4629 <div class="wpvr-tooltip-area">
4630 <span><?php echo esc_html( $title ) . ': '; ?></span>
4631 <?php if(!empty($have_tooltip)) { ?>
4632 <div class="field-tooltip">
4633 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4634
4635 <span>
4636 <?php
4637 // Ensure tooltip_text text is set
4638 if (!empty($tooltip_text['text'])) {
4639 echo esc_html($tooltip_text['text']);
4640
4641 // Check if URL exists before rendering the link
4642 if (!empty($tooltip_text['url'])) {
4643 printf(
4644 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4645 esc_url($tooltip_text['url']),
4646 esc_html__( 'View Doc', 'wpvr' )
4647 );
4648 }
4649 }
4650 ?>
4651 </span>
4652 </div>
4653 <?php } ?>
4654
4655 </div>
4656
4657 <span class="wpvr-switcher">
4658 <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' : '' ); ?>/>
4659 <label for="<?php echo esc_attr( $id ); ?>"></label>
4660 </span>
4661
4662 </div>
4663 <?php
4664 ob_end_flush();
4665 }
4666
4667 public static function render_button_configuration_field($name, $val)
4668 {
4669 extract( $val );
4670 ob_start();
4671 $button_style =$val['value'];
4672 $selectedBgColor = isset($button_style['button_background_color']) ? $button_style['button_background_color'] : '#201cfe';
4673 $selectedColor = isset($button_style['button_font_color']) ? $button_style['button_font_color'] : '#ffffff';
4674 $selectedFontSize = isset($button_style['button_font_size']) ? $button_style['button_font_size'] : 14;
4675 $selectedFontWeight = isset($button_style['button_font_weight']) ? $button_style['button_font_weight'] : 400;
4676 $selectedLineHeight = isset($button_style['button_line_height']) ? $button_style['button_line_height'] : 1;
4677 $selectedTextDecoration = isset($button_style['button_text_decoration']) ? $button_style['button_text_decoration'] : 'none';
4678 $selectedTransform = isset($button_style['button_transform']) ? $button_style['button_transform'] : 'none';
4679 $selectedAlignment = isset($button_style['button_alignment']) ? $button_style['button_alignment'] : 'left';
4680 $selectedFontStyle = isset($button_style['button_text_style']) ? $button_style['button_text_style'] : 'normal';
4681 $selectedLetterSpacing = isset($button_style['button_letter_spacing']) ? $button_style['button_letter_spacing'] : 1;
4682 $selectedWordSpacing = isset($button_style['button_word_spacing']) ? $button_style['button_word_spacing'] : 0;
4683 $selectedBorderWidth = isset($button_style['button_border_width']) ? $button_style['button_border_width'] : 1;
4684 $selectedBorderStyle = isset($button_style['button_border_style']) ? $button_style['button_border_style'] : 'solid';
4685 $selectedBorderColor = isset($button_style['button_border_style']) ? $button_style['button_border_color'] : '#201cfe';
4686 $selectedBorderRadius = isset($button_style['button_border_radius']) ? $button_style['button_border_radius'] : 6;
4687
4688 $selectedPaddingTop = isset($button_style['button_pt']) ? $button_style['button_pt'] : 10;
4689 $selectedPaddingRight = isset($button_style['button_pr']) ? $button_style['button_pr'] : 15;
4690 $selectedPaddingBottom = isset($button_style['button_pb']) ? $button_style['button_pb'] : 10;
4691 $selectedPaddingLeft = isset($button_style['button_pl']) ? $button_style['button_pl'] : 15;
4692
4693 $selectedNewTab = isset($button_style['button_open_new_tab']) ? $button_style['button_open_new_tab'] : 'off';
4694 ?>
4695 <div class="<?php echo esc_attr( $class ); ?>">
4696
4697 <div class="button-style-configaration">
4698 <div class="single-cta-control new-tab">
4699 <span class="wpvr-switcher">
4700 <span class="control-title"><?php echo esc_html__('Open in new tab','wpvr') ?></span>
4701 <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' ); ?> />
4702 <label for="button_open_new_tab"></label>
4703 </span>
4704 </div>
4705
4706 <div class="single-cta-control bg-color color-box">
4707 <label class="control-title"><?php echo esc_html__('Background Color :','wpvr') ?></label>
4708 <div class="colors">
4709 <span><?php echo esc_html__('Color','wpvr')?></span>
4710 <input type="color" name="button_background_color" value="<?php echo esc_attr( $selectedBgColor ); ?>">
4711 </div>
4712
4713 </div>
4714
4715 <div class="single-cta-control font-color color-box">
4716 <label class="control-title"><?php echo esc_html__('Font color :','wpvr') ?></label>
4717
4718 <div class="colors">
4719 <span><?php echo esc_html__('Color','wpvr')?></span>
4720 <input type="color" name="button_font_color" value="<?php echo esc_attr( $selectedColor ); ?>">
4721 </div>
4722
4723 </div>
4724
4725 <div class="single-cta-control font-size">
4726 <label class="control-title"><?php echo esc_html__('Font Size (px) :','wpvr') ?></label>
4727 <input type="number" name="button_font_size" value="<?php echo esc_attr( $selectedFontSize ); ?>" min="0">
4728 </div>
4729
4730 <div class="single-cta-control font-weight">
4731 <label class="control-title"><?php echo esc_html__('Font Weight :','wpvr') ?></label>
4732 <select name="button_font_weight" id="button_font_weight">
4733 <option value="400" <?php echo ($selectedFontWeight == '400') ? esc_attr('selected') : ''; ?>>400</option>
4734 <option value="500" <?php echo ($selectedFontWeight == '500') ? esc_attr('selected') : ''; ?>>500</option>
4735 <option value="600" <?php echo ($selectedFontWeight == '600') ? esc_attr('selected') : ''; ?>>600</option>
4736 <option value="700" <?php echo ($selectedFontWeight == '700') ? esc_attr('selected') : ''; ?>>700</option>
4737 <option value="800" <?php echo ($selectedFontWeight == '800') ? esc_attr('selected') : ''; ?>>800</option>
4738 <option value="900" <?php echo ($selectedFontWeight == '900') ? esc_attr('selected') : ''; ?>>900</option>
4739 </select>
4740 </div>
4741
4742 <div class="single-cta-control line-height">
4743 <label class="control-title"><?php echo esc_html__('Line Height :','wpvr') ?></label>
4744 <input type="number" name="button_line_height" value="<?php echo esc_attr( $selectedLineHeight ); ?>" min="0">
4745 </div>
4746
4747 <div class="single-cta-control text-decoration">
4748 <label class="control-title"><?php echo esc_html__('Text Decoration :','wpvr') ?></label>
4749 <select name="button_text_decoration" id="button_text_decoration">
4750 <option value="none" <?php echo ($selectedTextDecoration == 'none') ? 'selected' : ''; ?>><?php echo esc_html__('None','wpvr') ?></option>
4751 <option value="underline" <?php echo ($selectedTextDecoration == 'underline') ? 'selected' : ''; ?>> <?php echo esc_html__('Underline','wpvr') ?></option>
4752 <option value="overline" <?php echo ($selectedTextDecoration == 'overline') ? 'selected' : ''; ?>><?php echo esc_html__('Overline','wpvr') ?></option>
4753 <option value="line-through" <?php echo ($selectedTextDecoration == 'line-through') ? 'selected' : ''; ?>><?php echo esc_html__('Line Through','wpvr') ?></option>
4754 </select>
4755 </div>
4756
4757 <div class="single-cta-control text-transform">
4758 <label class="control-title"><?php echo esc_html__('Text Transform :','wpvr') ?></label>
4759 <select name="button_transform" id="button_transform">
4760 <option value="none" <?php echo ($selectedTransform == 'none') ? 'selected' : ''; ?>><?php echo esc_html__('None','wpvr') ?></option>
4761 <option value="uppercase" <?php echo ($selectedTransform == 'uppercase') ? 'selected' : ''; ?>><?php echo esc_html__('Uppercase','wpvr') ?></option>
4762 <option value="lowercase" <?php echo ($selectedTransform == 'lowercase') ? 'selected' : ''; ?>><?php echo esc_html__('Lowercase','wpvr') ?></option>
4763 <option value="capitalize" <?php echo ($selectedTransform == 'capitalize') ? 'selected' : ''; ?>><?php echo esc_html__('Capitalize','wpvr') ?></option>
4764 </select>
4765 </div>
4766
4767 <div class="single-cta-control text-align">
4768 <label class="control-title"> <?php echo esc_html__('Button Alignment :','wpvr') ?></label>
4769 <select name="button_alignment" id="button_alignment">
4770 <option value="left" <?php echo ($selectedAlignment == 'left') ? 'selected' : ''; ?>> <?php echo esc_html__('Left','wpvr') ?></option>
4771 <option value="right" <?php echo ($selectedAlignment == 'right') ? 'selected' : ''; ?>> <?php echo esc_html__('Right','wpvr') ?></option>
4772 <option value="center" <?php echo ($selectedAlignment == 'center') ? 'selected' : ''; ?>> <?php echo esc_html__('Center','wpvr') ?></option>
4773 <option value="justified" <?php echo ($selectedAlignment == 'justified') ? 'selected' : ''; ?>> <?php echo esc_html__('Justified','wpvr') ?></option>
4774 </select>
4775 </div>
4776
4777 <div class="single-cta-control font-style">
4778 <label class="control-title"> <?php echo esc_html__('Font Style :','wpvr') ?></label>
4779 <select name="button_text_style" id="button_text_style">
4780 <option value="normal" <?php echo ($selectedFontStyle == 'normal') ? 'selected' : ''; ?>> <?php echo esc_html__('Normal','wpvr') ?></option>
4781 <option value="italic" <?php echo ($selectedFontStyle == 'italic') ? 'selected' : ''; ?>> <?php echo esc_html__('Italic','wpvr') ?></option>
4782 <option value="oblique" <?php echo ($selectedFontStyle == 'oblique') ? 'selected' : ''; ?>> <?php echo esc_html__('Oblique','wpvr') ?></option>
4783 </select>
4784 </div>
4785
4786 <div class="single-cta-control letter-spacing">
4787 <label class="control-title"> <?php echo esc_html__('Letter Spacing (px) :','wpvr') ?></label>
4788 <input type="number" name="button_letter_spacing" value="<?php echo esc_attr( $selectedLetterSpacing ); ?>" min="0">
4789 </div>
4790
4791 <div class="single-cta-control word-spacing">
4792 <label class="control-title"> <?php echo esc_html__('Word Spacing (px) :','wpvr') ?></label>
4793 <input type="number" name="button_word_spacing" value="<?php echo esc_attr( $selectedWordSpacing ); ?>" min="0">
4794 </div>
4795
4796 <div class="single-cta-control border-radius">
4797 <label class="control-title"> <?php echo esc_html__('Border Radius (px) :','wpvr') ?></label>
4798 <input type="number" name="button_border_radius" value="<?php echo esc_attr( $selectedBorderRadius ); ?>" min="0">
4799 </div>
4800
4801 <div class="single-cta-control control-group border">
4802 <label class="control-title"> <?php echo esc_html__('Border :','wpvr') ?></label>
4803 <div class="border-property-area">
4804 <div class="border-property border-width">
4805 <label class="control-inner-title"> <?php echo esc_html__('Width (px)','wpvr') ?></label>
4806 <input type="number" name="button_border_width" value="<?php echo esc_attr( $selectedBorderWidth ); ?>" min="0">
4807 </div>
4808
4809 <div class="border-property border-style">
4810 <label class="control-inner-title"> <?php echo esc_html__('Style','wpvr') ?></label>
4811 <select name="button_border_style" id="button_border_style">
4812 <option value="solid" <?php echo ($selectedBorderStyle == 'solid') ? 'selected' : ''; ?>> Solid</option>
4813 <option value="dashed" <?php echo ($selectedBorderStyle == 'dashed') ? 'selected' : ''; ?>> Dashed</option>
4814 <option value="dotted" <?php echo ($selectedBorderStyle == 'dotted') ? 'selected' : ''; ?>> Dotted</option>
4815 <option value="double" <?php echo ($selectedBorderStyle == 'double') ? 'selected' : ''; ?>> Double</option>
4816 <option value="none" <?php echo ($selectedBorderStyle == 'none') ? 'selected' : ''; ?>> None</option>
4817 </select>
4818 </div>
4819
4820 <div class="border-property border-color color-box">
4821 <label class="control-inner-title"> <?php echo esc_html__('Color','wpvr') ?></label>
4822 <input type="color" name="button_border_color" value="<?php echo esc_attr( $selectedBorderColor ); ?>">
4823 </div>
4824
4825 </div>
4826
4827 </div>
4828
4829 <div class="single-cta-control control-group padding">
4830 <label class="control-title"> <?php echo esc_html__('Padding (px) :','wpvr') ?></label>
4831 <div class="border-property-area">
4832 <div class="padding-property padding-top">
4833 <label class="control-inner-title"> <?php echo esc_html__('Top','wpvr') ?></label>
4834 <input type="number" name="button_pt" value="<?php echo esc_attr( $selectedPaddingTop ); ?>" min="0">
4835 </div>
4836
4837 <div class="padding-property padding-right">
4838 <label class="control-inner-title"> <?php echo esc_html__('Right','wpvr') ?></label>
4839 <input type="number" name="button_pr" value="<?php echo esc_attr( $selectedPaddingRight ); ?>">
4840 </div>
4841
4842 <div class="padding-property padding-bottom">
4843 <label class="control-inner-title"> <?php echo esc_html__('Bottom','wpvr') ?></label>
4844 <input type="number" name="button_pb" value="<?php echo esc_attr( $selectedPaddingBottom ); ?>">
4845 </div>
4846
4847 <div class="padding-property padding-left">
4848 <label class="control-inner-title"> <?php echo esc_html__('Left','wpvr') ?></label>
4849 <input type="number" name="button_pl" value="<?php echo esc_attr( $selectedPaddingLeft ); ?>">
4850 </div>
4851 </div>
4852
4853 </div>
4854
4855 </div>
4856 </div>
4857 <?php
4858 ob_end_flush();
4859 }
4860
4861
4862
4863 /**
4864 * Render background music field on Advanced Controls section
4865 *
4866 * @param mixed $name
4867 * @param mixed $val
4868 *
4869 * @return void
4870 * @since 8.0.0
4871 */
4872 public static function render_vrscene_navigation_option_field($name, $val)
4873 {
4874 extract($val);
4875 ob_start();
4876 ?>
4877 <div class="wpvr-scene-navigation-content" style="display:none">
4878 <?php
4879 foreach($inner_fields as $name => $val) {
4880 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
4881 }
4882 ?>
4883 </div>
4884 <?php
4885 ob_end_flush();
4886 }
4887
4888
4889 /**
4890 * Render checkbox for advanced control pro version meta fields
4891 *
4892 * @param mixed $name
4893 * @param mixed $val
4894 *
4895 * @return void
4896 * @since 8.0.0
4897 */
4898 public static function render_pro_radio_field($name, $val)
4899 {
4900 extract($val);
4901 ob_start();
4902 ?>
4903 <div class="<?php echo esc_attr( $class ); ?>">
4904 <span><?php echo esc_html( $title ); ?></span>
4905
4906 <span class="wpvr-switchers">
4907 <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 ); ?> />
4908 <label for="<?php echo esc_attr( $id ); ?>" class="custom-radio-label"></label>
4909 </span>
4910
4911 <?php if(!empty($have_tooltip)) { ?>
4912 <div class="field-tooltip">
4913 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4914 <span><?php echo esc_html( $tooltip_text ); ?></span>
4915 </div>
4916 <?php } ?>
4917 </div>
4918 <?php
4919 ob_end_flush();
4920 }
4921
4922
4923 /**
4924 * Render Hotspot Scene Select Field
4925 * @param mixed $name input field name
4926 * @param mixed $val options
4927 *
4928 * @return void
4929 */
4930 public static function render_animation_name_select($name, $val)
4931 {
4932 extract($val);
4933 ob_start();
4934 $default_type = apply_filters('wpvr_scene_animation', array(
4935 'none' => __('None', 'wpvr'),
4936 'circle_crop' => __('Circle Crop', 'wpvr'),
4937
4938 'zoom_in' => __('Zoom In', 'wpvr'),
4939 'zoom_in_up' => __('Zoom In Up', 'wpvr'),
4940 'zoom_in_down' => __('Zoom In Down', 'wpvr'),
4941 'zoom_in_left' => __('Zoom In Left', 'wpvr'),
4942 'zoom_in_right' => __('Zoom In Right', 'wpvr'),
4943
4944 'slide_in_up' => __('Slide In Up', 'wpvr'),
4945 'slide_in_down' => __('Slide In Down', 'wpvr'),
4946 'slide_in_left' => __('Slide In Left', 'wpvr'),
4947 'slide_in_right' => __('Slide In Right', 'wpvr'),
4948
4949 'fade_blur' => __('Fade With Blur', 'wpvr'),
4950 'fade_in' => __('Fade In', 'wpvr'),
4951 'fade_in_up' => __('Fade In Up', 'wpvr'),
4952 'fade_in_down' => __('Fade In Down', 'wpvr'),
4953 'fade_in_left' => __('Fade In Left', 'wpvr'),
4954 'fade_in_right' => __('Fade In Right', 'wpvr'),
4955 'fade_in_top_left' => __('Fade In Top Left', 'wpvr'),
4956 'fade_in_top_right' => __('Fade In Top Right', 'wpvr'),
4957 'fade_in_bottom_left' => __('Fade In Bottom Left', 'wpvr'),
4958 'fade_in_bottom_right' => __('Fade In Bottom Right', 'wpvr'),
4959
4960 'back_in_left' => __('Back In Left', 'wpvr'),
4961 'back_in_right' => __('Back In Right', 'wpvr'),
4962 'back_in_up' => __('Back In Up', 'wpvr'),
4963 'back_in_down' => __('Back In Down', 'wpvr'),
4964
4965 'bounce_in' => __('Bounce In', 'wpvr'),
4966 'bounce_in_up' => __('Bounce In Up', 'wpvr'),
4967 'bounce_in_down' => __('Bounce In Down', 'wpvr'),
4968 'bounce_in_left' => __('Bounce In Left', 'wpvr'),
4969 'bounce_in_right' => __('Bounce In Right', 'wpvr'),
4970
4971 'flip' => __('Flip', 'wpvr'),
4972 'flip_x' => __('Flip X', 'wpvr'),
4973 'flip_y' => __('Flip Y', 'wpvr'),
4974
4975 'light_speed_in_left' => __('Light Speed In Left', 'wpvr'),
4976 'light_speed_in_right' => __('Light Speed In Right', 'wpvr'),
4977
4978 'rotate_in' => __('Rotate In', 'wpvr'),
4979 'rotate_in_up_left' => __('Rotate In Up Left', 'wpvr'),
4980 'rotate_in_up_right' => __('Rotate In Up Right', 'wpvr'),
4981 'rotate_in_down_left' => __('Rotate In Down Left', 'wpvr'),
4982 'rotate_in_down_right' => __('Rotate In Down Right', 'wpvr'),
4983
4984 ));
4985
4986 ?>
4987
4988 <div class='single-settings'>
4989
4990 <div class="wpvr-tooltip-area">
4991 <span for="scene-animation-name"><?php echo esc_html( $title ) . ': '; ?></span>
4992 <?php if(!empty($have_tooltip)) { ?>
4993 <div class="field-tooltip">
4994 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4995
4996 <span>
4997 <?php
4998 // Ensure tooltip_text text is set
4999 if (!empty($tooltip_text['text'])) {
5000 echo esc_html($tooltip_text['text']);
5001
5002 // Check if URL exists before rendering the link
5003 if (!empty($tooltip_text['url'])) {
5004 printf(
5005 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5006 esc_url($tooltip_text['url']),
5007 esc_html__( 'View Doc', 'wpvr' )
5008 );
5009 }
5010 }
5011 ?>
5012 </span>
5013 </div>
5014 <?php } ?>
5015 </div>
5016
5017 <select class='scene-animation-name' name="<?php echo esc_attr( $name ); ?>">
5018 <?php
5019 foreach ($default_type as $key => $type) {
5020 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $value, true), esc_attr($key), esc_attr($type));
5021 } ?>
5022 </select>
5023 </div>
5024
5025 <?php
5026 ob_end_flush();
5027 }
5028
5029
5030 public static function render_membership_access_name_select($name, $val)
5031 {
5032 extract($val);
5033 ob_start(); // Start output buffering
5034
5035 $membership_access_control_types = apply_filters('get_membership_access_control_types', array(
5036 'none' => __('All Membership Levels', 'wpvr'),
5037 ));
5038 ?>
5039
5040 <div class='single-settings'>
5041
5042 <div class="wpvr-tooltip-area">
5043 <span for="membership-access-name"><?php echo esc_html( $title ) . ': '; ?></span>
5044 <?php if(!empty($have_tooltip)) { ?>
5045 <div class="field-tooltip">
5046 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5047
5048 <span>
5049 <?php
5050 // Ensure tooltip_text text is set
5051 if (!empty($tooltip_text['text'])) {
5052 echo esc_html($tooltip_text['text']);
5053
5054 // Check if URL exists before rendering the link
5055 if (!empty($tooltip_text['url'])) {
5056 printf(
5057 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5058 esc_url($tooltip_text['url']),
5059 esc_html__( 'View Doc', 'wpvr' )
5060 );
5061 }
5062 }
5063 ?>
5064 </span>
5065 </div>
5066 <?php } ?>
5067 </div>
5068
5069 <select class=<?php echo esc_attr($val['class']) ?> id="<?php echo esc_attr($val['id']) ?>" name="<?php echo esc_attr($name); ?>">
5070 <?php
5071 foreach ($membership_access_control_types as $key => $type) {
5072 echo sprintf(
5073 "<option %s value='%s'>%s</option>\n",
5074 selected($key, $value, false),
5075 esc_attr($key),
5076 esc_html($type)
5077 );
5078 }
5079 ?>
5080 </select>
5081 </div>
5082
5083 <?php
5084 ob_end_flush();
5085 }
5086
5087 /**
5088 * Render other fields
5089 *
5090 * @param mixed $postdata
5091 *
5092 * @return void
5093 * @since 8.5.27
5094 */
5095 public static function render_other_fields($postdata){
5096 ?>
5097 <?php WPVR_Meta_Field::render_basic_setting_generic_form_fields($postdata);?>
5098 <div class="generic-form-associates">
5099 <?php WPVR_Meta_Field::render_generic_form_associate_fields($postdata) ;?>
5100 </div>
5101
5102 <?php WPVR_Meta_Field::render_basic_setting_call_to_action_fields($postdata);?>
5103 <div class="call-to-action">
5104 <?php WPVR_Meta_Field::render_call_to_action_associate_fields($postdata) ;?>
5105 </div>
5106
5107 <?php WPVR_Meta_Field::render_basic_setting_custom_css_fields($postdata);?>
5108 <div class="custom-css-field">
5109 <?php WPVR_Meta_Field::render_custom_css_associate_fields($postdata) ;?>
5110 </div>
5111 <?php
5112 }
5113
5114
5115 /**
5116 * Renders a checkbox field for keyboard control settings in the advanced settings section
5117 *
5118 * This method renders a checkbox with an optional tooltip. If the checkbox ID is 'wpvr_diskeyboard',
5119 * it also renders additional keyboard control settings.
5120 *
5121 * @param string $name The name attribute for the checkbox input field
5122 * @param array $val Array of field attributes including:
5123 * - class: CSS class for the wrapper div
5124 * - id: HTML ID for the checkbox input
5125 * - title: Text to display as the field label
5126 * - value: Current value of the checkbox ('on' or 'off')
5127 * - have_tooltip: Whether to show tooltip
5128 * - tooltip_text: Array with 'text' and optional 'url' for tooltip content
5129 * @param array $postdata The post data for rendering additional fields
5130 *
5131 * @return void Outputs HTML directly
5132 * @since 8.5.27
5133 */
5134 public static function render_advanced_setting_checkbox_for_mouse_dragg_control_field($name, $val, $postdata)
5135 {
5136 extract( $val );
5137 ob_start();
5138 ?>
5139 <div class="<?php echo esc_attr( $class ); ?>">
5140
5141 <div class="wpvr-tooltip-area">
5142 <span><?php echo esc_html( $title ) . ': '; ?></span>
5143
5144 <?php if(!empty($have_tooltip)) { ?>
5145 <div class="field-tooltip">
5146 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5147
5148 <span>
5149 <?php
5150 // Ensure tooltip_text text is set
5151 if (!empty($tooltip_text['text'])) {
5152 echo esc_html($tooltip_text['text']);
5153
5154 // Check if URL exists before rendering the link
5155 if (!empty($tooltip_text['url'])) {
5156 printf(
5157 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5158 esc_url($tooltip_text['url']),
5159 esc_html__( 'View Doc', 'wpvr' )
5160 );
5161 }
5162 }
5163 ?>
5164 </span>
5165 </div>
5166 <?php } ?>
5167
5168 </div>
5169
5170 <span class="wpvr-switcher">
5171 <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'; } ?> />
5172 <label for="<?php echo esc_attr( $id ); ?>"></label>
5173 </span>
5174 </div>
5175 <?php if(isset($val['id']) && $val['id'] === 'wpvr_draggable') { ?>
5176 <div class="mouse-dragable-control-settings-wrapper">
5177 <?php WPVR_Meta_Field::render_mouse_dragable_control_data_wrapper_fields($postdata) ;?>
5178 </div>
5179 <?php } ?>
5180 <?php
5181 ob_end_flush();
5182 }
5183
5184 /**
5185 * Renders keyboard control related fields wrapped in a container
5186 *
5187 * This method fetches keyboard control fields using get_keyboard_control_data_wrapper_fields method
5188 * and renders each field using the appropriate rendering method based on field type.
5189 * Each field is rendered with an icon using the render_[field_type]_with_icon method.
5190 *
5191 * @param array $postdata Post data containing field values and configurations
5192 *
5193 * @return void Outputs HTML directly
5194 * @since 8.5.27
5195 */
5196 public static function render_mouse_dragable_control_data_wrapper_fields($postdata)
5197 {
5198 $fields = self::get_mouse_dragable_control_data_wrapper_fields($postdata);
5199 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5200 foreach($fields as $name => $val) {
5201 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5202 }
5203 }
5204
5205 /**
5206 * Get keyboard control data wrapper fields
5207 *
5208 * Retrieves the fields related to keyboard control settings by applying a filter.
5209 * This function is used to gather all the keyboard control options that can be modified.
5210 *
5211 * @param array $postdata The post data containing the current settings
5212 *
5213 * @return array Filtered array of keyboard control fields and their settings
5214 * @since 8.5.27
5215 */
5216 public static function get_mouse_dragable_control_data_wrapper_fields($postdata){
5217 return apply_filters('update_mouse_dragable_control_options', $postdata);
5218 }
5219
5220
5221 /**
5222 * Render Advanced Keyboard Zoom Control Field
5223 *
5224 * This function renders a checkbox toggle for keyboard zoom control with tooltip and
5225 * additional settings when enabled.
5226 *
5227 * @param string $name The name attribute for the input field
5228 * @param array $val Array of values containing field attributes and settings
5229 * @param array $postdata Post data containing all panorama settings
5230 *
5231 * @return void Outputs HTML for the keyboard zoom control field
5232 * @since 8.5.27
5233 */
5234 public static function render_advanced_mouse_zoom_control_field($name, $val, $postdata)
5235 {
5236 extract( $val );
5237 ob_start();
5238 ?>
5239 <div class="<?php echo esc_attr( $class ); ?>">
5240
5241 <div class="wpvr-tooltip-area">
5242 <span><?php echo esc_html( $title ) . ': '; ?></span>
5243
5244 <?php if(!empty($have_tooltip)) { ?>
5245 <div class="field-tooltip">
5246 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5247
5248 <span>
5249 <?php
5250 // Ensure tooltip_text text is set
5251 if (!empty($tooltip_text['text'])) {
5252 echo esc_html($tooltip_text['text']);
5253
5254 // Check if URL exists before rendering the link
5255 if (!empty($tooltip_text['url'])) {
5256 printf(
5257 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5258 esc_url($tooltip_text['url']),
5259 esc_html__( 'View Doc', 'wpvr' )
5260 );
5261 }
5262 }
5263 ?>
5264 </span>
5265 </div>
5266 <?php } ?>
5267
5268 </div>
5269
5270 <span class="wpvr-switcher">
5271 <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'; } ?> />
5272 <label for="<?php echo esc_attr( $id ); ?>"></label>
5273 </span>
5274
5275
5276 </div>
5277 <?php if(isset($val['id']) && $val['id'] === 'wpvr_mouseZoom') { ?>
5278 <div class="mouse-zoom-control-settings-wrapper">
5279 <?php WPVR_Meta_Field::render_mouse_zoom_control_data_wrapper_fields($postdata) ;?>
5280 </div>
5281 <?php } ?>
5282 <?php
5283 ob_end_flush();
5284 }
5285
5286 /**
5287 * Render Advanced Keyboard Zoom Control Field
5288 *
5289 * This method renders a toggle switch for controlling keyboard zoom functionality in the VR panorama.
5290 * When enabled, it displays additional keyboard zoom control settings through the
5291 * render_keyboard_zoom_control_data_wrapper_fields method.
5292 *
5293 * @param string $name The HTML name attribute for the input field
5294 * @param array $val Array containing field configuration values including:
5295 * - class: CSS class for the field wrapper
5296 * - id: HTML ID for the input element
5297 * - title: Display title for the field
5298 * - value: Current value of the field ('on' or 'off')
5299 * - have_tooltip: Whether field has tooltip
5300 * - tooltip_text: Array with tooltip text and URL
5301 * @param array $postdata Complete panorama post data containing all settings
5302 *
5303 * @return void Outputs HTML for the keyboard zoom control field and its settings
5304 * @since 8.5.27
5305 */
5306 public static function render_mouse_zoom_control_data_wrapper_fields($postdata)
5307 {
5308 $fields = self::get_render_mouse_zoom_control_data_wrapper_fields_fields($postdata);
5309 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5310 foreach($fields as $name => $val) {
5311 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5312 }
5313 }
5314
5315 /**
5316 * Get keyboard zoom control fields configuration
5317 *
5318 * Retrieves the fields configuration for keyboard zoom control settings by applying
5319 * the 'updated_key_board_zoom_control_options' filter to the panorama post data.
5320 *
5321 * @param array $postdata The post data containing all panorama settings
5322 *
5323 * @return array An array of keyboard zoom control field configurations
5324 * @since 8.5.27
5325 */
5326 public static function get_render_mouse_zoom_control_data_wrapper_fields_fields($postdata)
5327 {
5328 return apply_filters('updated_mouse_zoom_control_options', $postdata);
5329 }
5330
5331 /**
5332 * Render Advanced Gyroscope Control Field
5333 *
5334 * This method renders a toggle switch for enabling/disabling gyroscope controls in VR panoramas.
5335 * When enabled, it displays additional gyroscope-specific settings through the
5336 * render_wpvr_gyro_data_wrapper_fields method.
5337 *
5338 * @param string $name The HTML name attribute for the input field
5339 * @param array $val Array of field configuration values including:
5340 * - class: CSS class for the field wrapper
5341 * - id: HTML ID for the input element
5342 * - title: Display title for the field
5343 * - value: Current value of the field ('on' or 'off')
5344 * - have_tooltip: Whether field has tooltip
5345 * - tooltip_text: Array with tooltip text and URL
5346 * @param array $postdata Complete panorama post data containing all settings
5347 *
5348 * @return void Outputs HTML for the gyroscope control field and its settings
5349 * @since 8.5.27
5350 */
5351 public static function render_advanced_gyro_control_field($name, $val, $postdata)
5352 {
5353 extract( $val );
5354 ob_start();
5355 ?>
5356 <div class="<?php echo esc_attr( $class ); ?>">
5357
5358 <div class="wpvr-tooltip-area">
5359 <span><?php echo esc_html( $title ) . ': '; ?></span>
5360
5361 <?php if(!empty($have_tooltip)) { ?>
5362 <div class="field-tooltip">
5363 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5364
5365 <span>
5366 <?php
5367 // Ensure tooltip_text text is set
5368 if (!empty($tooltip_text['text'])) {
5369 echo esc_html($tooltip_text['text']);
5370
5371 // Check if URL exists before rendering the link
5372 if (!empty($tooltip_text['url'])) {
5373 printf(
5374 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5375 esc_url($tooltip_text['url']),
5376 esc_html__( 'View Doc', 'wpvr' )
5377 );
5378 }
5379 }
5380 ?>
5381 </span>
5382 </div>
5383 <?php } ?>
5384
5385 </div>
5386
5387 <span class="wpvr-switcher">
5388 <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'; } ?> />
5389 <label for="<?php echo esc_attr( $id ); ?>"></label>
5390 </span>
5391
5392
5393 </div>
5394 <?php if(isset($val['id']) && $val['id'] === 'wpvr_gyro') { ?>
5395 <div class="zyro-settings-wrapper">
5396 <?php WPVR_Meta_Field::render_wpvr_gyro_data_wrapper_fields($postdata) ;?>
5397 </div>
5398 <?php } ?>
5399 <?php
5400 ob_end_flush();
5401 }
5402
5403 /**
5404 * Renders gyroscope control settings fields
5405 *
5406 * This method fetches the gyroscope control configuration fields using
5407 * get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields and renders each field
5408 * using the appropriate render method based on the field type.
5409 *
5410 * @param array $postdata The post data containing all panorama settings
5411 *
5412 * @return void Outputs HTML for the gyroscope control settings fields
5413 * @since 8.5.27
5414 */
5415 public static function render_wpvr_gyro_data_wrapper_fields($postdata)
5416 {
5417 $fields = self::get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields($postdata);
5418 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5419 foreach($fields as $name => $val) {
5420 if('pro_checkbox' === $val['type']){
5421 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5422 }else{
5423 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5424 }
5425
5426 }
5427 }
5428
5429 /**
5430 * Get gyroscope control fields configuration data
5431 *
5432 * Retrieves the fields configuration for gyroscope control settings by applying
5433 * the 'updated_gyro_control_options' filter to the panorama post data.
5434 *
5435 * @param array $postdata The post data containing all panorama settings
5436 *
5437 * @return array An array of gyroscope control field configurations
5438 * @since 8.5.27
5439 */
5440 public static function get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields($postdata)
5441 {
5442 return apply_filters('updated_gyro_control_options', $postdata);
5443 }
5444
5445 /**
5446 * Render Advanced Scene Gallery Control Field
5447 *
5448 * This method renders a toggle switch for enabling/disabling scene gallery in VR panoramas.
5449 * When enabled, it displays additional scene gallery settings through the
5450 * render_wpvr_scene_gallery_data_wrapper_fields method.
5451 *
5452 * @param string $name The HTML name attribute for the input field
5453 * @param array $val Array of field configuration values including:
5454 * - class: CSS class for the field wrapper
5455 * - id: HTML ID for the input element
5456 * - title: Display title for the field
5457 * - value: Current value of the field ('on' or 'off')
5458 * - have_tooltip: Whether field has tooltip
5459 * - tooltip_text: Array with tooltip text and URL
5460 * @param array $postdata Complete panorama post data containing all settings
5461 *
5462 * @return void Outputs HTML for the scene gallery control field and its settings
5463 * @since 8.5.27
5464 */
5465 public static function render_advanced_setting_scene_gallery_field($name, $val, $postdata)
5466 {
5467 extract( $val );
5468 ob_start();
5469 ?>
5470 <div class="<?php echo esc_attr( $class ); ?>">
5471
5472 <div class="wpvr-tooltip-area">
5473 <span><?php echo esc_html( $title ) . ': '; ?></span>
5474 <?php if(!empty($have_tooltip)) { ?>
5475 <div class="field-tooltip">
5476 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5477
5478 <span>
5479 <?php
5480 // Ensure tooltip_text text is set
5481 if (!empty($tooltip_text['text'])) {
5482 echo esc_html($tooltip_text['text']);
5483
5484 // Check if URL exists before rendering the link
5485 if (!empty($tooltip_text['url'])) {
5486 printf(
5487 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5488 esc_url($tooltip_text['url']),
5489 esc_html__( 'View Doc', 'wpvr' )
5490 );
5491 }
5492 }
5493 ?>
5494 </span>
5495 </div>
5496 <?php } ?>
5497 </div>
5498
5499 <span class="wpvr-switcher">
5500 <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'; } ?> />
5501 <label for="<?php echo esc_attr( $id ); ?>"></label>
5502 </span>
5503
5504
5505 </div>
5506 <?php if(isset($val['id']) && $val['id'] === 'wpvr_vrgallery') { ?>
5507 <div class="scene-gallery-settings-wrapper">
5508 <?php WPVR_Meta_Field::render_wpvr_scene_gallery_data_wrapper_fields($postdata) ;?>
5509 </div>
5510 <?php } ?>
5511 <?php
5512 ob_end_flush();
5513 }
5514
5515 /**
5516 * Renders scene gallery control settings fields
5517 *
5518 * This method retrieves the scene gallery configuration fields and renders each field
5519 * using the appropriate render method based on the field type.
5520 *
5521 * @param array $postdata The complete panorama post data containing all settings
5522 *
5523 * @return void Outputs HTML for the scene gallery settings fields
5524 * @since 8.5.27
5525 */
5526 public static function render_wpvr_scene_gallery_data_wrapper_fields($postdata)
5527 {
5528 $fields = self::get_render_wpvr_scene_gallery_data_wrapper_fields($postdata);
5529 foreach($fields as $name => $val) {
5530 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5531 }
5532 }
5533
5534 /**
5535 * Get scene gallery control fields configuration
5536 *
5537 * Retrieves the fields configuration for scene gallery settings by applying
5538 * the 'updated_scene_gallery_control_options' filter to the panorama post data.
5539 *
5540 * @param array $postdata The post data containing all panorama settings
5541 *
5542 * @return array An array of scene gallery control field configurations
5543 * @since 8.5.27
5544 */
5545 public static function get_render_wpvr_scene_gallery_data_wrapper_fields($postdata)
5546 {
5547 return apply_filters('updated_scene_gallery_control_options', $postdata);
5548 }
5549
5550 /**
5551 * Render Advanced Explainer Video Control Field
5552 *
5553 * This method renders a toggle switch for enabling/disabling explainer video in VR panoramas.
5554 * When enabled, it displays additional explainer video settings through the
5555 * render_advanced_setting_explainer_video_data_wrapper_fields method.
5556 *
5557 * @param string $name The HTML name attribute for the input field
5558 * @param array $val Array of field configuration values including:
5559 * - class: CSS class for the field wrapper
5560 * - id: HTML ID for the input element
5561 * - title: Display title for the field
5562 * - value: Current value of the field ('on' or 'off')
5563 * - have_tooltip: Whether field has tooltip
5564 * - tooltip_text: Array with tooltip text and URL
5565 * @param array $postdata Complete panorama post data containing all settings
5566 *
5567 * @return void Outputs HTML for the explainer video control field and its settings
5568 * @since 8.5.27
5569 */
5570 public static function render_advanced_setting_explainer_video_field($name, $val, $postdata)
5571 {
5572 extract( $val );
5573 ob_start();
5574 ?>
5575 <div class="<?php echo esc_attr( $class ); ?>">
5576
5577 <div class="wpvr-tooltip-area">
5578 <span><?php echo esc_html( $title ) . ': '; ?></span>
5579
5580 <?php if(!empty($have_tooltip)) { ?>
5581 <div class="field-tooltip">
5582 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5583
5584 <span>
5585 <?php
5586 // Ensure tooltip_text text is set
5587 if (!empty($tooltip_text['text'])) {
5588 echo esc_html($tooltip_text['text']);
5589
5590 // Check if URL exists before rendering the link
5591 if (!empty($tooltip_text['url'])) {
5592 printf(
5593 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5594 esc_url($tooltip_text['url']),
5595 esc_html__( 'View Doc', 'wpvr' )
5596 );
5597 }
5598 }
5599 ?>
5600 </span>
5601 </div>
5602 <?php } ?>
5603
5604 </div>
5605
5606 <span class="wpvr-switcher">
5607 <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'; } ?> />
5608 <label for="<?php echo esc_attr( $id ); ?>"></label>
5609 </span>
5610
5611
5612
5613 </div>
5614 <?php if(isset($val['id']) && $val['id'] === 'wpvr_explainerSwitch') { ?>
5615 <div class="explainer-video-settings-wrapper">
5616 <?php WPVR_Meta_Field::render_advanced_setting_explainer_video_data_wrapper_fields($postdata) ;?>
5617 </div>
5618 <?php } ?>
5619 <?php
5620 ob_end_flush();
5621 }
5622
5623 /**
5624 * Renders explainer video control settings fields
5625 *
5626 * This method retrieves the explainer video configuration fields and renders each field
5627 * using the appropriate render method based on the field type.
5628 *
5629 * @param array $postdata The complete panorama post data containing all settings
5630 *
5631 * @return void Outputs HTML for the explainer video settings fields
5632 * @since 8.5.27
5633 */
5634 public static function render_advanced_setting_explainer_video_data_wrapper_fields($postdata)
5635 {
5636 $fields = self::get_render_advanced_setting_explainer_video_data_wrapper_fields($postdata);
5637 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5638 foreach($fields as $name => $val) {
5639 if('pro_checkbox' == $val['type']){
5640 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5641 }else{
5642 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5643 }
5644 }
5645 }
5646
5647 /**
5648 * Get explainer video control fields configuration
5649 *
5650 * Retrieves the fields configuration for explainer video settings by applying
5651 * the 'updated_explainer_video_control_options' filter to the panorama post data.
5652 *
5653 * @param array $postdata The post data containing all panorama settings
5654 *
5655 * @return array An array of explainer video control field configurations
5656 * @since 8.5.27
5657 */
5658 public static function get_render_advanced_setting_explainer_video_data_wrapper_fields($postdata)
5659 {
5660 return apply_filters('updated_explainer_video_control_options', $postdata);
5661 }
5662
5663 /**
5664 * Render Advanced Set Zoom Preference Control Field
5665 *
5666 * This method renders a toggle switch for enabling/disabling zoom preference in VR panoramas.
5667 * When enabled, it displays additional zoom preference settings through the
5668 * render_wpvr_set_zoom_control_data_wrapper_fields method.
5669 *
5670 * @param string $name The HTML name attribute for the input field
5671 * @param array $val Array of field configuration values including:
5672 * - class: CSS class for the field wrapper
5673 * - id: HTML ID for the input element
5674 * - title: Display title for the field
5675 * - value: Current value of the field ('on' or 'off')
5676 * - have_tooltip: Whether field has tooltip
5677 * - tooltip_text: Array with tooltip text and URL
5678 * @param array $postdata Complete panorama post data containing all settings
5679 *
5680 * @return void Outputs HTML for the set zoom preference control field and its settings
5681 * @since 8.5.27
5682 */
5683 public static function render_advanced_setting_set_zoom_preference_field($name, $val, $postdata)
5684 {
5685 extract( $val );
5686 ob_start();
5687 ?>
5688 <div class="<?php echo esc_attr( $class ); ?>">
5689 <div class="wpvr-tooltip-area">
5690 <span><?php echo esc_html( $title ) . ': '; ?></span>
5691
5692 <?php if(!empty($have_tooltip)) { ?>
5693 <div class="field-tooltip">
5694 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5695
5696 <span>
5697 <?php
5698 // Ensure tooltip_text text is set
5699 if (!empty($tooltip_text['text'])) {
5700 echo esc_html($tooltip_text['text']);
5701
5702 // Check if URL exists before rendering the link
5703 if (!empty($tooltip_text['url'])) {
5704 printf(
5705 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5706 esc_url($tooltip_text['url']),
5707 esc_html__( 'View Doc', 'wpvr' )
5708 );
5709 }
5710 }
5711 ?>
5712 </span>
5713 </div>
5714 <?php } ?>
5715
5716
5717 </div>
5718
5719 <span class="wpvr-switcher">
5720 <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'; } ?> />
5721 <label for="<?php echo esc_attr( $id ); ?>"></label>
5722 </span>
5723
5724
5725 </div>
5726 <?php if(isset($val['id']) && $val['id'] === 'wpvr_globalzoom') { ?>
5727 <div class="set-zoom-perference-control-settings-wrapper">
5728 <?php WPVR_Meta_Field::render_wpvr_set_zoom_control_data_wrapper_fields($postdata) ;?>
5729 </div>
5730 <?php } ?>
5731 <?php
5732 ob_end_flush();
5733 }
5734
5735 /**
5736 * Renders set zoom preference control settings fields
5737 *
5738 * This method retrieves the set zoom preference configuration fields and renders each field
5739 * using the appropriate render method based on the field type.
5740 *
5741 * @param array $postdata The complete panorama post data containing all settings
5742 *
5743 * @return void Outputs HTML for the set zoom preference settings fields
5744 * @since 8.5.27
5745 */
5746 public static function render_wpvr_set_zoom_control_data_wrapper_fields($postdata)
5747 {
5748 $fields = self::get_render_wpvr_set_zoom_control_data_wrapper_fields($postdata);
5749 foreach($fields as $name => $val) {
5750 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5751 }
5752 }
5753
5754 /**
5755 * Get set zoom preference control fields configuration
5756 *
5757 * Retrieves the fields configuration for set zoom preference settings by applying
5758 * the 'updated_set_zoom_preference_control_options' filter to the panorama post data.
5759 *
5760 * @param array $postdata The post data containing all panorama settings
5761 *
5762 * @return array An array of set zoom preference control field configurations
5763 * @since 8.5.27
5764 */
5765 public static function get_render_wpvr_set_zoom_control_data_wrapper_fields($postdata)
5766 {
5767 return apply_filters('updated_zoom_control_options', $postdata);
5768 }
5769
5770 /**
5771 * Render Pro Inner Scene Gallery Icon Size Field
5772 *
5773 * This method renders a toggle switch for enabling/disabling the large/small icon size for the inner scene gallery.
5774 *
5775 * @param string $name The HTML name attribute for the input field
5776 * @param array $val Array of field configuration values including:
5777 * - class: CSS class for the field wrapper
5778 * - id: HTML ID for the input element
5779 * - title: Display title for the field
5780 * - value: Current value of the field ('on' or 'off')
5781 * - have_tooltip: Whether field has tooltip
5782 * - tooltip_text: Array with tooltip text and URL
5783 *
5784 * @return void Outputs HTML for the pro inner scene gallery icon size field
5785 * @since 8.5.27
5786 */
5787 public static function render_pro_inner_scene_gallery_icon_size_field($name, $val){
5788 extract($val);
5789 ob_start();
5790 $default_type = array(
5791 'on' => __('Large', 'wpvr'),
5792 'off' => __('Small', 'wpvr'),
5793 );
5794 ?>
5795
5796 <div class='single-settings'>
5797 <div class="wpvr-tooltip-area">
5798 <span for="scene-gallery-icon-size-name"><?php echo esc_html( $title ) . ': '; ?></span>
5799 <?php if(!empty($have_tooltip)) { ?>
5800 <div class="field-tooltip">
5801 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5802
5803 <span>
5804 <?php
5805 // Ensure tooltip_text text is set
5806 if (!empty($tooltip_text['text'])) {
5807 echo esc_html($tooltip_text['text']);
5808
5809 // Check if URL exists before rendering the link
5810 if (!empty($tooltip_text['url'])) {
5811 printf(
5812 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5813 esc_url($tooltip_text['url']),
5814 esc_html__( 'View Doc', 'wpvr' )
5815 );
5816 }
5817 }
5818 ?>
5819 </span>
5820 </div>
5821 <?php } ?>
5822 </div>
5823
5824 <select class='scene-gallery-icon-size-name' name="<?php echo esc_attr( $name ); ?>">
5825 <?php
5826 foreach ($default_type as $key => $type) {
5827 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $value, true), esc_attr($key), esc_attr($type));
5828 } ?>
5829 </select>
5830 </div>
5831
5832 <?php
5833 ob_end_flush();
5834 }
5835
5836 }
5837