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

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

265 lines 9.9 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 * Setup meta box related functionalities
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_Setup_Meta_Box extends WPVR_Meta_Box {
14
15 /**
16 * @var string
17 * @since 8.0.0
18 */
19 protected $title = '';
20
21 /**
22 * Metabox ID
23 *
24 * @var string
25 * @since 8.0.0
26 */
27 protected $slug = '';
28
29 /**
30 * @var string
31 * @since 8.0.0
32 */
33 protected $post_type = '';
34
35 /**
36 * Metabox context
37 *
38 * @var string
39 * @since 8.0.0
40 */
41 protected $context = '';
42
43 /**
44 * Metabox priority
45 *
46 * @var string
47 * @since 8.0.0
48 */
49 protected $priority = '';
50
51 /**
52 * Instance of WPVR_Scene class
53 *
54 * @var object
55 * @since 8.0.0
56 */
57 protected $scene;
58
59 /**
60 * Instance of WPVR_Video class
61 *
62 * @var object
63 * @since 8.0.0
64 */
65 protected $video;
66
67 /**
68 * Instance of WPVR_General class
69 *
70 * @var object
71 * @since 8.0.0
72 */
73 protected $general;
74
75
76 public function __construct( $slug, $title, $post_type, $context, $priority ) {
77 if( $slug == '' || $context == '' || $priority == '' ) {
78 return;
79 }
80
81 if( $title == '' ) {
82 $this->title = ucfirst( $slug );
83 }
84
85 if( empty( $post_type ) ) {
86 return;
87 }
88
89 $this->title = $title;
90 $this->slug = $slug;
91 $this->post_type = $post_type;
92 $this->context = $context;
93 $this->priority = $priority;
94
95 $this->scene = new WPVR_Scene();
96 $this->video = new WPVR_Video();
97 $this->general = new WPVR_General();
98
99 add_action( 'add_meta_boxes', array( $this, 'register' ) );
100 }
101
102
103 /**
104 * Register custom meta box
105 *
106 * @param string $post_type
107 *
108 * @return void
109 * @since 8.0.0
110 */
111 public function register( $post_type ) {
112 if ( $post_type == $this->post_type ) {
113 add_meta_box( $this->slug, $this->title, array( $this, 'render' ), $post_type, $this->context, $this->priority );
114 }
115 }
116
117
118 /**
119 * Render custom meta box
120 *
121 * @param object $post
122 *
123 * @return void
124 * @since 8.0.0
125 */
126 public function render( $post ) {
127
128 $primary = WPVR_Meta_Field::get_primary_meta_fields();
129 $post_meta_data = get_post_meta($post->ID, 'panodata', true);
130 $post_meta_data = (is_array($post_meta_data)) ? $post_meta_data : array($post_meta_data);
131
132 $postdata = array_merge($primary, $post_meta_data);
133 // active tab variables
134 $active_tab = 'scene';
135 $scene_active_tab = 1;
136 $hotspot_active_tab = 1;
137 if (isset($_GET['active_tab'])) {
138 $active_tab = sanitize_text_field($_GET['active_tab']);
139 }
140 if (isset($_GET['scene'])) {
141 $scene_active_tab = sanitize_text_field($_GET['scene']);
142 }
143 if (isset($_GET['hotspot'])) {
144 $hotspot_active_tab = sanitize_text_field($_GET['hotspot']);
145 }
146
147 // Start custom meta box rendering
148 ob_start();
149
150 ?>
151
152 <div class="pano-setup">
153
154 <input type="hidden" value="<?php echo esc_attr($active_tab);?>" name="wpvr_active_tab" id="wpvr_active_tab"/>
155 <input type="hidden" value="<?php echo esc_attr($scene_active_tab);?>" name="wpvr_active_scenes" id="wpvr_active_scenes"/>
156 <input type="hidden" value="<?php echo esc_attr($hotspot_active_tab);?>" name="wpvr_active_hotspot" id="wpvr_active_hotspot"/>
157
158 <!-- start rex-pano-tabs -->
159 <div class="rex-pano-tabs">
160
161 <?php WPVR_Meta_Field::render_pano_tab_nav($postdata); ?>
162 <!-- start rex-pano-tab-content -->
163 <div class="rex-pano-tab-content" id="wpvr-main-tab-contents">
164
165 <!-- start scenes tab -->
166 <div class="rex-pano-tab wpvr_scene active" id="scenes">
167 <?php
168 $this->scene->render_scene($postdata);
169 ?>
170 </div>
171
172 <!-- start general tab -->
173 <div class="rex-pano-tab general" id="general">
174 <?php
175 $this->general->render_setting($postdata);
176 ?>
177 </div>
178
179 <!-- start video tab content -->
180 <div class="rex-pano-tab video" id="video">
181 <?php
182 $this->video->render_video($postdata);
183 ?>
184 </div>
185
186 <!-- This hook will render floor plan tab content -->
187 <?php do_action( 'include_floor_plan_meta_content', $postdata )?>
188
189 <!-- This hook will render background Tour tab content -->
190 <?php do_action( 'include_background_tour_meta_content', $postdata )?>
191
192 <!-- This hook will render Street View tab content -->
193 <?php do_action( 'include_street_view_meta_content', $postdata )?>
194
195 <?php do_action( 'include_export_meta_content', $postdata, $post )?>
196
197 </div>
198 <!-- end rex-pano-tab-content -->
199 </div>
200 <!-- end rex-pano-tabs -->
201
202 <div class="wpvr-help-resource">
203 <div class="wpvr-help-resource__playlist">
204 <span class="wpvr-help-resource__video-section">
205 <svg class="wpvr-help-resource__video-icon" xmlns="http://www.w3.org/2000/svg" width="13" height="14" viewBox="0 0 13 14" fill="none">
206 <path d="M11.2225 6.51521L11.2244 6.5163C11.59 6.73102 11.5918 7.26492 11.2235 7.4819L11.2227 7.4824L1.59806 13.1697L1.59703 13.1703C1.22418 13.3914 0.75 13.1232 0.75 12.6861V1.30884C0.75 1.03617 0.875311 0.890942 1.03011 0.814073C1.21377 0.722878 1.43862 0.731136 1.59792 0.825199C1.59797 0.825226 1.59802 0.825253 1.59806 0.82528L11.2225 6.51521Z" stroke="#73707D" stroke-width="1.5"/>
207 </svg>
208 <p class="wpvr-help-resource__video-title"><?php esc_html_e('Video', 'wpvr') ?></p>
209 </span>
210 </div>
211
212 <div class="wpvr-help-resource__dropdown">
213 <div class="wpvr-help-resource__dropdown-section" id="wpvr-help-resource__dropdown-section">
214 <svg width="12" height="18" fill="none" viewBox="0 0 12 18" class="wpvr-help-resource__dropdown-icon">
215 <path fill="#7A8B9A" d="M5.438 13.604a.646.646 0 01-.646-.647c0-.846.12-1.576.358-2.19.176-.464.46-.93.851-1.402.288-.344.804-.845 1.55-1.503.747-.659 1.232-1.183 1.456-1.574a2.53 2.53 0 00.335-1.282c0-.839-.328-1.574-.982-2.209-.654-.635-1.456-.952-2.407-.952-.918 0-1.685.288-2.299.863-.449.42-.786 1.013-1.01 1.779a1.121 1.121 0 01-1.209.796A1.122 1.122 0 01.49 3.854c.302-1.023.808-1.848 1.518-2.474C2.993.507 4.296.072 5.918.072c1.715 0 3.084.467 4.107 1.401 1.022.935 1.532 2.064 1.532 3.39 0 .766-.18 1.473-.539 2.118-.358.647-1.062 1.433-2.107 2.36-.702.622-1.161 1.082-1.377 1.377a3.05 3.05 0 00-.48 1.018c-.076.284-.129.702-.158 1.25a.652.652 0 01-.65.617h-.808v.001zM4.672 16.7a1.228 1.228 0 112.455 0 1.228 1.228 0 01-2.455 0z"></path>
216 </svg>
217 </div>
218
219 <ul class="wpvr-help-resource__dropdown-list" id="wpvr-help-resource__dropdown-list">
220 <li class="wpvr-help-resource__dropdown-item"><a target="_blank" href="https://rextheme.com/docs-category/wp-vr/" class="wpvr-help-resource__dropdown-link">Documentation</a></li>
221 <!-- <li class="wpvr-help-resource__dropdown-item"><a target="_blank" href="#" class="wpvr-help-resource__dropdown-link">Social Group</a></li> -->
222 <li class="wpvr-help-resource__dropdown-item"><a target="_blank" href="https://www.youtube.com/watch?v=aNwB066MYko&list=PLelDqLncNWcUndi1NkXJh2BH62OYmIayt&ab_channel=RexTheme" class="wpvr-help-resource__dropdown-link">YouTube Video</a></li>
223 </ul>
224 </div>
225
226 </div>
227
228 <!-- End Help Resource -->
229
230 <div class="wpvr-iframe-modal">
231 <div class="wpvr-iframe-modal__content">
232 <span type="button" class="wpvr-iframe-modal__cross-icon">
233 <svg width="10" height="10" fill="none" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
234 <path fill="#686f7f" d="M.948 9.995a.94.94 0 01-.673-.23.966.966 0 010-1.352L8.317.278a.94.94 0 011.339.045c.323.35.342.887.044 1.258L1.611 9.765a.94.94 0 01-.663.23z"></path>
235 <path fill="#686f7f" d="M8.98 9.995a.942.942 0 01-.664-.278L.275 1.582A.966.966 0 01.378.23a.939.939 0 011.232 0L9.7 8.366a.966.966 0 010 1.399.94.94 0 01-.72.23z"></path>
236 </svg>
237 </span>
238
239 <iframe
240 class="video-link"
241 width="560"
242 height="315"
243 src="https://www.youtube.com/embed/kKHUlVKtesQ"
244 title="YouTube video player"
245 frameborder="0"
246 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
247 id ="wpvr-help-video-iframe"
248 allowfullscreen>
249 </iframe>
250
251
252 </div>
253 </div>
254
255
256
257 </div>
258 <div class="wpvr-loading" style="display:none;">Loading&#8230;</div>
259
260 <?php
261 // ob_end_flush();
262 // End custom meta box rendering
263 }
264
265 }