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-general.php

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

189 lines 7.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit; // Exit if accessed directly
3 /**
4 * Responsible for managing General tab content
5 *
6 * @link http://rextheme.com/
7 * @since 8.0.0
8 *
9 * @package Wpvr
10 * @subpackage Wpvr/admin/classes
11 */
12
13 class WPVR_General extends WPVR_Tour_setting {
14
15 /**
16 * Instance of WPVR_Advanced_control class
17 *
18 * @var object
19 * @since 8.0.0
20 */
21 private $advanced_control;
22
23 /**
24 * Instance of WPVR_Basic_Setting class
25 *
26 * @var object
27 * @since 8.0.0
28 */
29 private $basic_setting;
30
31 function __construct()
32 {
33 $this->advanced_control = WPVR_Advanced_Control::get_instance();
34
35 $this->basic_setting = new WPVR_Basic_Setting();
36
37 }
38
39 /**
40 * Render General Tab Content
41 * @param mixed $preview
42 * @param mixed $previewtext
43 * @param mixed $autoload
44 * @param mixed $control
45 * @param mixed $postdata
46 * @param mixed $autorotation
47 * @param mixed $autorotationinactivedelay
48 * @param mixed $autorotationstopdelay
49 *
50 * @return void
51 */
52 public function render_setting($postdata)
53 {
54 ob_start();
55 ?>
56
57 <!-- start inner tab -->
58 <div class="general-inner-tab">
59 <!-- start inner nav -->
60 <?php WPVR_Meta_Field::render_general_inner_navigation() ?>
61 <!-- end inner nav -->
62
63 <!-- start inner tab content -->
64 <div class="inner-nav-content">
65
66 <?php $this->basic_setting->render_basic_setting($postdata); ?>
67
68 <?php WPVR_Advanced_Control::render($postdata); ?>
69
70 </div>
71 <!-- end inner tab content -->
72
73 <!-- Embed Iframe -->
74 <?php if (apply_filters('is_wpvr_embed_addon_premium', false)) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
75 $post = get_post(); $id = $post->ID;?>
76
77 <div class="wpvr-use-shortcode">
78 <h4 class="area-title"><?php echo esc_html__( 'Using this Tour', 'wpvr' ); ?></h4>
79
80 <div class="wpvr-shortcode-wrapper">
81
82 <div class="wpvr-single-shortcode gutenberg">
83
84 <span class="shortcode-title"><?php esc_html_e('To Embed on External Page:','wpvr'); ?></span>
85
86 <div class="field-wapper">
87
88 <span><?php esc_html_e('Use the iframe below to share this tour on an external page.','wpvr'); ?></span><br>
89 <span style="color:red;">
90 <?php esc_html_e('Note: WooCommerce &amp; Fluent Forms hotspots will not be supported on embedded tours.','wpvr'); ?>
91 </span>
92
93 <div class="wpvr-shortcode-field">
94 <p class="copycode">&lt;iframe src="<?php echo esc_url( home_url() ); ?>/?embed_page=<?php echo esc_attr( $id ); ?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen width="100%" height="400" title="<?php echo esc_attr( $post->post_title ); ?>" description="Take a realistic tour within Lupos Bistro as if you are actually there - powered by WPVR.">&lt;/iframe&gt;</p>
95 </div>
96
97 </div>
98 <!-- .field-wrapper end -->
99
100 </div>
101 <!-- wpvr-single-shortcode gutenberg end -->
102 <div class="wpvr-embaded-share-wrapper">
103 <div class="wpvr-social-share-area">
104
105 <h4><?php esc_html_e('Share your tour','wpvr'); ?></h4>
106
107 <div class="wpvr-social-share-btn-area">
108
109 <div class="single-settings autoload">
110 <span> <?php esc_html_e('Enable Social Media Share','wpvr'); ?>: </span>
111 <span class="wpvr-switcher">
112 <input id="wpvr_social_share" class="vr-switcher-check" name="wpvr_social_share" type="checkbox" value="<?php echo esc_attr( WPVR_Helper::is_enable_social_share($postdata) ); ?>" <?php echo WPVR_Helper::is_enable_social_share($postdata) == 'on' ? esc_attr('checked') : ''; ?> >
113 <label for="wpvr_social_share"></label>
114 </span>
115 </div>
116 <div class="wpvr-share-buttons-container">
117 <div class="share-list">
118 <?php WPVR_Helper::social_media_share_links_display(home_url().'/?embed_page='. $id); ?>
119 </div>
120 </div>
121 </div>
122
123 </div>
124
125 <div class="wpvr-qrcode-area">
126
127 <h4><?php esc_html_e('Create a tour use this QR code','wpvr'); ?></h4>
128
129 <div class="wpvr-qrcode-btn-area">
130 <div class="wpvr-qrcode-btn-section">
131 <div id="qrcode" class="wpvr-qrcode"></div>
132 <button id="downloadBtn" class="wpvr-download-btn"><?php esc_html_e('Download QR Code','wpvr'); ?></button>
133 </div>
134
135 </div>
136
137 </div>
138 </div>
139 <!-- .wpvr-qrcode-area end -->
140 </div>
141 <!-- wpvr-shortcode-wrapper end -->
142
143 </div>
144 <!-- wpvr-use-shortcode end -->
145
146 <script>
147 jQuery(document).ready(function($) {
148 // Generate QR code
149 var qr = new QRCode(document.getElementById("qrcode"), {
150 text: "<?php echo esc_js( home_url() ); ?>/?embed_page=<?php echo esc_js( $id ); ?>",// Replace with your desired URL or data
151 width: 128,
152 height: 128
153 });
154
155 // Handle download button click
156 $("#downloadBtn").on("click", function(e) {
157 e.preventDefault(); // Prevent the default behavior of the button
158
159 // Convert the QR code to a data URL
160 var dataURL = $("#qrcode canvas")[0].toDataURL("image/jpeg");
161
162 // Create a download link dynamically
163 var downloadLink = document.createElement("a");
164 downloadLink.href = dataURL;
165 downloadLink.download = "qrcode.jpg";
166
167 // Append the link to the body and trigger a click event
168 document.body.appendChild(downloadLink);
169 downloadLink.click();
170
171 // Remove the link from the body
172 document.body.removeChild(downloadLink);
173
174 });
175 });
176
177
178
179 </script>
180 <?php } ?>
181 <!-- End Embed Iframe -->
182 </div>
183 <!-- end inner tab -->
184
185 <?php
186 ob_end_flush();
187 }
188
189 }