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

5,760 lines 234.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if (!defined('ABSPATH')) exit;
4
5 /**
6 * Responsible for managing WPVR meta fields
7 *
8 * @link http://rextheme.com/
9 * @since 8.0.0
10 *
11 * @package Wpvr
12 * @subpackage Wpvr/admin/classes
13 */
14
15
16 class WPVR_Meta_Field {
17
18 /**
19 * Constructor.
20 */
21 public function __construct(){
22
23 }
24
25 /**
26 * Initialize primary meta fields for a Tour
27 *
28 * @return array
29 * @since 8.0.0
30 */
31 public static function get_primary_meta_fields()
32 {
33 $meta_fields = array(
34 'panoid' => null,
35 'autoLoad' => 1,
36 'hfov' => null,
37 'maxHfov' => null,
38 'minHfov' => null,
39 'showControls' => 1,
40 'customcontrol' => null,
41 'preview' => null,
42 'defaultscene' => null,
43 'scenefadeduration' => null,
44 'panodata' => array(
45 'scene-list' => array(
46 array(
47 'scene-id' => null,
48 'scene-type' => 'equirectangular',
49 'hotspot-list' => array(
50 array(
51 'hotspot-title' => null,
52 'hotspot-pitch' => null,
53 'hotspot-yaw' => null,
54 'hotspot-customclass' => null,
55 'hotspot-scene' => null,
56 'hotspot-url' => null,
57 'hotspot-content' => null,
58 'hotspot-hover' => null,
59 'hotspot-type' => 'info',
60 'hotspot-scene-list' => 'none',
61 'wpvr_url_open' => array(
62 0 => 'off'
63 )
64 ),
65 ),
66 'dscene' => 'off',
67 'scene-attachment-url' => null,
68 ),
69 ),
70 ),
71 'previewtext' => 'Click To Load Panorama',
72 );
73 return apply_filters( 'wpvr_extend_primary_meta_fields', $meta_fields );
74 }
75
76
77 /**
78 * Initialise Tab Navigation Items
79 * @return array
80 * @since 8.0.0
81 */
82 public static function get_navigation_fields() {
83 $status = get_option('wpvr_edd_license_status', '');
84 $is_pro_active = (is_plugin_active('wpvr-pro/wpvr-pro.php') && 'valid' === $status);
85 $fields = array(
86 array(
87 'class' => 'scene',
88 'screen' => 'scene',
89 'href' => 'scenes',
90 'r_src' => 'admin/icon/scenes-regular.png',
91 'h_src' => 'admin/icon/scenes-hover.png',
92 'title' => __('Scenes','wpvr'),
93 'active' => 'active'
94 ),
95 array(
96 'class' => 'hotspot',
97 'screen' => 'hotspot',
98 'href' => 'scenes',
99 'r_src' => 'admin/icon/hotspot-regular.png',
100 'h_src' => 'admin/icon/hotspot-hover.png',
101 'title' => __('Hotspot','wpvr'),
102 'active' => ''
103 ),
104 array(
105 'class' => 'general',
106 'screen' => 'general',
107 'href' => 'general',
108 'r_src' => 'admin/icon/general-regular.png',
109 'h_src' => 'admin/icon/general-hover.png',
110 'title' => __('Settings','wpvr'),
111 'active' => ''
112 ),
113 array(
114 'class' => 'videos',
115 'screen' => 'video',
116 'href' => 'video',
117 'r_src' => 'admin/icon/video-regular.png',
118 'h_src' => 'admin/icon/video-hover.png',
119 'title' => __('Video','wpvr'),
120 'active' => ''
121 ),
122 );
123 return $is_pro_active ? apply_filters( 'wpvr_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( 'wpvr_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); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
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); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
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); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
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 esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/wpvr-logo.svg' ); ?>" alt="logo" /></li>
741
742 <?php foreach($fields as $field) { ?>
743
744 <li class="<?php echo esc_attr( $field['class'] . ' ' . $field['active'] ); ?>" data-screen="<?php echo esc_attr( $field['screen'] ); ?>">
745 <span data-href="#<?php echo esc_attr( $field['href'] ); ?>">
746 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . $field['r_src'] ); ?>" alt="icon" class="regular" />
747 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . $field['h_src'] ); ?>" alt="icon" class="hover" />
748 <?php echo esc_html( $field['title'] ); ?> </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 esc_html__('pro', 'wpvr');?></div>
758 <span data-href="#floorPlan">
759 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/map.svg' ); ?>" alt="icon" class="regular">
760 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/map-hover.svg' ); ?>" alt="icon" class="hover">
761 <?php echo esc_html__('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 esc_html__('pro', 'wpvr');?></div>
767 <span data-href="#backgroundTour">
768 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/bg-tour-regular.png' ); ?>" alt="icon" class="regular">
769 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/bg-tour-hover.png' ); ?>" alt="icon" class="hover">
770 <?php echo esc_html__('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 esc_html__('pro', 'wpvr');?></div>
776 <span data-href="#streetview">
777 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/street-view-regular.png' ); ?>" alt="icon" class="regular">
778 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/street-view-hover.png' ); ?>" alt="icon" class="hover">
779 <?php echo esc_html__('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 esc_html__('pro', 'wpvr');?></div>
785 <span data-href="#import">
786 <img loading="lazy" src=" <?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/export-regular.png' ); ?> " alt="icon" class="regular" />
787 <img loading="lazy" src=" <?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/export-hover.png' ); ?> " alt="icon" class="hover" />
788 <?php echo esc_html__('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 esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/export-regular.png' ); ?> " alt="icon" class="regular" />
800 <img loading="lazy" src=" <?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/export-hover.png' ); ?> " alt="icon" class="hover" />
801 <?php echo esc_html__('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'),
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'),
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'),
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'),
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 esc_attr( $field['class'] . ' ' . $field['active'] ); ?>">
1612 <span data-href="#<?php echo esc_attr( $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 esc_url( WPVR_PLUGIN_DIR_URL . $field['regular_icon'] ); ?>" alt="icon" class="regular" />
1617 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . $field['hover_icon'] ); ?>" alt="icon" class="hover" />
1618 <?php echo esc_html( $field['title'] );?></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 esc_html__('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'),
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'),
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="<?php echo esc_attr( $class ); ?>">
1924 <div class="wpvr-global-tooltip-area">
1925 <label><?php echo esc_html( $title ) . ': '; ?></label>
1926 <?php if(!empty($have_tooltip)) { ?>
1927 <div class="field-tooltip">
1928 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
1942 );
1943 }
1944 }
1945 ?>
1946 </span>
1947 </div>
1948 <?php } ?>
1949 </div>
1950
1951 <select class="<?php echo esc_attr( $select_class ); ?>" name="<?php echo esc_attr( $name ); ?>">
1952 <option value="on" <?php selected( $selected, 'on' ); ?> > <?php echo esc_html__('Yes','wpvr') ?> </option>
1953 <option value="off" <?php selected( $selected, 'off' ); ?> > <?php echo esc_html__('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"><?php echo esc_html( $title ) . ': '; ?></label>
1978 <?php if(!empty($have_tooltip)) { ?>
1979 <div class="field-tooltip">
1980 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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" <?php selected( $selected, 'equirectangular' ); ?> > <?php echo esc_html__('Equirectangular','wpvr') ?></option>
2005 <option value="cubemap" <?php selected( $selected, 'cubemap' ); ?> > <?php echo esc_html__('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="<?php echo esc_attr( $label_for ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
2031
2032 <?php if(!empty($have_tooltip)) { ?>
2033 <div class="field-tooltip">
2034 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $input_class ); ?>" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php echo esc_attr( $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="<?php echo esc_attr( $label_for ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
2073
2074 <?php if(!empty($have_tooltip)) { ?>
2075 <div class="field-tooltip">
2076 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
2090 );
2091 }
2092 }
2093 ?>
2094 </span>
2095 </div>
2096 <?php } ?>
2097
2098 </div>
2099 <input type="text" class="<?php echo esc_attr( $input_class ); ?>" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $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"><?php echo esc_html( $title ) . ': '; ?></label>
2123 <?php if(!empty($have_tooltip)) { ?>
2124 <div class="field-tooltip">
2125 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_url( $value ); ?>" style="display: <?php echo esc_attr( $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="<?php echo esc_attr( $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: <?php echo esc_attr( $display ); ?>;">
2200 <div class="wpvr-global-tooltip-area">
2201 <label for="scene-upload"><?php echo esc_html__('Scene Upload:', 'wpvr')?></label>
2202
2203 <div class="field-tooltip">
2204 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
2205 <span>
2206 <?php echo esc_html__('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="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
2213 <?php echo esc_html__( '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="<?php echo esc_url( $value ); ?>" style="display: <?php echo esc_attr( $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="<?php echo esc_attr( $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: <?php echo esc_attr( $display ); ?>;">
2248 <?php
2249 foreach($cubemaps as $cubemap){ extract($cubemap) ?>
2250 <div class="<?php echo esc_attr( $class ); ?>">
2251
2252 <div class="wpvr-global-tooltip-area">
2253 <label for="scene-upload"><?php echo esc_html( $title ) ?></label>
2254 <?php if(!empty($have_tooltip)) { ?>
2255 <div class="field-tooltip">
2256 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_url( $value ); ?>" style="display: block;">
2281 <input type="button" class="scene-upload" data-info="" value="Upload"/>
2282 <input type="hidden" name="<?php echo esc_attr( $name ); ?>" class="scene-attachment-url" value="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
2310
2311 <div class="wpvr-global-tooltip-area">
2312 <span><?php echo esc_html( $title ) . ': '; ?></span>
2313 <?php if(!empty($have_tooltip)) { ?>
2314 <div class="field-tooltip">
2315 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $input_class ); ?>" id="<?php echo esc_attr( $input_id ); ?>" type="radio" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php if(empty($checked) && $value == 'off') { echo 'checked'; } ;?> <?php if(!empty($checked) && $value == 'on') { echo 'checked'; };?> >
2344 <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $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="<?php echo esc_attr( $class ); ?>">
2371 <div class="wpvr-global-tooltip-area">
2372 <span><?php echo esc_html( $title ) . ': '; ?></span>
2373 <?php if(!empty($have_tooltip)) { ?>
2374 <div class="field-tooltip">
2375 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $input_class ); ?>" id="<?php echo esc_attr( $input_id ); ?>" type="radio" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php if(($checked == 'off' || empty($checked)) && $value == 'off') { echo 'checked'; } ;?> <?php if($checked == 'on' && $value == 'on') { echo 'checked'; };?> >
2402 <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $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="<?php echo esc_attr( $class ); ?>" style="display:none;">
2427
2428 <div class="wpvr-global-tooltip-area">
2429 <span><?php echo esc_html( $title ) . ': '; ?></span>
2430 <?php if(!empty($have_tooltip)) { ?>
2431 <div class="field-tooltip">
2432 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $placeholder ); ?>" name="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $input_class ); ?>" value="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
2482
2483 <div class="wpvr-tooltip-area">
2484 <span><?php echo esc_html( $title ) . ': '; ?></span>
2485
2486 <?php if(!empty($have_tooltip)) {?>
2487
2488 <div class="field-tooltip">
2489 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="off" name="<?php echo esc_attr( $name ); ?>" type="checkbox" disabled />
2515 <label for="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
2540
2541 <div class="wpvr-tooltip-area">
2542 <span><?php echo esc_html( $title ) . ': '; ?></span>
2543
2544 <?php if(!empty($have_tooltip)) { ?>
2545 <div class="field-tooltip">
2546 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
2572 <label for="<?php echo esc_attr( $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><?php echo esc_html( $title ) . ': '; ?></span>
2590 <textarea rows="5" cols="40" name="explaine-content" id="explaine-content"><?php echo esc_textarea( $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="<?php echo esc_attr( $root_class ); ?>">
2613
2614 </div> -->
2615
2616 <div class="<?php echo esc_attr( $class ); ?>">
2617 <div class="wpvr-tooltip-area">
2618 <span><?php echo esc_html( $title ) . ': '; ?></span>
2619
2620 <?php if(!empty($have_tooltip)) { ?>
2621 <div class="field-tooltip">
2622 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo 'checked'; } else { echo ''; } ?> />
2648 <label for="<?php echo esc_attr( $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><?php echo esc_html( $title ) . ': '; ?></span> -->
2700 <img loading="lazy" class="audio-img" src="<?php echo esc_url( $value ); ?>" style="display: none;">
2701 <input type="text" name="<?php echo esc_attr( $name ); ?>" placeholder="Paste URL" class="audio-attachment-url" value="<?php echo esc_attr( $value ); ?>">
2702
2703 <button type="button" class="audio-upload" data-info=""> <span><?php echo esc_html__('Upload','wpvr')?></span><img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/upload.svg' ); ?>" alt="icon" /></button>
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"><?php echo esc_html( $title ) . ': '; ?>
2728 <span class="hints"><?php echo esc_html__('You can add any logo size. But recommended size is below 100x100 px for perfect look.', 'wpvr') ?></span>
2729 </span>
2730
2731 <div class="form-group">
2732 <input type="text" name="cp-logo-attachment-url" class="cp-logo-attachment-url" value="<?php echo esc_attr( $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="<?php echo esc_url( $value ); ?>">
2738 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/upload-icon.svg' ); ?>" class="placeholder-icon" alt="icon" style="display: <?php if($value != null) { echo 'none'; } ?>;" />
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><?php echo esc_html__('Company Details : ', 'wpvr') ?></span>
2748 <textarea rows="5" cols="40" name="cp-logo-content" id="cp-logo-content"><?php echo 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="<?php echo esc_attr( $class ); ?>" >
2771 <div class="wpvr-tooltip-area">
2772 <span><?php echo esc_html( $title ) . ': '; ?></span>
2773 <div class="field-tooltip">
2774 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
2788 );
2789 }
2790 }
2791 ?>
2792 </span>
2793 </div>
2794 </div>
2795
2796 <input type="text" class="<?php echo esc_attr( $input_class ); ?>" name="<?php echo esc_attr( $name ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo esc_attr( $value ); ?>" />
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><?php echo esc_html( $title ) . ': '; ?></span>
2823
2824 <div class="color-icon">
2825 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/'. $icon ); ?>" alt="icon" />
2826 </div>
2827
2828 <span class="wpvr-switcher">
2829 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="off" name="<?php echo esc_attr( $name ); ?>" type="checkbox" disabled />
2830 <label for="<?php echo esc_attr( $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><?php echo esc_html( $title ) . ': '; ?></span>
2857
2858 <span class="wpvr-switcher">
2859 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo 'checked'; } ?> />
2860 <label for="<?php echo esc_attr( $id ); ?>"></label>
2861 </span>
2862
2863 <div class="color-icon">
2864 <div class="colors">
2865 <span><?php echo esc_html__('Color','wpvr')?></span>
2866
2867 <input type="color" class="<?php echo esc_attr( $color_name ); ?>" name="<?php echo esc_attr( $color_name ); ?>" value="<?php echo esc_attr( $color_value ); ?>" <?php echo esc_attr( $is_color_icon_disabled ); ?>/>
2868 <input type="hidden" class="<?php echo esc_attr( $icon_name ); ?> icon-found-value" name="<?php echo esc_attr( $icon_name ); ?>" value="<?php echo esc_attr( $color_value ); ?>" />
2869 </div>
2870
2871 <div class="icons">
2872 <span><?php echo esc_html__('Icon','wpvr')?></span>
2873 <select class="<?php echo esc_attr( $icon_select_class ); ?>" name="<?php echo esc_attr( $icon_select_name ); ?>" <?php echo esc_attr( $is_color_icon_disabled ); ?> >
2874 <?php
2875 foreach ($custom_icons as $cikey => $civalue) {
2876 if ($cikey == $icon) { ?>
2877 <option value="<?php echo esc_attr( $cikey ); ?>" selected > <?php echo esc_html( $civalue ); ?></option>
2878 <?php } else { ?>
2879 <option value="<?php echo esc_attr( $cikey ); ?>"> <?php echo esc_html( $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="<?php echo esc_attr( $class ); ?>">
2907 <div class="wpvr-set-pre-img">
2908 <span><?php echo esc_html($title) . ' : '; ?></span>
2909
2910 <?php if(!empty($have_tooltip)) { ?>
2911 <div class="field-tooltip">
2912 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $name ); ?>" class="preview-attachment-url" value="<?php echo esc_attr( $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(<?php echo esc_url( $value ); ?>)">
2942 <span class="remove-attachment">x</span>
2943 <label for="vr-preview-img">
2944 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/upload-icon.svg' ); ?>" alt="<?php echo esc_attr__('Upload icon', 'wpvr'); ?>" loading="lazy"/>
2945 <span class="vr-upload-text">
2946 <?php echo esc_html__('Click to', 'wpvr'); ?> <strong><?php echo esc_html__('Upload an Image', 'wpvr'); ?></strong>
2947 </span>
2948 </label>
2949 </div>
2950 </div>
2951 <span class="hints"><?php echo esc_html__('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="<?php echo esc_attr( $class ); ?>">
2974 <div class="wpvr-pre-img">
2975 <span><?php echo esc_html( $title ) . ': '; ?></span>
2976 <?php if(!empty($have_tooltip)) { ?>
2977 <div class="field-tooltip">
2978 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
2992 );
2993 }
2994 }
2995 ?>
2996 </span>
2997 </div>
2998 <?php } ?>
2999 </div>
3000
3001 <input class="previewtext" type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $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="<?php echo esc_attr( $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><?php echo esc_html( $title ) . ': '; ?></span>
3029
3030 <?php if(!empty($have_tooltip)) { ?>
3031 <div class="field-tooltip">
3032 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" name="<?php echo esc_attr( $name ); ?>" type="checkbox" value="1" <?php checked( $checked, 1 ); ?> />
3058 <label for="<?php echo esc_attr( $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="<?php echo esc_attr( $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><?php echo esc_html( $title ) . ': '; ?></span>
3090
3091 <?php if(!empty($have_tooltip)) { ?>
3092 <div class="field-tooltip">
3093 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3107 );
3108 }
3109 }
3110 ?>
3111 </span>
3112 </div>
3113 <?php } ?>
3114 </div>
3115
3116 <span class="wpvr-switcher">
3117 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" name="<?php echo esc_attr( $name ); ?>" type="checkbox" value="1" <?php checked( $checked, 1 ); ?> />
3118 <label for="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
3138
3139 <div class="wpvr-tooltip-area">
3140 <span><?php echo esc_html( $title ) . ': '; ?></span>
3141 <?php if(!empty($have_tooltip)) { ?>
3142 <div class="field-tooltip">
3143 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3157 );
3158 }
3159 }
3160 ?>
3161 </span>
3162 </div>
3163 <?php } ?>
3164 </div>
3165
3166 <span class="wpvr-switcher">
3167 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" name="<?php echo esc_attr( $name ); ?>" type="checkbox" value="<?php echo esc_attr( $val['checked'] ); ?>" <?php checked( $val['checked'], 'on' ); ?> <?php echo esc_attr( !$is_disable ? 'disabled' : '' ); ?>/>
3168 <label for="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
3191
3192 <div class="wpvr-tooltip-area">
3193 <span><?php echo esc_html( $title ) . ': '; ?></span>
3194
3195 <?php if(!empty($have_tooltip)) { ?>
3196 <div class="field-tooltip">
3197 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3211 );
3212 }
3213 }
3214 ?>
3215 </span>
3216 </div>
3217 <?php } ?>
3218 </div>
3219 <input type="number" name="<?php echo esc_attr( $name ); ?>" min="0" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
3237 <?php if(!defined('WPVR_PRO_VERSION')){
3238 echo wp_kses_post('<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"><?php echo esc_html( $title ) . ': '; ?></span>
3243 <?php if(!empty($have_tooltip)) { ?>
3244 <div class="field-tooltip">
3245 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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 esc_attr( $value['layout_icon_bg_color'] ); ?>" >
3271 <input type="hidden" id="layout_icon_color" name="layout_icon_color" value="<?php echo esc_attr( $value['layout_icon_color'] ); ?>" >
3272
3273 <div class="wpvr-layout__radio-container">
3274 <input type="radio" id="default" name="tourLayout" value="default" <?php checked( $value['layout'], 'default' ); ?>>
3275 <div class="wpvr-layout__img">
3276 <label for="default" class="wpvr-layout__radio-label" data-layout='default' data-preview-image=<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/default-layout-preview.png' ); ?>>
3277 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/default-layout.png' ); ?>" alt="Default" class="wpvr-layout__radio-image <?php echo esc_attr( $value['layout'] == 'default' ? 'active' : '' ); ?>">
3278 <?php echo wp_kses_post( $preview ); ?>
3279 </label>
3280 <span class="wpvr-layout__radio-text"><?php echo esc_html__('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 checked( $value['layout'], 'layout1' ); ?>>
3286
3287 <div class="wpvr-layout__img">
3288 <label for="layout1" class="wpvr-layout__radio-label" data-layout='layout1' data-bg-color="<?php echo esc_attr( $value['layout_icon_bg_color'] ); ?>" data-icon-color="<?php echo esc_attr( $value['layout_icon_color'] ); ?>">
3289 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/layout-1.png' ); ?>" alt="Layout 1" class="wpvr-layout__radio-image <?php echo esc_attr( $value['layout'] == 'layout1' ? 'active' : '' ); ?>">
3290 <?php echo wp_kses_post( $preview ); ?>
3291 </label>
3292
3293 <span class="wpvr-layout__radio-text"><?php echo esc_html__('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 esc_html__('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="<?php echo esc_attr( $class ); ?>">
3325
3326 <div class="wpvr-tooltip-area">
3327 <span><?php echo esc_html( $title ) . ': '; ?></span>
3328
3329 <?php if(!empty($have_tooltip)) { ?>
3330 <div class="field-tooltip">
3331 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3345 );
3346 }
3347 }
3348 ?>
3349 </span>
3350 </div>
3351 <?php } ?>
3352 </div>
3353
3354 <input type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo esc_attr( $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="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
3380
3381 <?php if(!empty($have_tooltip)) { ?>
3382 <div class="field-tooltip">
3383 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3397 );
3398 }
3399 }
3400 ?>
3401 </span>
3402 </div>
3403 <?php } ?>
3404
3405 </div>
3406
3407 <input type="text" id="<?php echo esc_attr( $input_id ); ?>" value="<?php echo esc_attr( $value ); ?>" class="<?php echo esc_attr( $input_class ); ?>" name="<?php echo esc_attr( $name ); ?>"/>
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:<?php echo esc_attr( $display ); ?>;">
3431
3432 <div class="wpvr-global-tooltip-area">
3433 <span><?php echo esc_html( $title ) . ': '; ?></span>
3434
3435 <?php if(!empty($have_tooltip)) { ?>
3436 <div class="field-tooltip">
3437 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( '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="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $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="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
3490
3491 <?php if(!empty($have_tooltip)) { ?>
3492 <div class="field-tooltip">
3493 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3507 );
3508 }
3509 }
3510 ?>
3511 </span>
3512 </div>
3513 <?php } ?>
3514 </div>
3515
3516 <input class="<?php echo esc_attr( $name ); ?>" type="text" name="<?php echo esc_attr( $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="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
3540
3541 <?php if(!empty($have_tooltip)) { ?>
3542 <div class="field-tooltip">
3543 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3557 );
3558 }
3559 }
3560 ?>
3561 </span>
3562 </div>
3563 <?php } ?>
3564
3565 <input class="<?php echo esc_attr( $name ); ?>" type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $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'),
3586 'scene' => __('Scene', 'wpvr'),
3587 ));
3588 ob_start();
3589 ?>
3590
3591 <div class="wpvr-global-tooltip-area">
3592 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
3593
3594 <div class="field-tooltip">
3595 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3596 <span>
3597 <?php echo esc_html__('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="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
3604 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
3605 </a>
3606 <?php endif; ?>
3607 </span>
3608 </div>
3609
3610 </div>
3611
3612 <select name="<?php echo esc_attr( $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'),
3639 'scene' => __('Scene', 'wpvr'),
3640 ));
3641 ob_start();
3642 ?>
3643
3644 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
3645 <select class="trtr" name="<?php echo esc_attr( $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:<?php echo esc_attr( $display ); ?>;">
3674
3675 <div class="wpvr-global-tooltip-area">
3676 <label for="hotspot-url"><?php echo esc_html( $title ) . ': '; ?></label>
3677
3678 <?php if(!empty($have_tooltip)) { ?>
3679 <div class="field-tooltip">
3680 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3694 );
3695 }
3696 }
3697 ?>
3698 </span>
3699 </div>
3700 <?php } ?>
3701 </div>
3702
3703 <input type="url" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $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="<?php echo esc_attr( $class ); ?>">
3726
3727 <div class="wpvr-global-tooltip-area">
3728 <label for="hotspot-content"><?php echo esc_html( $title ) . ': '; ?></label>
3729
3730 <?php if(!empty($have_tooltip)) { ?>
3731 <div class="field-tooltip">
3732 <img loading="lazy" src="<?php echo esc_url( 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 esc_html__( 'View Doc', 'wpvr' )
3746 );
3747 }
3748 }
3749 ?>
3750 </span>
3751 </div>
3752 <?php } ?>
3753 </div>
3754
3755 <textarea name="<?php echo esc_attr( $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="<?php echo esc_attr($class); ?>" style="display:<?php echo esc_attr($display); ?>;">
3777 <div class="wpvr-global-tooltip-area">
3778 <label for="<?php echo esc_attr($name); ?>">
3779 <?php echo esc_html($title . ': '); ?>
3780 </label>
3781
3782 <?php if (!empty($have_tooltip)) : ?>
3783 <div class="field-tooltip">
3784 <img loading="lazy"
3785 src="<?php echo esc_url(WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'); ?>"
3786 alt="<?php echo 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="<?php echo esc_attr($name); ?>"><?php echo esc_textarea($sanitized_value); ?></textarea>
3834 </div>
3835 <?php
3836 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3837 echo ob_get_clean();
3838 }
3839
3840
3841
3842
3843 /**
3844 * Render Hotspot Scene Type Textarea Field
3845 * @param mixed $name input field name
3846 * @param mixed $val options
3847 *
3848 * @return void
3849 * @since 8.0.0
3850 */
3851 public static function render_hotspot_scene_content_field($name, $val)
3852 {
3853 extract($val);
3854 ob_start();
3855 ?>
3856
3857 <div class="<?php echo esc_attr( $class ); ?>" style="display:<?php echo esc_attr( $display ); ?>;">
3858 <label for="hotspot-content"><?php echo esc_html( $title ) . ': '; ?></label>
3859 <textarea name="<?php echo esc_attr( $name ); ?>"></textarea>
3860 </div>
3861
3862 <?php
3863 ob_end_flush();
3864 }
3865
3866
3867 /**
3868 * Render Hotspot Scene Select Field
3869 * @param mixed $name input field name
3870 * @param mixed $val options
3871 *
3872 * @return void
3873 */
3874 public static function render_hotspot_scene_select_field($name, $val)
3875 {
3876 extract($val);
3877 ob_start();
3878 ?>
3879
3880 <div class="hotspot-scene" style="display:none;" >
3881 <div class="wpvr-global-tooltip-area">
3882 <label for="hotspot-scene"><?php echo esc_html( $title ) . ': '; ?></label>
3883
3884 <?php if(!empty($have_tooltip)) { ?>
3885 <div class="field-tooltip">
3886 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3887
3888 <span>
3889 <?php
3890 // Ensure tooltip_text text is set
3891 if (!empty($tooltip_text['text'])) {
3892 echo esc_html($tooltip_text['text']);
3893
3894 // Check if URL exists before rendering the link
3895 if (!empty($tooltip_text['url'])) {
3896 printf(
3897 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3898 esc_url($tooltip_text['url']),
3899 esc_html__( 'View Doc', 'wpvr' )
3900 );
3901 }
3902 }
3903 ?>
3904 </span>
3905 </div>
3906 <?php } ?>
3907 </div>
3908
3909 <select class="hotspotscene" name="<?php echo esc_attr( $name ); ?>">
3910 <option value="none" selected> None</option>
3911 </select>
3912 </div>
3913
3914 <?php
3915 ob_end_flush();
3916 }
3917
3918
3919 /**
3920 * Render Hotspot Scene List Select Field
3921 * @param mixed $name input field name
3922 * @param mixed $val options
3923 *
3924 * @return void
3925 */
3926 public static function render_hotspot_scene_list_field($name, $val)
3927 {
3928 extract($val);
3929 ob_start();
3930 ?>
3931
3932 <div class="hotspot-scene" style="display:<?php echo esc_attr( $display ); ?>;" >
3933
3934 <div class="wpvr-global-tooltip-area">
3935 <label for="hotspot-scene"><?php echo esc_html( $title ) . ': '; ?></label>
3936 <?php if(!empty($have_tooltip)) { ?>
3937 <div class="field-tooltip">
3938 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3939
3940 <span>
3941 <?php
3942 // Ensure tooltip_text text is set
3943 if (!empty($tooltip_text['text'])) {
3944 echo esc_html($tooltip_text['text']);
3945
3946 // Check if URL exists before rendering the link
3947 if (!empty($tooltip_text['url'])) {
3948 printf(
3949 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
3950 esc_url($tooltip_text['url']),
3951 esc_html__( 'View Doc', 'wpvr' )
3952 );
3953 }
3954 }
3955 ?>
3956 </span>
3957 </div>
3958 <?php } ?>
3959 </div>
3960 <select class="hotspotscene" name="<?php echo esc_attr( $name ); ?>">
3961 <option value="none" selected> None</option>
3962 </select>
3963 </div>
3964
3965 <?php
3966 ob_end_flush();
3967 }
3968
3969
3970 /**
3971 * Render Hotspot Disabled Select Field
3972 * @param mixed $name input field name
3973 * @param mixed $val options
3974 *
3975 * @return void
3976 * @since 8.0.0
3977 */
3978 public static function render_hotspot_disabled_text_field($name, $val)
3979 {
3980 extract($val);
3981 ob_start();
3982 ?>
3983
3984 <div class="hotspot-scene" style="display:<?php echo esc_attr( $display ); ?>;" >
3985
3986 <div class="wpvr-global-tooltip-area">
3987 <label for="hotspot-scene"><?php echo esc_html( $title ) . ': '; ?></label>
3988 <?php if(!empty($have_tooltip)) { ?>
3989 <div class="field-tooltip">
3990 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
3991
3992 <span>
3993 <?php
3994 // Ensure tooltip_text text is set
3995 if (!empty($tooltip_text['text'])) {
3996 echo esc_html($tooltip_text['text']);
3997
3998 // Check if URL exists before rendering the link
3999 if (!empty($tooltip_text['url'])) {
4000 printf(
4001 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4002 esc_url($tooltip_text['url']),
4003 esc_html__( 'View Doc', 'wpvr' )
4004 );
4005 }
4006 }
4007 ?>
4008 </span>
4009 </div>
4010 <?php } ?>
4011 </div>
4012
4013 <input class="<?php echo esc_attr( $input_class ); ?>" type="text" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" disabled/>
4014 </div>
4015
4016 <?php
4017 ob_end_flush();
4018 }
4019
4020
4021 /**
4022 * Render Hotspot Custom Icon Field
4023 * @param mixed $name input field name
4024 * @param mixed $val options
4025 *
4026 * @return void
4027 * @since 8.0.0
4028 */
4029 public static function render_hotspot_custom_icon_field($name, $val)
4030 {
4031 extract($val);
4032 ob_start();
4033 ?>
4034
4035 <div class="hotspot-setting custom-icon">
4036 <div class="wpvr-global-tooltip-area">
4037 <label for="hotspot-customclass-pro"><?php echo esc_html( $title ) . ': '; ?></label>
4038
4039 <div class="field-tooltip">
4040 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4041 <span>
4042 <?php echo esc_html__('Select a custom icon for the hotspot.', 'wpvr') ?>
4043
4044 <?php
4045 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/';
4046 if (!empty($tooltip_url)) :
4047 ?>
4048 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4049 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4050 </a>
4051 <?php endif; ?>
4052 </span>
4053 </div>
4054
4055 </div>
4056
4057 <select class="hotspot-customclass-pro-select" name="<?php echo esc_attr( $name ); ?>">
4058 <?php
4059 foreach ($custom_icons as $cikey => $civalue) {
4060 if ($cikey == $hotspot_custom_class_pro) { ?>
4061 <option value="<?php echo esc_attr( $cikey ); ?>" selected> <?php echo esc_html( $civalue ); ?></option>
4062 <?php } else { ?>
4063 <option value="<?php echo esc_attr( $cikey ); ?>"> <?php echo esc_html( $civalue ); ?></option>
4064 <?php }
4065 }
4066 ?>
4067 </select>
4068
4069 <span class="change-icon"><i class="<?php echo esc_attr( $hotspot_custom_class_pro ); ?>"></i></span>
4070
4071
4072 </div>
4073
4074 <?php
4075 ob_end_flush();
4076 }
4077
4078
4079 /**
4080 * Render Hotspot Custom Icon Color Field
4081 * @param mixed $name input field name
4082 * @param mixed $val options
4083 *
4084 * @return void
4085 * @since 8.0.0
4086 */
4087 public static function render_hotspot_custom_icon_color_field($name, $val)
4088 {
4089 extract($val);
4090 ob_start();
4091 ?>
4092
4093 <div class="hotspot-setting hotspot-icon">
4094 <div class="wpvr-global-tooltip-area">
4095 <label for="hotspot-customclass-color"><?php echo esc_html( $title ) . ': '; ?></label>
4096
4097 <div class="field-tooltip">
4098 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4099 <span>
4100 <?php echo esc_html__('Set a custom background color for the hotspot.', 'wpvr') ?>
4101
4102 <?php
4103 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4104 if (!empty($tooltip_url)) :
4105 ?>
4106 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4107 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4108 </a>
4109 <?php endif; ?>
4110 </span>
4111 </div>
4112
4113 </div>
4114
4115 <input type="color" class="hotspot-customclass-color" name="hotspot-customclass-color" value="<?php echo esc_attr( $value ); ?>" />
4116 <input type="hidden" class="hotspot-customclass-color-icon-value" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
4117 </div>
4118
4119 <?php
4120 ob_end_flush();
4121 }
4122 /**
4123 * Render Hotspot Custom Icon Color Field
4124 * @param mixed $name input field name
4125 * @param mixed $val options
4126 *
4127 * @return void
4128 * @since 8.0.0
4129 */
4130 public static function render_hotspot_wpvr_custom_icon_color_field($name, $val)
4131 {
4132 extract($val);
4133 ob_start();
4134 ?>
4135
4136 <div class="hotspot-setting hotspot-icon">
4137
4138 <div class="wpvr-global-tooltip-area">
4139 <label for="hotspot-custom-color"><?php echo esc_html( $title ) . ': '; ?></label>
4140
4141 <div class="field-tooltip">
4142 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4143 <span>
4144 <?php echo esc_html__('Set a custom color for the hotspot icon.', 'wpvr') ?>
4145
4146 <?php
4147 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4148 if (!empty($tooltip_url)) :
4149 ?>
4150 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4151 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4152 </a>
4153 <?php endif; ?>
4154 </span>
4155 </div>
4156 </div>
4157
4158 <input type="color" class="hotspot-custom-color" name="hotspot-customc-color" value="<?php echo esc_attr( $value ); ?>" />
4159 <input type="hidden" class="hotspot-custom-icon-color-value" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
4160 </div>
4161
4162 <?php
4163 ob_end_flush();
4164 }
4165
4166
4167 /**
4168 * Render Hotspot Animation Field
4169 * @param mixed $name input field name
4170 * @param mixed $val options
4171 *
4172 * @return void
4173 * @since 8.0.0
4174 */
4175 public static function render_hotspot_animation_field($name, $val)
4176 {
4177 extract($val);
4178 ob_start();
4179 ?>
4180
4181 <div class="hotspot-setting">
4182
4183 <div class="wpvr-global-tooltip-area">
4184 <label for="hotspot-blink"><?php echo esc_html( $title ) . ': '; ?></label>
4185
4186 <div class="field-tooltip">
4187 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4188 <span>
4189 <?php echo esc_html__('Enable an animation for the hotspot.', 'wpvr') ?>
4190
4191 <?php
4192 $tooltip_url = 'https://rextheme.com/docs/individual-hotspot-icon-color-animation-panorama/#0-toc-title'; // Replace with the actual documentation link
4193 if (!empty($tooltip_url)) :
4194 ?>
4195 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4196 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4197 </a>
4198 <?php endif; ?>
4199 </span>
4200 </div>
4201 </div>
4202
4203 <select name="<?php echo esc_attr( $name ); ?>" class="hotspot-blink" >
4204 <option value="on" <?php if($selected == 'on') { echo esc_attr('selected'); } ?> > On</option>
4205 <option value="off" <?php if($selected == 'off') { echo esc_attr('selected'); } ?> > Off</option>
4206 </select>
4207 </div>
4208
4209 <?php
4210 ob_end_flush();
4211 }
4212
4213 /**
4214 * Render Hotspot Animation Field
4215 * @param mixed $name input field name
4216 * @param mixed $val options
4217 *
4218 * @return void
4219 * @since 8.0.0
4220 */
4221 public static function render_hotspot_border_field($name, $val)
4222 {
4223 extract($val);
4224 ob_start();
4225 ?>
4226
4227 <div class="hotspot-setting">
4228 <div class="wpvr-global-tooltip-area">
4229 <label for="hotspot-border"><?php echo esc_html( $title ) . ': '; ?></label>
4230
4231 <div class="field-tooltip">
4232 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4233 <span>
4234 <?php echo esc_html__('Add a border around the hotspot with customizable color, style, and thickness.', 'wpvr') ?>
4235
4236 <?php
4237 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4238 if (!empty($tooltip_url)) :
4239 ?>
4240 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4241 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4242 </a>
4243 <?php endif; ?>
4244 </span>
4245 </div>
4246 </div>
4247
4248
4249 <select name="<?php echo esc_attr( $name ); ?>" class="hotspot-border" >
4250 <option value="on" <?php if($selected == 'on') { echo esc_attr('selected'); } ?> > On</option>
4251 <option value="off" <?php if($selected == 'off') { echo esc_attr('selected'); } ?> > Off</option>
4252 </select>
4253 </div>
4254
4255 <?php
4256 ob_end_flush();
4257 }
4258 /**
4259 * Render Hotspot Animation Field
4260 * @param mixed $name input field name
4261 * @param mixed $val options
4262 *
4263 * @return void
4264 * @since 8.0.0
4265 */
4266 public static function render_hotspot_border_style_field($name, $val)
4267 {
4268 extract($val);
4269 ob_start();
4270 ?>
4271
4272 <div class='hotspot-border-style' >
4273 <label for="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $title ) . ': '; ?></label>
4274 <select name="<?php echo esc_attr( $name ); ?>">
4275 <option value="none" <?php echo !$selected ? esc_attr('selected') : ''; ?>>None</option>
4276 <option value="hidden" <?php selected( $selected, 'hidden' ); ?>>Hidden</option>
4277 <option value="dotted" <?php selected( $selected, 'dotted' ); ?>>Dotted</option>
4278 <option value="dashed" <?php selected( $selected, 'dashed' ); ?>>Dashed</option>
4279 <option value="solid" <?php selected( $selected, 'solid' ); ?>>Solid</option>
4280 <option value="double" <?php selected( $selected, 'double' ); ?>>Double</option>
4281 <option value="groove" <?php selected( $selected, 'groove' ); ?>>Groove</option>
4282 <option value="ridge" <?php selected( $selected, 'ridge' ); ?>>Ridge</option>
4283 <option value="inset" <?php selected( $selected, 'inset' ); ?>>Inset</option>
4284 <option value="outset" <?php selected( $selected, 'outset' ); ?>>Outset</option>
4285 </select>
4286 </div>
4287
4288 <?php
4289 ob_end_flush();
4290 }
4291
4292 public static function render_hotspot_border_color_field($name, $val)
4293 {
4294 extract($val);
4295 ob_start();
4296 ?>
4297 <div class='hotspot-border-color'>
4298 <label for="hotspot-border-color"><?php echo esc_html( $title ) . ': '; ?></label>
4299 <input type="color" class="hotspot-border-color-for-view" name="hotspot-border-color-for-view" value="<?php echo esc_attr( $value ); ?>" />
4300 <input type="hidden" class="hotspot-border-color" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" />
4301 </div>
4302 </div>
4303 <?php
4304 ob_end_flush();
4305 }
4306
4307 public static function render_hotspot_border_width_field($name, $val)
4308 {
4309 extract($val);
4310 ob_start();
4311 ?>
4312 <div class="hotspot-setting hotspot-border-setting" style="<?php echo esc_attr( $hotspot_border_data == 'off' ? 'display:none' : '' ); ?>">
4313 <div class='hotspot-setting-border-width'>
4314 <label for="hotspot-border-width"><?php echo esc_html( $title ) . ': '; ?></label>
4315 <input type="text" class="hotspot-border-width" name="hotspot-border-width" value="<?php echo esc_attr( $value ); ?>" />
4316 </div>
4317
4318
4319 <?php
4320 ob_end_flush();
4321 }
4322
4323 /**
4324 * Render Hotspot Animation Field
4325 * @param mixed $name input field name
4326 * @param mixed $val options
4327 *
4328 * @return void
4329 * @since 8.0.0
4330 */
4331 public static function render_hotspot_shape_field($name, $val)
4332 {
4333 extract($val);
4334 ob_start();
4335 ?>
4336
4337 <div class="hotspot-setting">
4338
4339 <div class="wpvr-global-tooltip-area">
4340 <label for="hotspot-shape"><?php echo esc_html( $title ) . ': '; ?></label>
4341
4342 <div class="field-tooltip">
4343 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4344 <span>
4345 <?php echo esc_html__('Select the shape of the hotspot (e.g., Rounded, square, and Hexagon).', 'wpvr') ?>
4346
4347 <?php
4348 $tooltip_url = 'https://rextheme.com/docs/wp-vr-customize-hotspot-icons-and-color/'; // Replace with the actual documentation link
4349 if (!empty($tooltip_url)) :
4350 ?>
4351 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4352 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4353 </a>
4354 <?php endif; ?>
4355 </span>
4356 </div>
4357 </div>
4358
4359 <select name="<?php echo esc_attr( $name ); ?>" class="hotspot-shape" >
4360 <option value="round" <?php if($selected == 'round') { echo esc_attr('selected'); } ?> > Rounded</option>
4361 <option value="square" <?php if($selected == 'square') { echo esc_attr('selected'); } ?> > Square</option>
4362 <option value="hexagon" <?php if($selected == 'hexagon') { echo esc_attr('selected'); } ?> > Hexagon</option>
4363 </select>
4364 </div>
4365
4366 <?php
4367 ob_end_flush();
4368 }
4369
4370 /**
4371 * Render Fluent form Field
4372 * @param mixed $name input field name
4373 * @param mixed $val options
4374 *
4375 * @return void
4376 * @since 8.0.0
4377 */
4378 public static function render_hotspot_fluent_form_type_field($name , $val){
4379 extract($val);
4380 $default_type = apply_filters('wpvr_hotspot_types', array(
4381 'info' => __('Info', 'wpvr'),
4382 'scene' => __('Scene', 'wpvr'),
4383 ));
4384 ob_start();
4385 ?>
4386
4387 <div class="wpvr-global-tooltip-area">
4388 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
4389
4390 <div class="field-tooltip">
4391 <img src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4392 <span>
4393 <?php echo esc_html__('Choose the type of hotspot: Info (displays information) or Scene (links to another scene).', 'wpvr') ?>
4394
4395 <?php
4396 $tooltip_url = 'https://rextheme.com/docs/wp-vr-hotspots-to-show-information-images-videos/#0-toc-title'; // Replace with the actual documentation link
4397 if (!empty($tooltip_url)) :
4398 ?>
4399 <a href="<?php echo esc_url($tooltip_url); ?>" target="_blank" rel="noopener noreferrer">
4400 <?php echo esc_html__( 'View Doc', 'wpvr' ); ?>
4401 </a>
4402 <?php endif; ?>
4403 </span>
4404 </div>
4405 </div>
4406
4407 <select name="<?php echo esc_attr( $name ); ?>">
4408 <?php
4409 $hotspot_type = 'fluent_form';
4410 foreach ($default_type as $key => $value) {
4411 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
4412 } ?>
4413 </select>
4414
4415 <?php
4416 ob_end_flush();
4417 }
4418
4419 /**
4420 * Render Hotspot Fluent form id
4421 * @param mixed $name input field name
4422 * @param mixed $val options
4423 *
4424 * @return void
4425 * @since 8.0.0
4426 */
4427 public static function render_hotspot_fluent_form_select_field($name , $val){
4428 extract($val);
4429 do_action("hotspot_info_before_hover_content","fluent_form",$value);
4430 }
4431 /**
4432 * Render woocommerce Field
4433 * @param mixed $name input field name
4434 * @param mixed $val options
4435 *
4436 * @return void
4437 * @since 8.0.0
4438 */
4439 public static function render_hotspot_wc_product_type_field($name , $val){
4440 extract($val);
4441 $default_type = apply_filters('wpvr_hotspot_types', array(
4442 'info' => __('Info', 'wpvr'),
4443 'scene' => __('Scene', 'wpvr'),
4444 ));
4445 ob_start();
4446 ?>
4447
4448 <label for="hotspot-type"><?php echo esc_html( $title ) . ': '; ?></label>
4449 <select name="<?php echo esc_attr( $name ); ?>">
4450 <?php
4451 $hotspot_type = 'wc_product';
4452 foreach ($default_type as $key => $value) {
4453 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $hotspot_type, false), esc_attr($key), esc_attr($value));
4454 } ?>
4455 </select>
4456
4457 <?php
4458 ob_end_flush();
4459 }
4460
4461 /**
4462 * Render Hotspot Woocommerce Product
4463 * @param mixed $name input field name
4464 * @param mixed $val options
4465 *
4466 * @return void
4467 * @since 8.0.0
4468 */
4469 public static function render_hotspot_wc_product_select_field($name , $val){
4470 extract($val);
4471 do_action("hotspot_info_before_hover_content","wc_product",$value);
4472 }
4473
4474 public static function render_call_to_form_checkbox($name, $val)
4475 {
4476 extract( $val );
4477 ob_start();
4478 ?>
4479 <div class="<?php echo esc_attr( $class ); ?>">
4480 <div class="wpvr-tooltip-area">
4481 <span><?php echo esc_html( $title ) . ': '; ?></span>
4482 <?php if(!empty($have_tooltip)) { ?>
4483 <div class="field-tooltip">
4484 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4485
4486 <span>
4487 <?php
4488 // Ensure tooltip_text text is set
4489 if (!empty($tooltip_text['text'])) {
4490 echo esc_html($tooltip_text['text']);
4491
4492 // Check if URL exists before rendering the link
4493 if (!empty($tooltip_text['url'])) {
4494 printf(
4495 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4496 esc_url($tooltip_text['url']),
4497 esc_html__( 'View Doc', 'wpvr' )
4498 );
4499 }
4500 }
4501 ?>
4502 </span>
4503 </div>
4504 <?php } ?>
4505
4506 </div>
4507
4508 <span class="wpvr-switcher">
4509 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" name="<?php echo esc_attr( $name ); ?>" type="checkbox" value="<?php echo esc_attr( $val['checked'] ); ?>" <?php checked( $val['checked'], 'on' ); ?> <?php echo esc_attr( !$is_disable ? 'disabled' : '' ); ?>/>
4510 <label for="<?php echo esc_attr( $id ); ?>"></label>
4511 </span>
4512
4513
4514
4515 </div>
4516 <?php
4517 ob_end_flush();
4518 }
4519
4520 public static function render_text_area_field($name, $val)
4521 {
4522 extract( $val );
4523 ob_start();
4524 ?>
4525 <div class="<?php echo esc_attr( $class ); ?>">
4526 <div id="<?php echo esc_attr( $code_mirror_id ); ?>" ></div>
4527 <!-- --><?php //if(!empty($have_tooltip)) {?>
4528 <!-- <div class="field-tooltip">-->
4529 <!-- <img src="--><?php //= WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg'; ?><!--" alt="icon" />-->
4530 <!-- <span>--><?php //= esc_html( $tooltip_text ); ?><!--</span>-->
4531 <!-- </div>-->
4532 <!-- --><?php //} ?>
4533 </div>
4534 <style>
4535 /* Adjust the styling of line numbers */
4536 .CodeMirror-linenumber {
4537 padding: 0 5px; /* Adjust padding as needed */
4538 color: #999; /* Adjust color as needed */
4539 }
4540
4541 </style>
4542 <?php
4543 ob_end_flush();
4544 }
4545
4546
4547 public static function render_custom_css_form_checkbox($name, $val)
4548 {
4549 extract( $val );
4550 ob_start();
4551 ?>
4552 <div class="<?php echo esc_attr( $class ); ?>">
4553 <div class="wpvr-tooltip-area">
4554 <span><?php echo esc_html( $title ) . ': '; ?></span>
4555 <?php if(!empty($have_tooltip)) { ?>
4556 <div class="field-tooltip">
4557 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4558
4559 <span>
4560 <?php
4561 // Ensure tooltip_text text is set
4562 if (!empty($tooltip_text['text'])) {
4563 echo esc_html($tooltip_text['text']);
4564
4565 // Check if URL exists before rendering the link
4566 if (!empty($tooltip_text['url'])) {
4567 printf(
4568 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4569 esc_url($tooltip_text['url']),
4570 esc_html__( 'View Doc', 'wpvr' )
4571 );
4572 }
4573 }
4574 ?>
4575 </span>
4576 </div>
4577 <?php } ?>
4578
4579 </div>
4580
4581 <span class="wpvr-switcher">
4582 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" name="<?php echo esc_attr( $name ); ?>" type="checkbox" value="<?php echo esc_attr( $val['checked'] ); ?>" <?php checked( $val['checked'], 'on' ); ?> <?php echo esc_attr( !$is_disable ? 'disabled' : '' ); ?>/>
4583 <label for="<?php echo esc_attr( $id ); ?>"></label>
4584 </span>
4585
4586 </div>
4587 <?php
4588 ob_end_flush();
4589 }
4590
4591 public static function render_button_configuration_field($name, $val)
4592 {
4593 extract( $val );
4594 ob_start();
4595 $button_style =$val['value'];
4596 $selectedBgColor = isset($button_style['button_background_color']) ? $button_style['button_background_color'] : '#201cfe';
4597 $selectedColor = isset($button_style['button_font_color']) ? $button_style['button_font_color'] : '#ffffff';
4598 $selectedFontSize = isset($button_style['button_font_size']) ? $button_style['button_font_size'] : 14;
4599 $selectedFontWeight = isset($button_style['button_font_weight']) ? $button_style['button_font_weight'] : 400;
4600 $selectedLineHeight = isset($button_style['button_line_height']) ? $button_style['button_line_height'] : 1;
4601 $selectedTextDecoration = isset($button_style['button_text_decoration']) ? $button_style['button_text_decoration'] : 'none';
4602 $selectedTransform = isset($button_style['button_transform']) ? $button_style['button_transform'] : 'none';
4603 $selectedAlignment = isset($button_style['button_alignment']) ? $button_style['button_alignment'] : 'left';
4604 $selectedFontStyle = isset($button_style['button_text_style']) ? $button_style['button_text_style'] : 'normal';
4605 $selectedLetterSpacing = isset($button_style['button_letter_spacing']) ? $button_style['button_letter_spacing'] : 1;
4606 $selectedWordSpacing = isset($button_style['button_word_spacing']) ? $button_style['button_word_spacing'] : 0;
4607 $selectedBorderWidth = isset($button_style['button_border_width']) ? $button_style['button_border_width'] : 1;
4608 $selectedBorderStyle = isset($button_style['button_border_style']) ? $button_style['button_border_style'] : 'solid';
4609 $selectedBorderColor = isset($button_style['button_border_style']) ? $button_style['button_border_color'] : '#201cfe';
4610 $selectedBorderRadius = isset($button_style['button_border_radius']) ? $button_style['button_border_radius'] : 6;
4611
4612 $selectedPaddingTop = isset($button_style['button_pt']) ? $button_style['button_pt'] : 10;
4613 $selectedPaddingRight = isset($button_style['button_pr']) ? $button_style['button_pr'] : 15;
4614 $selectedPaddingBottom = isset($button_style['button_pb']) ? $button_style['button_pb'] : 10;
4615 $selectedPaddingLeft = isset($button_style['button_pl']) ? $button_style['button_pl'] : 15;
4616
4617 $selectedNewTab = isset($button_style['button_open_new_tab']) ? $button_style['button_open_new_tab'] : 'off';
4618 ?>
4619 <div class="<?php echo esc_attr( $class ); ?>">
4620
4621 <div class="button-style-configaration">
4622 <div class="single-cta-control new-tab">
4623 <span class="wpvr-switcher">
4624 <span class="control-title"><?php echo esc_html__('Open in new tab','wpvr') ?></span>
4625 <input id="button_open_new_tab" class="vr-switcher-check" name="button_open_new_tab" type="checkbox" value="<?php echo esc_attr( $selectedNewTab ); ?>" <?php checked( $selectedNewTab, 'on' ); ?> />
4626 <label for="button_open_new_tab"></label>
4627 </span>
4628 </div>
4629
4630 <div class="single-cta-control bg-color color-box">
4631 <label class="control-title"><?php echo esc_html__('Background Color :','wpvr') ?></label>
4632 <div class="colors">
4633 <span><?php echo esc_html__('Color','wpvr')?></span>
4634 <input type="color" name="button_background_color" value="<?php echo esc_attr( $selectedBgColor ); ?>">
4635 </div>
4636
4637 </div>
4638
4639 <div class="single-cta-control font-color color-box">
4640 <label class="control-title"><?php echo esc_html__('Font color :','wpvr') ?></label>
4641
4642 <div class="colors">
4643 <span><?php echo esc_html__('Color','wpvr')?></span>
4644 <input type="color" name="button_font_color" value="<?php echo esc_attr( $selectedColor ); ?>">
4645 </div>
4646
4647 </div>
4648
4649 <div class="single-cta-control font-size">
4650 <label class="control-title"><?php echo esc_html__('Font Size (px) :','wpvr') ?></label>
4651 <input type="number" name="button_font_size" value="<?php echo esc_attr( $selectedFontSize ); ?>" min="0">
4652 </div>
4653
4654 <div class="single-cta-control font-weight">
4655 <label class="control-title"><?php echo esc_html__('Font Weight :','wpvr') ?></label>
4656 <select name="button_font_weight" id="button_font_weight">
4657 <option value="400" <?php echo ($selectedFontWeight == '400') ? esc_attr('selected') : ''; ?>>400</option>
4658 <option value="500" <?php echo ($selectedFontWeight == '500') ? esc_attr('selected') : ''; ?>>500</option>
4659 <option value="600" <?php echo ($selectedFontWeight == '600') ? esc_attr('selected') : ''; ?>>600</option>
4660 <option value="700" <?php echo ($selectedFontWeight == '700') ? esc_attr('selected') : ''; ?>>700</option>
4661 <option value="800" <?php echo ($selectedFontWeight == '800') ? esc_attr('selected') : ''; ?>>800</option>
4662 <option value="900" <?php echo ($selectedFontWeight == '900') ? esc_attr('selected') : ''; ?>>900</option>
4663 </select>
4664 </div>
4665
4666 <div class="single-cta-control line-height">
4667 <label class="control-title"><?php echo esc_html__('Line Height :','wpvr') ?></label>
4668 <input type="number" name="button_line_height" value="<?php echo esc_attr( $selectedLineHeight ); ?>" min="0">
4669 </div>
4670
4671 <div class="single-cta-control text-decoration">
4672 <label class="control-title"><?php echo esc_html__('Text Decoration :','wpvr') ?></label>
4673 <select name="button_text_decoration" id="button_text_decoration">
4674 <option value="none" <?php echo ($selectedTextDecoration == 'none') ? 'selected' : ''; ?>><?php echo esc_html__('None','wpvr') ?></option>
4675 <option value="underline" <?php echo ($selectedTextDecoration == 'underline') ? 'selected' : ''; ?>> <?php echo esc_html__('Underline','wpvr') ?></option>
4676 <option value="overline" <?php echo ($selectedTextDecoration == 'overline') ? 'selected' : ''; ?>><?php echo esc_html__('Overline','wpvr') ?></option>
4677 <option value="line-through" <?php echo ($selectedTextDecoration == 'line-through') ? 'selected' : ''; ?>><?php echo esc_html__('Line Through','wpvr') ?></option>
4678 </select>
4679 </div>
4680
4681 <div class="single-cta-control text-transform">
4682 <label class="control-title"><?php echo esc_html__('Text Transform :','wpvr') ?></label>
4683 <select name="button_transform" id="button_transform">
4684 <option value="none" <?php echo ($selectedTransform == 'none') ? 'selected' : ''; ?>><?php echo esc_html__('None','wpvr') ?></option>
4685 <option value="uppercase" <?php echo ($selectedTransform == 'uppercase') ? 'selected' : ''; ?>><?php echo esc_html__('Uppercase','wpvr') ?></option>
4686 <option value="lowercase" <?php echo ($selectedTransform == 'lowercase') ? 'selected' : ''; ?>><?php echo esc_html__('Lowercase','wpvr') ?></option>
4687 <option value="capitalize" <?php echo ($selectedTransform == 'capitalize') ? 'selected' : ''; ?>><?php echo esc_html__('Capitalize','wpvr') ?></option>
4688 </select>
4689 </div>
4690
4691 <div class="single-cta-control text-align">
4692 <label class="control-title"> <?php echo esc_html__('Button Alignment :','wpvr') ?></label>
4693 <select name="button_alignment" id="button_alignment">
4694 <option value="left" <?php echo ($selectedAlignment == 'left') ? 'selected' : ''; ?>> <?php echo esc_html__('Left','wpvr') ?></option>
4695 <option value="right" <?php echo ($selectedAlignment == 'right') ? 'selected' : ''; ?>> <?php echo esc_html__('Right','wpvr') ?></option>
4696 <option value="center" <?php echo ($selectedAlignment == 'center') ? 'selected' : ''; ?>> <?php echo esc_html__('Center','wpvr') ?></option>
4697 <option value="justified" <?php echo ($selectedAlignment == 'justified') ? 'selected' : ''; ?>> <?php echo esc_html__('Justified','wpvr') ?></option>
4698 </select>
4699 </div>
4700
4701 <div class="single-cta-control font-style">
4702 <label class="control-title"> <?php echo esc_html__('Font Style :','wpvr') ?></label>
4703 <select name="button_text_style" id="button_text_style">
4704 <option value="normal" <?php echo ($selectedFontStyle == 'normal') ? 'selected' : ''; ?>> <?php echo esc_html__('Normal','wpvr') ?></option>
4705 <option value="italic" <?php echo ($selectedFontStyle == 'italic') ? 'selected' : ''; ?>> <?php echo esc_html__('Italic','wpvr') ?></option>
4706 <option value="oblique" <?php echo ($selectedFontStyle == 'oblique') ? 'selected' : ''; ?>> <?php echo esc_html__('Oblique','wpvr') ?></option>
4707 </select>
4708 </div>
4709
4710 <div class="single-cta-control letter-spacing">
4711 <label class="control-title"> <?php echo esc_html__('Letter Spacing (px) :','wpvr') ?></label>
4712 <input type="number" name="button_letter_spacing" value="<?php echo esc_attr( $selectedLetterSpacing ); ?>" min="0">
4713 </div>
4714
4715 <div class="single-cta-control word-spacing">
4716 <label class="control-title"> <?php echo esc_html__('Word Spacing (px) :','wpvr') ?></label>
4717 <input type="number" name="button_word_spacing" value="<?php echo esc_attr( $selectedWordSpacing ); ?>" min="0">
4718 </div>
4719
4720 <div class="single-cta-control border-radius">
4721 <label class="control-title"> <?php echo esc_html__('Border Radius (px) :','wpvr') ?></label>
4722 <input type="number" name="button_border_radius" value="<?php echo esc_attr( $selectedBorderRadius ); ?>" min="0">
4723 </div>
4724
4725 <div class="single-cta-control control-group border">
4726 <label class="control-title"> <?php echo esc_html__('Border :','wpvr') ?></label>
4727 <div class="border-property-area">
4728 <div class="border-property border-width">
4729 <label class="control-inner-title"> <?php echo esc_html__('Width (px)','wpvr') ?></label>
4730 <input type="number" name="button_border_width" value="<?php echo esc_attr( $selectedBorderWidth ); ?>" min="0">
4731 </div>
4732
4733 <div class="border-property border-style">
4734 <label class="control-inner-title"> <?php echo esc_html__('Style','wpvr') ?></label>
4735 <select name="button_border_style" id="button_border_style">
4736 <option value="solid" <?php echo ($selectedBorderStyle == 'solid') ? 'selected' : ''; ?>> Solid</option>
4737 <option value="dashed" <?php echo ($selectedBorderStyle == 'dashed') ? 'selected' : ''; ?>> Dashed</option>
4738 <option value="dotted" <?php echo ($selectedBorderStyle == 'dotted') ? 'selected' : ''; ?>> Dotted</option>
4739 <option value="double" <?php echo ($selectedBorderStyle == 'double') ? 'selected' : ''; ?>> Double</option>
4740 <option value="none" <?php echo ($selectedBorderStyle == 'none') ? 'selected' : ''; ?>> None</option>
4741 </select>
4742 </div>
4743
4744 <div class="border-property border-color color-box">
4745 <label class="control-inner-title"> <?php echo esc_html__('Color','wpvr') ?></label>
4746 <input type="color" name="button_border_color" value="<?php echo esc_attr( $selectedBorderColor ); ?>">
4747 </div>
4748
4749 </div>
4750
4751 </div>
4752
4753 <div class="single-cta-control control-group padding">
4754 <label class="control-title"> <?php echo esc_html__('Padding (px) :','wpvr') ?></label>
4755 <div class="border-property-area">
4756 <div class="padding-property padding-top">
4757 <label class="control-inner-title"> <?php echo esc_html__('Top','wpvr') ?></label>
4758 <input type="number" name="button_pt" value="<?php echo esc_attr( $selectedPaddingTop ); ?>" min="0">
4759 </div>
4760
4761 <div class="padding-property padding-right">
4762 <label class="control-inner-title"> <?php echo esc_html__('Right','wpvr') ?></label>
4763 <input type="number" name="button_pr" value="<?php echo esc_attr( $selectedPaddingRight ); ?>">
4764 </div>
4765
4766 <div class="padding-property padding-bottom">
4767 <label class="control-inner-title"> <?php echo esc_html__('Bottom','wpvr') ?></label>
4768 <input type="number" name="button_pb" value="<?php echo esc_attr( $selectedPaddingBottom ); ?>">
4769 </div>
4770
4771 <div class="padding-property padding-left">
4772 <label class="control-inner-title"> <?php echo esc_html__('Left','wpvr') ?></label>
4773 <input type="number" name="button_pl" value="<?php echo esc_attr( $selectedPaddingLeft ); ?>">
4774 </div>
4775 </div>
4776
4777 </div>
4778
4779 </div>
4780 </div>
4781 <?php
4782 ob_end_flush();
4783 }
4784
4785
4786
4787 /**
4788 * Render background music field on Advanced Controls section
4789 *
4790 * @param mixed $name
4791 * @param mixed $val
4792 *
4793 * @return void
4794 * @since 8.0.0
4795 */
4796 public static function render_vrscene_navigation_option_field($name, $val)
4797 {
4798 extract($val);
4799 ob_start();
4800 ?>
4801 <div class="wpvr-scene-navigation-content" style="display:none">
4802 <?php
4803 foreach($inner_fields as $name => $val) {
4804 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
4805 }
4806 ?>
4807 </div>
4808 <?php
4809 ob_end_flush();
4810 }
4811
4812
4813 /**
4814 * Render checkbox for advanced control pro version meta fields
4815 *
4816 * @param mixed $name
4817 * @param mixed $val
4818 *
4819 * @return void
4820 * @since 8.0.0
4821 */
4822 public static function render_pro_radio_field($name, $val)
4823 {
4824 extract($val);
4825 ob_start();
4826 ?>
4827 <div class="<?php echo esc_attr( $class ); ?>">
4828 <span><?php echo esc_html( $title ); ?></span>
4829
4830 <span class="wpvr-switchers">
4831 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-radio" value="<?php echo esc_attr( $value ); ?>" name="vr_scene_navigation_content_type" type="radio" <?php echo esc_attr( $checked ); ?> />
4832 <label for="<?php echo esc_attr( $id ); ?>" class="custom-radio-label"></label>
4833 </span>
4834
4835 <?php if(!empty($have_tooltip)) { ?>
4836 <div class="field-tooltip">
4837 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4838 <span><?php echo esc_html( $tooltip_text ); ?></span>
4839 </div>
4840 <?php } ?>
4841 </div>
4842 <?php
4843 ob_end_flush();
4844 }
4845
4846
4847 /**
4848 * Render Hotspot Scene Select Field
4849 * @param mixed $name input field name
4850 * @param mixed $val options
4851 *
4852 * @return void
4853 */
4854 public static function render_animation_name_select($name, $val)
4855 {
4856 extract($val);
4857 ob_start();
4858 $default_type = apply_filters('wpvr_scene_animation', array(
4859 'none' => __('None', 'wpvr'),
4860 'circle_crop' => __('Circle Crop', 'wpvr'),
4861
4862 'zoom_in' => __('Zoom In', 'wpvr'),
4863 'zoom_in_up' => __('Zoom In Up', 'wpvr'),
4864 'zoom_in_down' => __('Zoom In Down', 'wpvr'),
4865 'zoom_in_left' => __('Zoom In Left', 'wpvr'),
4866 'zoom_in_right' => __('Zoom In Right', 'wpvr'),
4867
4868 'slide_in_up' => __('Slide In Up', 'wpvr'),
4869 'slide_in_down' => __('Slide In Down', 'wpvr'),
4870 'slide_in_left' => __('Slide In Left', 'wpvr'),
4871 'slide_in_right' => __('Slide In Right', 'wpvr'),
4872
4873 'fade_blur' => __('Fade With Blur', 'wpvr'),
4874 'fade_in' => __('Fade In', 'wpvr'),
4875 'fade_in_up' => __('Fade In Up', 'wpvr'),
4876 'fade_in_down' => __('Fade In Down', 'wpvr'),
4877 'fade_in_left' => __('Fade In Left', 'wpvr'),
4878 'fade_in_right' => __('Fade In Right', 'wpvr'),
4879 'fade_in_top_left' => __('Fade In Top Left', 'wpvr'),
4880 'fade_in_top_right' => __('Fade In Top Right', 'wpvr'),
4881 'fade_in_bottom_left' => __('Fade In Bottom Left', 'wpvr'),
4882 'fade_in_bottom_right' => __('Fade In Bottom Right', 'wpvr'),
4883
4884 'back_in_left' => __('Back In Left', 'wpvr'),
4885 'back_in_right' => __('Back In Right', 'wpvr'),
4886 'back_in_up' => __('Back In Up', 'wpvr'),
4887 'back_in_down' => __('Back In Down', 'wpvr'),
4888
4889 'bounce_in' => __('Bounce In', 'wpvr'),
4890 'bounce_in_up' => __('Bounce In Up', 'wpvr'),
4891 'bounce_in_down' => __('Bounce In Down', 'wpvr'),
4892 'bounce_in_left' => __('Bounce In Left', 'wpvr'),
4893 'bounce_in_right' => __('Bounce In Right', 'wpvr'),
4894
4895 'flip' => __('Flip', 'wpvr'),
4896 'flip_x' => __('Flip X', 'wpvr'),
4897 'flip_y' => __('Flip Y', 'wpvr'),
4898
4899 'light_speed_in_left' => __('Light Speed In Left', 'wpvr'),
4900 'light_speed_in_right' => __('Light Speed In Right', 'wpvr'),
4901
4902 'rotate_in' => __('Rotate In', 'wpvr'),
4903 'rotate_in_up_left' => __('Rotate In Up Left', 'wpvr'),
4904 'rotate_in_up_right' => __('Rotate In Up Right', 'wpvr'),
4905 'rotate_in_down_left' => __('Rotate In Down Left', 'wpvr'),
4906 'rotate_in_down_right' => __('Rotate In Down Right', 'wpvr'),
4907
4908 ));
4909
4910 ?>
4911
4912 <div class='single-settings'>
4913
4914 <div class="wpvr-tooltip-area">
4915 <span for="scene-animation-name"><?php echo esc_html( $title ) . ': '; ?></span>
4916 <?php if(!empty($have_tooltip)) { ?>
4917 <div class="field-tooltip">
4918 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4919
4920 <span>
4921 <?php
4922 // Ensure tooltip_text text is set
4923 if (!empty($tooltip_text['text'])) {
4924 echo esc_html($tooltip_text['text']);
4925
4926 // Check if URL exists before rendering the link
4927 if (!empty($tooltip_text['url'])) {
4928 printf(
4929 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4930 esc_url($tooltip_text['url']),
4931 esc_html__( 'View Doc', 'wpvr' )
4932 );
4933 }
4934 }
4935 ?>
4936 </span>
4937 </div>
4938 <?php } ?>
4939 </div>
4940
4941 <select class='scene-animation-name' name="<?php echo esc_attr( $name ); ?>">
4942 <?php
4943 foreach ($default_type as $key => $type) {
4944 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $value, true), esc_attr($key), esc_attr($type));
4945 } ?>
4946 </select>
4947 </div>
4948
4949 <?php
4950 ob_end_flush();
4951 }
4952
4953
4954 public static function render_membership_access_name_select($name, $val)
4955 {
4956 extract($val);
4957 ob_start(); // Start output buffering
4958
4959 $membership_access_control_types = apply_filters('get_membership_access_control_types', array(
4960 'none' => __('All Membership Levels', 'wpvr'),
4961 ));
4962 ?>
4963
4964 <div class='single-settings'>
4965
4966 <div class="wpvr-tooltip-area">
4967 <span for="membership-access-name"><?php echo esc_html( $title ) . ': '; ?></span>
4968 <?php if(!empty($have_tooltip)) { ?>
4969 <div class="field-tooltip">
4970 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
4971
4972 <span>
4973 <?php
4974 // Ensure tooltip_text text is set
4975 if (!empty($tooltip_text['text'])) {
4976 echo esc_html($tooltip_text['text']);
4977
4978 // Check if URL exists before rendering the link
4979 if (!empty($tooltip_text['url'])) {
4980 printf(
4981 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
4982 esc_url($tooltip_text['url']),
4983 esc_html__( 'View Doc', 'wpvr' )
4984 );
4985 }
4986 }
4987 ?>
4988 </span>
4989 </div>
4990 <?php } ?>
4991 </div>
4992
4993 <select class=<?php echo esc_attr($val['class']) ?> id="<?php echo esc_attr($val['id']) ?>" name="<?php echo esc_attr($name); ?>">
4994 <?php
4995 foreach ($membership_access_control_types as $key => $type) {
4996 echo sprintf(
4997 "<option %s value='%s'>%s</option>\n",
4998 selected($key, $value, false),
4999 esc_attr($key),
5000 esc_html($type)
5001 );
5002 }
5003 ?>
5004 </select>
5005 </div>
5006
5007 <?php
5008 ob_end_flush();
5009 }
5010
5011 /**
5012 * Render other fields
5013 *
5014 * @param mixed $postdata
5015 *
5016 * @return void
5017 * @since 8.5.27
5018 */
5019 public static function render_other_fields($postdata){
5020 ?>
5021 <?php WPVR_Meta_Field::render_basic_setting_generic_form_fields($postdata);?>
5022 <div class="generic-form-associates">
5023 <?php WPVR_Meta_Field::render_generic_form_associate_fields($postdata) ;?>
5024 </div>
5025
5026 <?php WPVR_Meta_Field::render_basic_setting_call_to_action_fields($postdata);?>
5027 <div class="call-to-action">
5028 <?php WPVR_Meta_Field::render_call_to_action_associate_fields($postdata) ;?>
5029 </div>
5030
5031 <?php WPVR_Meta_Field::render_basic_setting_custom_css_fields($postdata);?>
5032 <div class="custom-css-field">
5033 <?php WPVR_Meta_Field::render_custom_css_associate_fields($postdata) ;?>
5034 </div>
5035 <?php
5036 }
5037
5038
5039 /**
5040 * Renders a checkbox field for keyboard control settings in the advanced settings section
5041 *
5042 * This method renders a checkbox with an optional tooltip. If the checkbox ID is 'wpvr_diskeyboard',
5043 * it also renders additional keyboard control settings.
5044 *
5045 * @param string $name The name attribute for the checkbox input field
5046 * @param array $val Array of field attributes including:
5047 * - class: CSS class for the wrapper div
5048 * - id: HTML ID for the checkbox input
5049 * - title: Text to display as the field label
5050 * - value: Current value of the checkbox ('on' or 'off')
5051 * - have_tooltip: Whether to show tooltip
5052 * - tooltip_text: Array with 'text' and optional 'url' for tooltip content
5053 * @param array $postdata The post data for rendering additional fields
5054 *
5055 * @return void Outputs HTML directly
5056 * @since 8.5.27
5057 */
5058 public static function render_advanced_setting_checkbox_for_mouse_dragg_control_field($name, $val, $postdata)
5059 {
5060 extract( $val );
5061 ob_start();
5062 ?>
5063 <div class="<?php echo esc_attr( $class ); ?>">
5064
5065 <div class="wpvr-tooltip-area">
5066 <span><?php echo esc_html( $title ) . ': '; ?></span>
5067
5068 <?php if(!empty($have_tooltip)) { ?>
5069 <div class="field-tooltip">
5070 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5071
5072 <span>
5073 <?php
5074 // Ensure tooltip_text text is set
5075 if (!empty($tooltip_text['text'])) {
5076 echo esc_html($tooltip_text['text']);
5077
5078 // Check if URL exists before rendering the link
5079 if (!empty($tooltip_text['url'])) {
5080 printf(
5081 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5082 esc_url($tooltip_text['url']),
5083 esc_html__( 'View Doc', 'wpvr' )
5084 );
5085 }
5086 }
5087 ?>
5088 </span>
5089 </div>
5090 <?php } ?>
5091
5092 </div>
5093
5094 <span class="wpvr-switcher">
5095 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5096 <label for="<?php echo esc_attr( $id ); ?>"></label>
5097 </span>
5098 </div>
5099 <?php if(isset($val['id']) && $val['id'] === 'wpvr_draggable') { ?>
5100 <div class="mouse-dragable-control-settings-wrapper">
5101 <?php WPVR_Meta_Field::render_mouse_dragable_control_data_wrapper_fields($postdata) ;?>
5102 </div>
5103 <?php } ?>
5104 <?php
5105 ob_end_flush();
5106 }
5107
5108 /**
5109 * Renders keyboard control related fields wrapped in a container
5110 *
5111 * This method fetches keyboard control fields using get_keyboard_control_data_wrapper_fields method
5112 * and renders each field using the appropriate rendering method based on field type.
5113 * Each field is rendered with an icon using the render_[field_type]_with_icon method.
5114 *
5115 * @param array $postdata Post data containing field values and configurations
5116 *
5117 * @return void Outputs HTML directly
5118 * @since 8.5.27
5119 */
5120 public static function render_mouse_dragable_control_data_wrapper_fields($postdata)
5121 {
5122 $fields = self::get_mouse_dragable_control_data_wrapper_fields($postdata);
5123 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5124 foreach($fields as $name => $val) {
5125 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5126 }
5127 }
5128
5129 /**
5130 * Get keyboard control data wrapper fields
5131 *
5132 * Retrieves the fields related to keyboard control settings by applying a filter.
5133 * This function is used to gather all the keyboard control options that can be modified.
5134 *
5135 * @param array $postdata The post data containing the current settings
5136 *
5137 * @return array Filtered array of keyboard control fields and their settings
5138 * @since 8.5.27
5139 */
5140 public static function get_mouse_dragable_control_data_wrapper_fields($postdata){
5141 return apply_filters('update_mouse_dragable_control_options', $postdata);
5142 }
5143
5144
5145 /**
5146 * Render Advanced Keyboard Zoom Control Field
5147 *
5148 * This function renders a checkbox toggle for keyboard zoom control with tooltip and
5149 * additional settings when enabled.
5150 *
5151 * @param string $name The name attribute for the input field
5152 * @param array $val Array of values containing field attributes and settings
5153 * @param array $postdata Post data containing all panorama settings
5154 *
5155 * @return void Outputs HTML for the keyboard zoom control field
5156 * @since 8.5.27
5157 */
5158 public static function render_advanced_mouse_zoom_control_field($name, $val, $postdata)
5159 {
5160 extract( $val );
5161 ob_start();
5162 ?>
5163 <div class="<?php echo esc_attr( $class ); ?>">
5164
5165 <div class="wpvr-tooltip-area">
5166 <span><?php echo esc_html( $title ) . ': '; ?></span>
5167
5168 <?php if(!empty($have_tooltip)) { ?>
5169 <div class="field-tooltip">
5170 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5171
5172 <span>
5173 <?php
5174 // Ensure tooltip_text text is set
5175 if (!empty($tooltip_text['text'])) {
5176 echo esc_html($tooltip_text['text']);
5177
5178 // Check if URL exists before rendering the link
5179 if (!empty($tooltip_text['url'])) {
5180 printf(
5181 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5182 esc_url($tooltip_text['url']),
5183 esc_html__( 'View Doc', 'wpvr' )
5184 );
5185 }
5186 }
5187 ?>
5188 </span>
5189 </div>
5190 <?php } ?>
5191
5192 </div>
5193
5194 <span class="wpvr-switcher">
5195 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5196 <label for="<?php echo esc_attr( $id ); ?>"></label>
5197 </span>
5198
5199
5200 </div>
5201 <?php if(isset($val['id']) && $val['id'] === 'wpvr_mouseZoom') { ?>
5202 <div class="mouse-zoom-control-settings-wrapper">
5203 <?php WPVR_Meta_Field::render_mouse_zoom_control_data_wrapper_fields($postdata) ;?>
5204 </div>
5205 <?php } ?>
5206 <?php
5207 ob_end_flush();
5208 }
5209
5210 /**
5211 * Render Advanced Keyboard Zoom Control Field
5212 *
5213 * This method renders a toggle switch for controlling keyboard zoom functionality in the VR panorama.
5214 * When enabled, it displays additional keyboard zoom control settings through the
5215 * render_keyboard_zoom_control_data_wrapper_fields method.
5216 *
5217 * @param string $name The HTML name attribute for the input field
5218 * @param array $val Array containing field configuration values including:
5219 * - class: CSS class for the field wrapper
5220 * - id: HTML ID for the input element
5221 * - title: Display title for the field
5222 * - value: Current value of the field ('on' or 'off')
5223 * - have_tooltip: Whether field has tooltip
5224 * - tooltip_text: Array with tooltip text and URL
5225 * @param array $postdata Complete panorama post data containing all settings
5226 *
5227 * @return void Outputs HTML for the keyboard zoom control field and its settings
5228 * @since 8.5.27
5229 */
5230 public static function render_mouse_zoom_control_data_wrapper_fields($postdata)
5231 {
5232 $fields = self::get_render_mouse_zoom_control_data_wrapper_fields_fields($postdata);
5233 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5234 foreach($fields as $name => $val) {
5235 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5236 }
5237 }
5238
5239 /**
5240 * Get keyboard zoom control fields configuration
5241 *
5242 * Retrieves the fields configuration for keyboard zoom control settings by applying
5243 * the 'updated_key_board_zoom_control_options' filter to the panorama post data.
5244 *
5245 * @param array $postdata The post data containing all panorama settings
5246 *
5247 * @return array An array of keyboard zoom control field configurations
5248 * @since 8.5.27
5249 */
5250 public static function get_render_mouse_zoom_control_data_wrapper_fields_fields($postdata)
5251 {
5252 return apply_filters('updated_mouse_zoom_control_options', $postdata);
5253 }
5254
5255 /**
5256 * Render Advanced Gyroscope Control Field
5257 *
5258 * This method renders a toggle switch for enabling/disabling gyroscope controls in VR panoramas.
5259 * When enabled, it displays additional gyroscope-specific settings through the
5260 * render_wpvr_gyro_data_wrapper_fields method.
5261 *
5262 * @param string $name The HTML name attribute for the input field
5263 * @param array $val Array of field configuration values including:
5264 * - class: CSS class for the field wrapper
5265 * - id: HTML ID for the input element
5266 * - title: Display title for the field
5267 * - value: Current value of the field ('on' or 'off')
5268 * - have_tooltip: Whether field has tooltip
5269 * - tooltip_text: Array with tooltip text and URL
5270 * @param array $postdata Complete panorama post data containing all settings
5271 *
5272 * @return void Outputs HTML for the gyroscope control field and its settings
5273 * @since 8.5.27
5274 */
5275 public static function render_advanced_gyro_control_field($name, $val, $postdata)
5276 {
5277 extract( $val );
5278 ob_start();
5279 ?>
5280 <div class="<?php echo esc_attr( $class ); ?>">
5281
5282 <div class="wpvr-tooltip-area">
5283 <span><?php echo esc_html( $title ) . ': '; ?></span>
5284
5285 <?php if(!empty($have_tooltip)) { ?>
5286 <div class="field-tooltip">
5287 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5288
5289 <span>
5290 <?php
5291 // Ensure tooltip_text text is set
5292 if (!empty($tooltip_text['text'])) {
5293 echo esc_html($tooltip_text['text']);
5294
5295 // Check if URL exists before rendering the link
5296 if (!empty($tooltip_text['url'])) {
5297 printf(
5298 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5299 esc_url($tooltip_text['url']),
5300 esc_html__( 'View Doc', 'wpvr' )
5301 );
5302 }
5303 }
5304 ?>
5305 </span>
5306 </div>
5307 <?php } ?>
5308
5309 </div>
5310
5311 <span class="wpvr-switcher">
5312 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5313 <label for="<?php echo esc_attr( $id ); ?>"></label>
5314 </span>
5315
5316
5317 </div>
5318 <?php if(isset($val['id']) && $val['id'] === 'wpvr_gyro') { ?>
5319 <div class="zyro-settings-wrapper">
5320 <?php WPVR_Meta_Field::render_wpvr_gyro_data_wrapper_fields($postdata) ;?>
5321 </div>
5322 <?php } ?>
5323 <?php
5324 ob_end_flush();
5325 }
5326
5327 /**
5328 * Renders gyroscope control settings fields
5329 *
5330 * This method fetches the gyroscope control configuration fields using
5331 * get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields and renders each field
5332 * using the appropriate render method based on the field type.
5333 *
5334 * @param array $postdata The post data containing all panorama settings
5335 *
5336 * @return void Outputs HTML for the gyroscope control settings fields
5337 * @since 8.5.27
5338 */
5339 public static function render_wpvr_gyro_data_wrapper_fields($postdata)
5340 {
5341 $fields = self::get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields($postdata);
5342 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5343 foreach($fields as $name => $val) {
5344 if('pro_checkbox' === $val['type']){
5345 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5346 }else{
5347 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5348 }
5349
5350 }
5351 }
5352
5353 /**
5354 * Get gyroscope control fields configuration data
5355 *
5356 * Retrieves the fields configuration for gyroscope control settings by applying
5357 * the 'updated_gyro_control_options' filter to the panorama post data.
5358 *
5359 * @param array $postdata The post data containing all panorama settings
5360 *
5361 * @return array An array of gyroscope control field configurations
5362 * @since 8.5.27
5363 */
5364 public static function get_render_wpvr_gyro_data_wrapper_fields_data_wrapper_fields($postdata)
5365 {
5366 return apply_filters('updated_gyro_control_options', $postdata);
5367 }
5368
5369 /**
5370 * Render Advanced Scene Gallery Control Field
5371 *
5372 * This method renders a toggle switch for enabling/disabling scene gallery in VR panoramas.
5373 * When enabled, it displays additional scene gallery settings through the
5374 * render_wpvr_scene_gallery_data_wrapper_fields method.
5375 *
5376 * @param string $name The HTML name attribute for the input field
5377 * @param array $val Array of field configuration values including:
5378 * - class: CSS class for the field wrapper
5379 * - id: HTML ID for the input element
5380 * - title: Display title for the field
5381 * - value: Current value of the field ('on' or 'off')
5382 * - have_tooltip: Whether field has tooltip
5383 * - tooltip_text: Array with tooltip text and URL
5384 * @param array $postdata Complete panorama post data containing all settings
5385 *
5386 * @return void Outputs HTML for the scene gallery control field and its settings
5387 * @since 8.5.27
5388 */
5389 public static function render_advanced_setting_scene_gallery_field($name, $val, $postdata)
5390 {
5391 extract( $val );
5392 ob_start();
5393 ?>
5394 <div class="<?php echo esc_attr( $class ); ?>">
5395
5396 <div class="wpvr-tooltip-area">
5397 <span><?php echo esc_html( $title ) . ': '; ?></span>
5398 <?php if(!empty($have_tooltip)) { ?>
5399 <div class="field-tooltip">
5400 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5401
5402 <span>
5403 <?php
5404 // Ensure tooltip_text text is set
5405 if (!empty($tooltip_text['text'])) {
5406 echo esc_html($tooltip_text['text']);
5407
5408 // Check if URL exists before rendering the link
5409 if (!empty($tooltip_text['url'])) {
5410 printf(
5411 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5412 esc_url($tooltip_text['url']),
5413 esc_html__( 'View Doc', 'wpvr' )
5414 );
5415 }
5416 }
5417 ?>
5418 </span>
5419 </div>
5420 <?php } ?>
5421 </div>
5422
5423 <span class="wpvr-switcher">
5424 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5425 <label for="<?php echo esc_attr( $id ); ?>"></label>
5426 </span>
5427
5428
5429 </div>
5430 <?php if(isset($val['id']) && $val['id'] === 'wpvr_vrgallery') { ?>
5431 <div class="scene-gallery-settings-wrapper">
5432 <?php WPVR_Meta_Field::render_wpvr_scene_gallery_data_wrapper_fields($postdata) ;?>
5433 </div>
5434 <?php } ?>
5435 <?php
5436 ob_end_flush();
5437 }
5438
5439 /**
5440 * Renders scene gallery control settings fields
5441 *
5442 * This method retrieves the scene gallery configuration fields and renders each field
5443 * using the appropriate render method based on the field type.
5444 *
5445 * @param array $postdata The complete panorama post data containing all settings
5446 *
5447 * @return void Outputs HTML for the scene gallery settings fields
5448 * @since 8.5.27
5449 */
5450 public static function render_wpvr_scene_gallery_data_wrapper_fields($postdata)
5451 {
5452 $fields = self::get_render_wpvr_scene_gallery_data_wrapper_fields($postdata);
5453 foreach($fields as $name => $val) {
5454 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5455 }
5456 }
5457
5458 /**
5459 * Get scene gallery control fields configuration
5460 *
5461 * Retrieves the fields configuration for scene gallery settings by applying
5462 * the 'updated_scene_gallery_control_options' filter to the panorama post data.
5463 *
5464 * @param array $postdata The post data containing all panorama settings
5465 *
5466 * @return array An array of scene gallery control field configurations
5467 * @since 8.5.27
5468 */
5469 public static function get_render_wpvr_scene_gallery_data_wrapper_fields($postdata)
5470 {
5471 return apply_filters('updated_scene_gallery_control_options', $postdata);
5472 }
5473
5474 /**
5475 * Render Advanced Explainer Video Control Field
5476 *
5477 * This method renders a toggle switch for enabling/disabling explainer video in VR panoramas.
5478 * When enabled, it displays additional explainer video settings through the
5479 * render_advanced_setting_explainer_video_data_wrapper_fields method.
5480 *
5481 * @param string $name The HTML name attribute for the input field
5482 * @param array $val Array of field configuration values including:
5483 * - class: CSS class for the field wrapper
5484 * - id: HTML ID for the input element
5485 * - title: Display title for the field
5486 * - value: Current value of the field ('on' or 'off')
5487 * - have_tooltip: Whether field has tooltip
5488 * - tooltip_text: Array with tooltip text and URL
5489 * @param array $postdata Complete panorama post data containing all settings
5490 *
5491 * @return void Outputs HTML for the explainer video control field and its settings
5492 * @since 8.5.27
5493 */
5494 public static function render_advanced_setting_explainer_video_field($name, $val, $postdata)
5495 {
5496 extract( $val );
5497 ob_start();
5498 ?>
5499 <div class="<?php echo esc_attr( $class ); ?>">
5500
5501 <div class="wpvr-tooltip-area">
5502 <span><?php echo esc_html( $title ) . ': '; ?></span>
5503
5504 <?php if(!empty($have_tooltip)) { ?>
5505 <div class="field-tooltip">
5506 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5507
5508 <span>
5509 <?php
5510 // Ensure tooltip_text text is set
5511 if (!empty($tooltip_text['text'])) {
5512 echo esc_html($tooltip_text['text']);
5513
5514 // Check if URL exists before rendering the link
5515 if (!empty($tooltip_text['url'])) {
5516 printf(
5517 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5518 esc_url($tooltip_text['url']),
5519 esc_html__( 'View Doc', 'wpvr' )
5520 );
5521 }
5522 }
5523 ?>
5524 </span>
5525 </div>
5526 <?php } ?>
5527
5528 </div>
5529
5530 <span class="wpvr-switcher">
5531 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5532 <label for="<?php echo esc_attr( $id ); ?>"></label>
5533 </span>
5534
5535
5536
5537 </div>
5538 <?php if(isset($val['id']) && $val['id'] === 'wpvr_explainerSwitch') { ?>
5539 <div class="explainer-video-settings-wrapper">
5540 <?php WPVR_Meta_Field::render_advanced_setting_explainer_video_data_wrapper_fields($postdata) ;?>
5541 </div>
5542 <?php } ?>
5543 <?php
5544 ob_end_flush();
5545 }
5546
5547 /**
5548 * Renders explainer video control settings fields
5549 *
5550 * This method retrieves the explainer video configuration fields and renders each field
5551 * using the appropriate render method based on the field type.
5552 *
5553 * @param array $postdata The complete panorama post data containing all settings
5554 *
5555 * @return void Outputs HTML for the explainer video settings fields
5556 * @since 8.5.27
5557 */
5558 public static function render_advanced_setting_explainer_video_data_wrapper_fields($postdata)
5559 {
5560 $fields = self::get_render_advanced_setting_explainer_video_data_wrapper_fields($postdata);
5561 $layout = ( is_array($postdata) && isset($postdata['tourLayout']['layout']) ) ? $postdata['tourLayout']['layout'] : '';
5562 foreach($fields as $name => $val) {
5563 if('pro_checkbox' == $val['type']){
5564 self::{ 'render_' . $val['type'] . '_with_icon' }( $name, $val, $layout );
5565 }else{
5566 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5567 }
5568 }
5569 }
5570
5571 /**
5572 * Get explainer video control fields configuration
5573 *
5574 * Retrieves the fields configuration for explainer video settings by applying
5575 * the 'updated_explainer_video_control_options' filter to the panorama post data.
5576 *
5577 * @param array $postdata The post data containing all panorama settings
5578 *
5579 * @return array An array of explainer video control field configurations
5580 * @since 8.5.27
5581 */
5582 public static function get_render_advanced_setting_explainer_video_data_wrapper_fields($postdata)
5583 {
5584 return apply_filters('updated_explainer_video_control_options', $postdata);
5585 }
5586
5587 /**
5588 * Render Advanced Set Zoom Preference Control Field
5589 *
5590 * This method renders a toggle switch for enabling/disabling zoom preference in VR panoramas.
5591 * When enabled, it displays additional zoom preference settings through the
5592 * render_wpvr_set_zoom_control_data_wrapper_fields method.
5593 *
5594 * @param string $name The HTML name attribute for the input field
5595 * @param array $val Array of field configuration values including:
5596 * - class: CSS class for the field wrapper
5597 * - id: HTML ID for the input element
5598 * - title: Display title for the field
5599 * - value: Current value of the field ('on' or 'off')
5600 * - have_tooltip: Whether field has tooltip
5601 * - tooltip_text: Array with tooltip text and URL
5602 * @param array $postdata Complete panorama post data containing all settings
5603 *
5604 * @return void Outputs HTML for the set zoom preference control field and its settings
5605 * @since 8.5.27
5606 */
5607 public static function render_advanced_setting_set_zoom_preference_field($name, $val, $postdata)
5608 {
5609 extract( $val );
5610 ob_start();
5611 ?>
5612 <div class="<?php echo esc_attr( $class ); ?>">
5613 <div class="wpvr-tooltip-area">
5614 <span><?php echo esc_html( $title ) . ': '; ?></span>
5615
5616 <?php if(!empty($have_tooltip)) { ?>
5617 <div class="field-tooltip">
5618 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5619
5620 <span>
5621 <?php
5622 // Ensure tooltip_text text is set
5623 if (!empty($tooltip_text['text'])) {
5624 echo esc_html($tooltip_text['text']);
5625
5626 // Check if URL exists before rendering the link
5627 if (!empty($tooltip_text['url'])) {
5628 printf(
5629 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5630 esc_url($tooltip_text['url']),
5631 esc_html__( 'View Doc', 'wpvr' )
5632 );
5633 }
5634 }
5635 ?>
5636 </span>
5637 </div>
5638 <?php } ?>
5639
5640
5641 </div>
5642
5643 <span class="wpvr-switcher">
5644 <input id="<?php echo esc_attr( $id ); ?>" class="vr-switcher-check" value="<?php echo esc_attr( $value ); ?>" name="<?php echo esc_attr( $name ); ?>" type="checkbox" <?php if($value == 'on') { echo'checked'; } ?> />
5645 <label for="<?php echo esc_attr( $id ); ?>"></label>
5646 </span>
5647
5648
5649 </div>
5650 <?php if(isset($val['id']) && $val['id'] === 'wpvr_globalzoom') { ?>
5651 <div class="set-zoom-perference-control-settings-wrapper">
5652 <?php WPVR_Meta_Field::render_wpvr_set_zoom_control_data_wrapper_fields($postdata) ;?>
5653 </div>
5654 <?php } ?>
5655 <?php
5656 ob_end_flush();
5657 }
5658
5659 /**
5660 * Renders set zoom preference control settings fields
5661 *
5662 * This method retrieves the set zoom preference configuration fields and renders each field
5663 * using the appropriate render method based on the field type.
5664 *
5665 * @param array $postdata The complete panorama post data containing all settings
5666 *
5667 * @return void Outputs HTML for the set zoom preference settings fields
5668 * @since 8.5.27
5669 */
5670 public static function render_wpvr_set_zoom_control_data_wrapper_fields($postdata)
5671 {
5672 $fields = self::get_render_wpvr_set_zoom_control_data_wrapper_fields($postdata);
5673 foreach($fields as $name => $val) {
5674 self::{ 'render_' . $val['type'] . '_field' }( $name, $val );
5675 }
5676 }
5677
5678 /**
5679 * Get set zoom preference control fields configuration
5680 *
5681 * Retrieves the fields configuration for set zoom preference settings by applying
5682 * the 'updated_set_zoom_preference_control_options' filter to the panorama post data.
5683 *
5684 * @param array $postdata The post data containing all panorama settings
5685 *
5686 * @return array An array of set zoom preference control field configurations
5687 * @since 8.5.27
5688 */
5689 public static function get_render_wpvr_set_zoom_control_data_wrapper_fields($postdata)
5690 {
5691 return apply_filters('updated_zoom_control_options', $postdata);
5692 }
5693
5694 /**
5695 * Render Pro Inner Scene Gallery Icon Size Field
5696 *
5697 * This method renders a toggle switch for enabling/disabling the large/small icon size for the inner scene gallery.
5698 *
5699 * @param string $name The HTML name attribute for the input field
5700 * @param array $val Array of field configuration values including:
5701 * - class: CSS class for the field wrapper
5702 * - id: HTML ID for the input element
5703 * - title: Display title for the field
5704 * - value: Current value of the field ('on' or 'off')
5705 * - have_tooltip: Whether field has tooltip
5706 * - tooltip_text: Array with tooltip text and URL
5707 *
5708 * @return void Outputs HTML for the pro inner scene gallery icon size field
5709 * @since 8.5.27
5710 */
5711 public static function render_pro_inner_scene_gallery_icon_size_field($name, $val){
5712 extract($val);
5713 ob_start();
5714 $default_type = array(
5715 'on' => __('Large', 'wpvr'),
5716 'off' => __('Small', 'wpvr'),
5717 );
5718 ?>
5719
5720 <div class='single-settings'>
5721 <div class="wpvr-tooltip-area">
5722 <span for="scene-gallery-icon-size-name"><?php echo esc_html( $title ) . ': '; ?></span>
5723 <?php if(!empty($have_tooltip)) { ?>
5724 <div class="field-tooltip">
5725 <img loading="lazy" src="<?php echo esc_url( WPVR_PLUGIN_DIR_URL . 'admin/icon/tooltip-icon.svg' ); ?>" alt="icon" />
5726
5727 <span>
5728 <?php
5729 // Ensure tooltip_text text is set
5730 if (!empty($tooltip_text['text'])) {
5731 echo esc_html($tooltip_text['text']);
5732
5733 // Check if URL exists before rendering the link
5734 if (!empty($tooltip_text['url'])) {
5735 printf(
5736 ' <a href="%s" target="_blank" rel="noopener noreferrer">%s</a>',
5737 esc_url($tooltip_text['url']),
5738 esc_html__( 'View Doc', 'wpvr' )
5739 );
5740 }
5741 }
5742 ?>
5743 </span>
5744 </div>
5745 <?php } ?>
5746 </div>
5747
5748 <select class='scene-gallery-icon-size-name' name="<?php echo esc_attr( $name ); ?>">
5749 <?php
5750 foreach ($default_type as $key => $type) {
5751 echo sprintf("<option %s value='%s'>%s</option>\n", selected($key, $value, true), esc_attr($key), esc_attr($type));
5752 } ?>
5753 </select>
5754 </div>
5755
5756 <?php
5757 ob_end_flush();
5758 }
5759
5760 }