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

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

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