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

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

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