PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.2.0
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.2.0
9.2.0 9.1.4 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 All 224 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.2.0, at legacy/admin/classes/class-wpvr-meta-field.php

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