PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 8.5.70
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v8.5.70
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.70, at admin/classes/class-wpvr-meta-field.php

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