WP VR – 360 Panorama and virtual tour creator for WordPress - Version 6.8.0

Version Description

(22-10-2020) = * Display gallery by default on the tour

=

Download this release

Release Info

Developer rextheme
Plugin Icon 128x128 WP VR – 360 Panorama and virtual tour creator for WordPress
Version 6.8.0
Comparing to
See all releases

Code changes from version 6.7.0 to 6.8.0

README.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://rextheme.com/wp-vr-360-panorama-and-virtual-tour-creator-fo
5
  Requires at least: 5.0
6
  Tested up to: 5.5.1
7
  Requires PHP: 7.0.0
8
- Stable tag: 6.7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -545,5 +545,8 @@ Simply add “/plugins/wpvr” to the exclusion field (or use the location where
545
  * Mobile media resizer switch added
546
  * Ocean theme conflict fixed
547
 
 
 
 
548
  == Upgrade Notice ==
549
  Please do update the WP VR to the latest version. Each update makes sure your plugin is supporting all tour features.
5
  Requires at least: 5.0
6
  Tested up to: 5.5.1
7
  Requires PHP: 7.0.0
8
+ Stable tag: 6.8.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
545
  * Mobile media resizer switch added
546
  * Ocean theme conflict fixed
547
 
548
+ = 6.8.0 (22-10-2020) =
549
+ * Display gallery by default on the tour
550
+
551
  == Upgrade Notice ==
552
  Please do update the WP VR to the latest version. Each update makes sure your plugin is supporting all tour features.
admin/class-wpvr-admin.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 
 
3
  /**
4
  * The admin-specific functionality of the plugin.
5
  *
@@ -20,135 +22,136 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
20
  * @subpackage Wpvr/admin
21
  * @author Rextheme <sakib@coderex.co>
22
  */
23
- class Wpvr_Admin {
24
-
25
- /**
26
- * The ID of this plugin.
27
- *
28
- * @since 1.0.0
29
- * @access private
30
- * @var string $plugin_name The ID of this plugin.
31
- */
32
- private $plugin_name;
33
-
34
- /**
35
- * The version of this plugin.
36
- *
37
- * @since 1.0.0
38
- * @access private
39
- * @var string $version The current version of this plugin.
40
- */
41
- private $version;
42
-
43
- /**
44
- * The post type of this plugin.
45
- *
46
- * @since 1.0.0
47
- */
48
- private $post_type;
49
-
50
- /**
51
- * Initialize the class and set its properties.
52
- *
53
- * @since 1.0.0
54
- * @param string $plugin_name The name of this plugin.
55
- * @param string $version The version of this plugin.
56
- */
57
- public function __construct( $plugin_name, $version, $post_type ) {
58
-
59
- $this->plugin_name = $plugin_name;
60
- $this->version = $version;
61
- $this->post_type = $post_type;
62
- }
63
-
64
- /**
65
- * Register the stylesheets for the admin area.
66
- *
67
- * @since 1.0.0
68
- */
69
- public function enqueue_styles() {
70
-
71
- /**
72
- * This function is provided for demonstration purposes only.
73
- *
74
- * An instance of this class should be passed to the run() function
75
- * defined in Wpvr_Loader as all of the hooks are defined
76
- * in that particular class.
77
- *
78
- * The Wpvr_Loader will then create the relationship
79
- * between the defined hooks and the functions defined in this
80
- * class.
81
- */
82
-
83
- $screen = get_current_screen();
84
- if ($screen->id=="toplevel_page_wpvr") {
85
- wp_enqueue_style( 'materialize-css', plugin_dir_url( __FILE__ ) . 'css/materialize.min.css', array(), $this->version, 'all' );
86
- wp_enqueue_style( 'materialize-icons', plugin_dir_url( __FILE__ ) . 'lib/materializeicon.css', array(), $this->version, 'all' );
87
- wp_enqueue_style( 'owl-css', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css', array(), $this->version, 'all' );
88
-
89
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-admin.css', array(), $this->version, 'all' );
90
- }
91
-
92
- if ($screen->id=="wpvr_item") {
93
-
94
- wp_enqueue_style( $this->plugin_name . 'fontawesome', plugin_dir_url( __FILE__ ) . 'lib/fontawesome/css/all.css', array(), $this->version, 'all' );
95
- wp_enqueue_style( 'icon-picker-css', plugin_dir_url( __FILE__ ) . 'css/jquery.fonticonpicker.min.css', array(), $this->version, 'all' );
96
- wp_enqueue_style( 'icon-picker-css-theme', plugin_dir_url( __FILE__ ) . 'css/jquery.fonticonpicker.grey.min.css', array(), $this->version, 'all' );
97
- wp_enqueue_style( 'owl-css', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), $this->version, 'all' );
98
- wp_enqueue_style('panellium-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/pannellum.css', array(), true);
99
- wp_enqueue_style('videojs-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/video-js.css', array(), true);
100
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-admin.css', array(), $this->version, 'all' );
101
- }
102
-
103
- }
104
-
105
- /**
106
- * Register the JavaScript for the admin area.
107
- *
108
- * @since 1.0.0
109
- */
110
- public function enqueue_scripts() {
111
-
112
- /**
113
- * This function is provided for demonstration purposes only.
114
- *
115
- * An instance of this class should be passed to the run() function
116
- * defined in Wpvr_Loader as all of the hooks are defined
117
- * in that particular class.
118
- *
119
- * The Wpvr_Loader will then create the relationship
120
- * between the defined hooks and the functions defined in this
121
- * class.
122
- */
123
- wp_enqueue_script( 'wp-api' );
124
- $adscreen = get_current_screen();
125
- wp_enqueue_media();
126
- if ($adscreen->id=="wpvr_item" || $adscreen->id=="toplevel_page_wpvr") {
127
- wp_enqueue_script('wpvr-icon-picker', plugin_dir_url( __FILE__ ) . 'lib/jquery.fonticonpicker.min.js', array(), true);
128
- wp_enqueue_script('panellium-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/pannellum.js', array(), true);
129
- wp_enqueue_script('panelliumlib-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/libpannellum.js', array(), true);
130
- wp_enqueue_script( 'videojs-js', plugin_dir_url( __FILE__ ) .'js/video.js', array('jquery'), true);
131
- wp_enqueue_script('panelliumvid-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/videojs-pannellum-plugin.js', array(), true);
132
- wp_enqueue_script( 'jquery-repeater', plugin_dir_url( __FILE__ ) .'js/jquery.repeater.min.js', array('jquery'), true);
133
- wp_enqueue_script('icon-picker', plugin_dir_url( __FILE__ ) . 'lib/jquery.fonticonpicker.min.js', array(), true);
134
- wp_enqueue_script( 'owl', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), false );
135
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpvr-admin.js', array( 'jquery' ), $this->version, true );
136
- wp_localize_script( $this->plugin_name, 'wpvr_obj', array(
137
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
138
- 'ajax_nonce' => wp_create_nonce('wpvr'),
139
- ) );
140
- }
141
-
142
- if ($adscreen->id=="toplevel_page_wpvr") {
143
- wp_enqueue_script( 'materialize-js', plugin_dir_url( __FILE__ ) . 'js/materialize.min.js', array( 'jquery' ), $this->version, false );
 
 
 
 
 
 
 
 
144
  }
145
- wp_enqueue_script( 'owl-js', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js', array( 'jquery' ), false );
146
- wp_enqueue_script( 'wpvr-global', plugin_dir_url( __FILE__ ) . 'js/wpvr-global.js', array( 'jquery' ), $this->version, false );
147
- wp_localize_script( 'wpvr-global', 'wpvr_global_obj', array(
148
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
149
- 'ajax_nonce' => wp_create_nonce('wpvr_global'),
150
- ) );
151
- }
152
 
153
 
154
  /**
@@ -157,23 +160,24 @@ class Wpvr_Admin {
157
  * @param $links
158
  * @return array
159
  */
160
- public function plugin_action_links_wpvr( $actions, $plugin_file, $plugin_data, $context ) {
 
161
  $actions['get_started'] = sprintf(
162
  '<a href="%s">%s</a>',
163
- esc_url( admin_url( 'admin.php?page=wpvr' ) ),
164
- esc_html__( 'Get Started', 'wpvr' )
165
  );
166
  $actions['documentation'] = sprintf(
167
  '<a href="%s" target="_blank">%s</a>',
168
- esc_url( 'https://rextheme.com/docs-category/wp-vr/' ),
169
- esc_html__( 'Documentation', 'wpvr' )
170
  );
171
 
172
- if(!apply_filters('is_wpvr_pro_active', false)) {
173
  $actions['go-pro'] = sprintf(
174
  '<a href="%s" target="_blank" style="color: #201cfe; font-weight: bold;">%s</a>',
175
- esc_url( 'https://rextheme.com/wpvr/#pricing' ),
176
- esc_html__( 'Go Pro', 'wpvr' )
177
  );
178
  }
179
  return $actions;
@@ -181,221 +185,225 @@ class Wpvr_Admin {
181
 
182
 
183
  /**
184
- * Init the edit screen of the plugin post type item
185
- *
186
- * @since 1.0.0
187
- */
188
- public function wpvr_admin_init() {
189
- /*
190
- * Documentation : https://developer.wordpress.org/reference/functions/add_meta_box/
191
- */
192
-
193
- add_meta_box(
194
-
195
- $this->post_type . '_builder__box',
196
- __('Tour Preview', $this->plugin_name),
197
- array($this, 'wpvr_display_meta_box_builder'),
198
- $this->post_type,
199
- 'side',
200
- 'high'
201
- );
202
- }
203
-
204
-
205
- /**
206
- * Register the custom post type
207
- *
208
- * @since 1.0.0
209
- */
210
- public function wpvr_add_plugin_custom_post_type() {
211
- $labels = array(
212
- 'name' => __( 'Tours', $this->plugin_name ),
213
- 'singular_name' => __( 'Tours', $this->plugin_name ),
214
- 'add_new' => __( 'Add New Tour', $this->plugin_name ),
215
- 'add_new_item' => __( 'Add New Tour', $this->plugin_name ),
216
- 'edit_item' => __( 'Edit Tour', $this->plugin_name ),
217
- 'new_item' => __( 'New Tour', $this->plugin_name ),
218
- 'view_item' => __( 'View Tour', $this->plugin_name ),
219
- 'search_items' => __( 'Search Wpvr Tour', $this->plugin_name ),
220
- 'not_found' => __( 'No Wpvr Tour found', $this->plugin_name ),
221
- 'not_found_in_trash'=> __( 'No Wpvr Tour found in Trash', $this->plugin_name ),
222
- 'parent_item_colon' => '',
223
- 'all_items' => __( 'All Tours', $this->plugin_name ),
224
- 'menu_name' => __( 'WP VR', $this->plugin_name ),
225
- );
226
-
227
- $args = array(
228
- 'labels' => $labels,
229
- 'public' => false,
230
- 'show_ui' => true,
231
- 'show_in_menu' => false,
232
- 'menu_position' => 100,
233
- 'supports' => array( 'title' ),
234
- 'menu_icon' => plugins_url(). '/wpvr/images/icon.png',
235
- 'capabilities' => array(
236
- 'edit_post' => 'edit_wpvr_tour',
237
- 'edit_posts' => 'edit_wpvr_tours',
238
- 'edit_others_posts' => 'edit_other_wpvr_tours',
239
- 'publish_posts' => 'publish_wpvr_tours',
240
- 'read_post' => 'read_wpvr_tour',
241
- 'read_private_posts' => 'read_private_wpvr_tours',
242
- 'delete_post' => 'delete_wpvr_tour'
243
- ),
244
- 'map_meta_cap' => true,
245
- );
246
-
247
- /**
248
- * Documentation : https://codex.wordpress.org/Function_Reference/register_post_type
249
- */
250
- register_post_type( $this->post_type, $args );
251
- }
252
-
253
- /**
254
- * Populates the data in the custom columns
255
- *
256
- * @since 1.0.0
257
- */
258
- function wpvr_manage_posts_custom_column( $column_name ){
259
- $post = get_post();
260
-
261
- switch( $column_name ) {
262
- case 'shortcode' :
263
- echo '<code>[wpvr id="' . $post->ID . '"]</code>';
264
- break;
265
- default:
266
- break;
267
- }
268
- }
269
-
270
- /**
271
- * Adds the custom columns to the post type admin screen
272
- *
273
- * @since 1.0.0
274
- */
275
- public function wpvr_manage_post_columns() {
276
- $columns = array(
277
- 'cb' => '<input type="checkbox" />',
278
- 'title' => __( 'Title', $this->plugin_name),
279
- 'shortcode' => __( 'Shortcodes', $this->plugin_name),
280
- 'author' => __( 'Author', $this->plugin_name),
281
- 'date' => __( 'Date', $this->plugin_name)
282
- );
283
- return $columns;
284
- }
285
-
286
- /**
287
- * Sets the messages for the custom post type
288
- *
289
- * @since 1.0.0
290
- */
291
- public function wpvr_post_updated_messages( $messages ) {
292
- $messages[$this->post_type][1] = __( 'WP VR item updated.', $this->plugin_name);
293
- $messages[$this->post_type][4] = __( 'WP VR item updated.', $this->plugin_name);
294
-
295
- return $messages;
296
- }
297
-
298
- /**
299
- * Render the shortcode box for this plugin.
300
- *
301
- * @since 1.0.0
302
- */
303
- public function wpvr_display_meta_box_shortcode() {
304
-
305
- include_once( 'partials/wpvr-meta-box-shortcode-display.php' );
306
- }
307
-
308
- /**
309
- * Render the builder box for this plugin.
310
- *
311
- * @since 1.0.0
312
- */
313
- public function wpvr_display_meta_box_builder() {
314
- include_once( 'partials/wpvr-meta-box-builder-display.php' );
315
- }
316
-
317
- /**
318
- * Custom Metabox
319
- */
320
- public function wpvr_add_setup_metabox(){
321
-
322
- add_meta_box( 'setup', __( 'Setup' ), array($this, 'wpvr_setup'), 'wpvr_item', 'normal', 'high' );
323
  }
324
- public function wpvr_setup($post) {
325
 
326
- $data_limit = 5;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
 
328
- $scene_limit = $data_limit + 1;
329
- $postdata = get_post_meta( $post->ID, 'panodata', true );
330
 
331
 
332
- $autoload = true;
333
- if (isset($postdata["autoLoad"])) {
334
- $autoload = $postdata["autoLoad"];
335
- }
336
 
337
- $control = true;
338
- if (isset($postdata["showControls"])) {
339
  $control = $postdata["showControls"];
340
- }
341
 
342
- $default_scene = '';
343
- if (isset($postdata["defaultscene"])) {
344
- $default_scene = $postdata["defaultscene"];
345
- }
346
 
347
- $preview = '';
348
- if (isset($postdata['preview'])) {
349
- $preview = $postdata['preview'];
350
- }
351
 
352
- $autorotation = '';
353
- if (isset($postdata["autoRotate"])) {
354
- $autorotation = $postdata["autoRotate"];
355
- }
356
- else {
357
- $autorotation = -5;
358
- }
359
- $autorotationinactivedelay = '';
360
- if (isset($postdata["autoRotateInactivityDelay"])) {
361
- $autorotationinactivedelay = $postdata["autoRotateInactivityDelay"];
362
- }
363
 
364
- $autorotationstopdelay = '';
365
- if (isset($postdata["autoRotateStopDelay"])) {
366
- $autorotationstopdelay = $postdata["autoRotateStopDelay"];
367
- }
368
 
369
- $scene_fade_duration = '';
370
- if (isset($postdata["scenefadeduration"])) {
371
- $scene_fade_duration = $postdata["scenefadeduration"];
372
- }
373
 
374
- $pano_data = '';
375
- if (isset($postdata["panodata"])) {
376
- $pano_data = $postdata["panodata"];
377
- }
378
 
379
- $custom_icon_array = new Wpvr_fontawesome_icons();
380
- $custom_icon = $custom_icon_array->icon;
381
 
382
- $html = '';
383
 
384
 
385
 
386
- $html .= '<div class="pano-setup">';
387
 
388
  // active tab variables
389
  $active_tab = 'general';
390
  $scene_active_tab = 1;
391
  $hotspot_active_tab = 1;
392
- if(isset($_GET['active_tab'])) {
393
  $active_tab = $_GET['active_tab'];
394
  }
395
- if(isset($_GET['scene'])) {
396
  $scene_active_tab = $_GET['scene'];
397
  }
398
- if(isset($_GET['hotspot'])) {
399
  $hotspot_active_tab = $_GET['hotspot'];
400
  }
401
 
@@ -408,621 +416,617 @@ class Wpvr_Admin {
408
  $html .= '<input type="hidden" value="'.$hotspot_active_tab.'" name="wpvr_active_hotspot" id="wpvr_active_hotspot"/>';
409
 
410
  $html .= '<div class="pano-alert scene-alert">';
411
- $html .= '<span class="destroy"><i class="fa fa-times"></i></span>';
412
- $html .= '<p></p>';
413
  $html .= '</div>';
414
 
415
  $html .='<div class="rex-pano-tabs">';
416
- $html .='<nav class="rex-pano-tab-nav rex-pano-nav-menu main-nav" id="wpvr-main-nav">';
417
- $html .='<ul>';
418
- $html .='<li class="logo"><img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/logo.png'.'" alt="logo" /></li>';
419
-
420
- $html .='<li class="general active" data-screen="general">';
421
- $html .='<span data-href="#general">';
422
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-regular.png'.'" alt="icon" class="regular" />';
423
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-hover.png'.'" alt="icon" class="hover" />';
424
- $html .=''.__('General','wpvr').'</span>';
425
- $html .='</li>';
426
-
427
- $html .='<li class="scene" data-screen="scene">';
428
- $html .='<span data-href="#scenes">';
429
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-regular.png'.'" alt="icon" class="regular" />';
430
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-hover.png'.'" alt="icon" class="hover" />';
431
- $html .=''.__('Scenes','wpvr').'</span>';
432
- $html .='</li>';
433
-
434
- $html .='<li class="hotspot" data-screen="hotspot">';
435
- $html .='<span data-href="#scenes">';
436
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-regular.png'.'" alt="icon" class="regular" />';
437
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-hover.png'.'" alt="icon" class="hover" />';
438
- $html .=''.__('Hotspot','wpvr').'</span>';
439
- $html .='</li>';
440
-
441
- $html .='<li class="video" data-screen="video">';
442
- $html .='<span data-href="#video">';
443
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-regular.png'.'" alt="icon" class="regular" />';
444
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-hover.png'.'" alt="icon" class="hover" />';
445
- $html .=''.__('Video','wpvr').'</span>';
446
- $html .='</li>';
447
- $html .='</ul>';
448
- $html .='</nav>';
449
-
450
- $html .='<div class="rex-pano-tab-content" id="wpvr-main-tab-contents">';
451
- $html .='<div class="rex-pano-tab general active" id="general">';
452
-
453
- //=start inner tab=
454
- $html .= '<div class="general-inner-tab">';
455
- //=start inner nav=
456
- $html .= '<ul class="inner-nav">';
457
-
458
- $html .='<li class="gen-basic active">';
459
- $html .='<span data-href="#gen-basic">';
460
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/basic-settings-regular.png'.'" alt="icon" class="regular" />';
461
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/basic-settings-hover.png'.'" alt="icon" class="hover" />';
462
- $html .=''.__('Basic Settings ','wpvr').'</span>';
463
- $html .='</li>';
464
-
465
- $html .='<li class="gen-advanced">';
466
- $html .='<span data-href="#gen-advanced">';
467
- $html .='<span class="pro-tag">pro</span>';
468
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/advance-control-regular.png'.'" alt="icon" class="regular" />';
469
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/advance-control-hover.png'.'" alt="icon" class="hover" />';
470
- $html .=''.__('Advanced Controls ','wpvr').'</span>';
471
- $html .='</li>';
472
-
473
- $html .='<li class="gen-control">';
474
- $html .='<span data-href="#gen-control">';
475
- $html .='<span class="pro-tag">pro</span>';
476
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/control-buttons-regular.png'.'" alt="icon" class="regular" />';
477
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/control-buttons-hover.png'.'" alt="icon" class="hover" />';
478
- $html .=''.__('Control Buttons ','wpvr').'</span>';
479
- $html .='</li>';
480
-
481
- $html .='<li class="vr-documentation">';
482
- $html .='<a href="https://rextheme.com/docs-category/wp-vr/" target="_blank">'.__('Documentation ','wpvr').'</a>';
483
- $html .='</li>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
 
485
- $html .= '</ul>';
486
- //=end inner nav=
487
-
488
- $html .= '<div class="inner-nav-content">';
489
- $html .= '<div class="basic-settings-content inner-single-content active" id="gen-basic">';
490
- $html .= '<div class="content-wrapper">';
491
- $html .= '<div class="left">';
492
- //===preview image===//
493
- if (!empty($preview)) {
494
- $html .= '<div class="single-settings preview-setting">';
495
- $html .= '<span>'.__('Set a Tour Preview Image : ','wpvr').'</span>';
496
- $html .= '<div class="form-group">';
497
- $html .= '<input type="text" name="preview-attachment-url" class="preview-attachment-url" value="'.$preview.'">';
498
- $html .= '<input type="button" class="preview-upload" id="vr-preview-img" data-info="" value="Upload"/>';
499
- $html .= '<div class="img-upload-frame img-uploaded" style="background-image: url('.$preview.')">';
500
- $html .= '<span class="remove-attachment">x</span>';
501
- $html .= '<label for="vr-preview-img">';
502
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/uplad-icon.png'.'" alt="preview img" />';
503
- $html .= '<span>'.__('Click to Upload an Image ','wpvr').'</span>';
504
- $html .= '</label>';
505
- $html .= '</div>';
506
-
507
- $html .= '</div>';
508
- $html .= '<span class="hints">'.__('This option will not work if the "Tour Autoload" is turned on.','wpvr').'</span>';
509
- $html .= '</div>';
510
- }
511
- else {
512
- $html .= '<div class="single-settings preview-setting">';
513
- $html .= '<span>'.__('Set a Tour Preview Image : ','wpvr').'</span>';
514
- $html .= '<div class="form-group">';
515
- $html .= '<input type="text" name="preview-attachment-url" class="preview-attachment-url" value="">';
516
- $html .= '<input type="button" class="preview-upload" id="vr-preview-img" data-info="" value="Upload"/>';
517
- $html .= '<div class="img-upload-frame">';
518
- $html .= '<span class="remove-attachment">x</span>';
519
- $html .= '<label for="vr-preview-img">';
520
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/uplad-icon.png'.'" alt="icon" />';
521
- $html .= '<span>'.__('Click to Upload an Image ','wpvr').'</span>';
522
- $html .= '</label>';
523
- $html .= '</div>';
524
- $html .= '</div>';
525
- $html .= '</div>';
526
- }
527
- //===preview image end===//
528
-
529
- //=Autoload setup=//
530
- if ($autoload == true) {
531
- $html .= '<div class="single-settings autoload">';
532
- $html .= '<span>'.__('Tour Autoload: ','wpvr').'</span>';
533
-
534
- $html .= '<span class="wpvr-switcher">';
535
- $html .= '<input id="wpvr_autoload" class="vr-switcher-check" name="autoload" type="checkbox" value="on" checked />';
536
- $html .= '<label for="wpvr_autoload"></label>';
537
- $html .= '</span>';
538
-
539
- $html .= '<div class="field-tooltip">';
540
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
541
- $html .= '<span>'.__('Tour Preview Image will not appear if this is turned on.','wpvr').'</span>';
542
- $html .= '</div>';
543
- $html .= '</div>';
544
- }
545
- else {
546
- $html .= '<div class="single-settings autoload">';
547
- $html .= '<span>'.__('Tour Autoload: ','wpvr').' </span>';
548
-
549
- $html .= '<span class="wpvr-switcher">';
550
- $html .= '<input id="wpvr_autoload" class="vr-switcher-check" name="autoload" type="checkbox" value="off" />';
551
- $html .= '<label for="wpvr_autoload"></label>';
552
- $html .= '</span>';
553
-
554
- $html .= '<div class="field-tooltip">';
555
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
556
- $html .= '<span>'.__('Tour Preview Image will not appear if this is turned on.','wpvr').'</span>';
557
- $html .= '</div>';
558
- $html .= '</div>';
559
- }
560
- //=Autoload setup End=//
561
-
562
- //=Control Setup=
563
- if ($control == false) {
564
- $html .= '<div class="single-settings controls">';
565
- $html .= '<span>'.__('Basic Control Buttons: ','wpvr').'</span>';
566
-
567
- $html .= '<span class="wpvr-switcher">';
568
- $html .= '<input id="wpvr_controls" class="vr-switcher-check" value="off" name="controls" type="checkbox" />';
569
- $html .= '<label for="wpvr_controls"></label>';
570
- $html .= '</span>';
571
-
572
- $html .= '<div class="field-tooltip">';
573
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
574
- $html .= '<span>'.__('This option will display Zoom In, Zoom Out and Full Screen buttons on the tour.','wpvr').'</span>';
575
- $html .= '</div>';
576
- $html .= '</div>';
577
- }
578
- else {
579
- $html .= '<div class="single-settings controls">';
580
- $html .= '<span>'.__('Basic Control Buttons: ','wpvr').'</span>';
581
-
582
- $html .= '<span class="wpvr-switcher">';
583
- $html .= '<input id="wpvr_controls" class="vr-switcher-check" value="on" name="controls" type="checkbox" checked />';
584
- $html .= '<label for="wpvr_controls"></label>';
585
- $html .= '</span>';
586
-
587
- $html .= '<div class="field-tooltip">';
588
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
589
- $html .= '<span>'.__('This option will display Zoom In, Zoom Out and Full Screen buttons on the tour.','wpvr').'</span>';
590
- $html .= '</div>';
591
- $html .= '</div>';
592
- }
593
- //=Control setup End=//
594
 
595
- $html .= '</div>';
596
- //===end left===//
597
-
598
- $html .= '<div class="right">';
599
- //=scene fade duration=//
600
- $html .= '<div class="single-settings scene-fade-duration">';
601
- $html .= '<span>'.__('Scene Fade Duration: ','wpvr').'</span>';
602
- $html .= '<input type="number" name="scene-fade-duration" value="'.$scene_fade_duration.'" />';
603
-
604
- $html .= '<div class="field-tooltip">';
605
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
606
- $html .= '<span>'.__('This will set the scene fade effect and execution time.','wpvr').'</span>';
607
- $html .= '</div>';
608
- $html .= '</div>';
609
- //=scene fade duration End=//
610
-
611
- //===Autorotation on off set==//
612
- if (isset($postdata["autoRotate"])) {
613
- $html .= '<div class="single-settings autoload">';
614
- $html .= '<span>'.__('Auto Rotation: ','wpvr').' </span>';
615
-
616
- $html .= '<span class="wpvr-switcher">';
617
- $html .= '<input id="wpvr_autorotation" class="vr-switcher-check" value="on" name="autorotation" type="checkbox" checked />';
618
- $html .= '<label for="wpvr_autorotation"></label>';
619
- $html .= '</span>';
620
- $html .= '</div>';
621
- }
622
- else {
623
- $html .= '<div class="single-settings autoload">';
624
- $html .= '<span>'.__('Auto Rotation: ','wpvr').' </span>';
625
-
626
- $html .= '<span class="wpvr-switcher">';
627
- $html .= '<input id="wpvr_autorotation" class="vr-switcher-check" value="off" name="autorotation" type="checkbox" />';
628
- $html .= '<label for="wpvr_autorotation"></label>';
629
- $html .= '</span>';
630
- $html .= '</div>';
631
- }
632
- //===end Autorotation on off set==//
633
-
634
- //=Auto Rotation=//
635
- $html .= '<div class="autorotationdata-wrapper">';
636
- $html .= '<div class="single-settings autorotationdata" >';
637
- $html .= '<span>'.__('Rotation Speed and Direction: ','wpvr').'</span>';
638
- $html .= '<input type="number" name="auto-rotation" value="'.$autorotation.'" placeholder="-5" />';
639
-
640
- $html .= '<div class="field-tooltip">';
641
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
642
- $html .= '<span>'.__('Set a value to determine the speed of rotation. The higher the number, the faster it will rotate. Positive values will make it rotate clockwise and negative values will make it rotate anti clockwise','wpvr').'</span>';
643
- $html .= '</div>';
644
- $html .= '</div>';
645
- //=Auto Rotation=//
646
-
647
- //=Auto rotation inactive delay=//
648
- $html .= '<div class="single-settings autorotationdata" >';
649
- $html .= '<span>'.__('Resume Auto-rotation after: ','wpvr').'</span>';
650
- $html .= '<input type="number" name="auto-rotation-inactive-delay" value="'.$autorotationinactivedelay.'" placeholder="2000" />';
651
-
652
- $html .= '<div class="field-tooltip">';
653
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
654
- $html .= '<span>'.__('When someone clicks on the tour, auto-rotation stops. Here, set a time after which auto rotation will start again. Assign in milliseconds, where 1000 milliseconds = 1 second.','wpvr').'</span>';
655
- $html .= '</div>';
656
- $html .= '</div>';
657
- //=Auto rotation inactive delay=//
658
-
659
- //=Auto rotation stop delay=//
660
- $html .= '<div class="single-settings autorotationdata" >';
661
- $html .= '<span>'.__('Stop Auto-rotation after: ','wpvr').'</span>';
662
- $html .= '<input type="number" name="auto-rotation-stop-delay" value="'.$autorotationstopdelay.'" placeholder="2000" />';
663
-
664
- $html .= '<div class="field-tooltip">';
665
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
666
- $html .= '<span>'.__('Set a time after which auto rotation will stop. Assign in milliseconds, where 1000 milliseconds = 1 second.','wpvr').'</span>';
667
- $html .= '</div>';
668
- $html .= '</div>';
669
- $html .= '</div>';
670
- //=Auto rotation stop delay=//
671
 
672
- $html .= '</div>';
673
- //===end right===//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
674
 
675
- $html .= '</div>';
676
- $html .= '</div>';
677
- //===end basic settings===//
678
-
679
- $html .= '<div class="advanced-settings-content inner-single-content" id="gen-advanced">';
680
- $html .= '<div class="content-wrapper">';
681
- $html .= '<div class="left">';
682
-
683
- //=Keyboard Movement Control=//
684
- $html .= '<div class="single-settings compass">';
685
- $html .= '<span>'.__('Keyboard Movement Control: ','wpvr').'</span>';
686
-
687
- $html .= '<span class="wpvr-switcher">';
688
- $html .= '<input id="wpvr_diskeyboard" class="vr-switcher-check" value="off" name="diskeyboard" type="checkbox" disabled />';
689
- $html .= '<label for="wpvr_diskeyboard" title="Pro Feature"></label>';
690
- $html .= '</span>';
691
- $html .= '</div>';
692
- //=Keyboard Movement Control end=//
693
-
694
- //=Keyboard Zoom Control Setup=//
695
- $html .= '<div class="single-settings">';
696
- $html .= '<span>'.__('Keyboard Zoom Control: ','wpvr').'</span>';
697
-
698
- $html .= '<span class="wpvr-switcher">';
699
- $html .= '<input id="wpvr_keyboardzoom" class="vr-switcher-check" value="off" name="keyboardzoom" type="checkbox" disabled />';
700
- $html .= '<label for="wpvr_keyboardzoom" title="Pro Feature"></label>';
701
- $html .= '</span>';
702
- $html .= '</div>';
703
- //=Keyboard Zoom Control End=//
704
-
705
- //=Mouse Drag Control=//
706
- $html .= '<div class="single-settings">';
707
- $html .= '<span>'.__('Mouse Drag Control: ','wpvr').'</span>';
708
-
709
- $html .= '<span class="wpvr-switcher">';
710
- $html .= '<input id="wpvr_draggable" class="vr-switcher-check" name="draggable" type="checkbox" value="off" disabled />';
711
- $html .= '<label for="wpvr_draggable" title="Pro Feature"></label>';
712
- $html .= '</span>';
713
- $html .= '</div>';
714
- //=Mouse Drag Control End=//
715
-
716
- //=Mouse Zoom Control=//
717
- $html .= '<div class="single-settings">';
718
- $html .= '<span>'.__('Mouse Zoom Control: ','wpvr').'</span>';
719
-
720
- $html .= '<span class="wpvr-switcher">';
721
- $html .= '<input id="wpvr_mouseZoom" class="vr-switcher-check" value="off" name="mouseZoom" type="checkbox" disabled />';
722
- $html .= '<label for="wpvr_mouseZoom" title="Pro Feature"></label>';
723
- $html .= '</span>';
724
- $html .= '</div>';
725
- //=Mouse Zoom Control End=//
726
-
727
- //=Gyroscope Control=//
728
- $html .= '<div class="single-settings gyro">';
729
- $html .= '<span>'.__('Gyroscope Control: ','wpvr').'</span>';
730
-
731
- $html .= '<span class="wpvr-switcher">';
732
- $html .= '<input id="wpvr_gyro" class="vr-switcher-check" value="off" name="gyro" type="checkbox" disabled />';
733
- $html .= '<label for="wpvr_gyro" title="Pro Feature"></label>';
734
- $html .= '</span>';
735
- $html .= '</div>';
736
- //=Gyroscope Control End=//
737
-
738
- //=Auto Gyroscope Support=//
739
- $html .= '<div class="single-settings orientation">';
740
- $html .= '<span>'.__('Auto Gyroscope Support: ','wpvr').'</span>';
741
-
742
- $html .= '<span class="wpvr-switcher">';
743
- $html .= '<input id="wpvr_deviceorientationcontrol" class="vr-switcher-check" value="off" name="deviceorientationcontrol" type="checkbox" disabled />';
744
- $html .= '<label for="wpvr_deviceorientationcontrol" title="Pro Feature"></label>';
745
- $html .= '</span>';
746
-
747
- $html .= '<div class="field-tooltip">';
748
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
749
- $html .= '<span>'.__('If set to true, device orientation control will be used when the panorama is loaded, if the device supports it. If false, device orientation control needs to be activated by pressing a button. Defaults to false. Will work if gyroscope is enabled','wpvr').'</span>';
750
- $html .= '</div>';
751
- $html .= '</div>';
752
- //=Auto Gyroscope Support End=//
753
-
754
- //=Compass Setup=//
755
- $html .= '<div class="single-settings compass">';
756
- $html .= '<span>'.__('Compass: ','wpvr').'</span>';
757
-
758
- $html .= '<span class="wpvr-switcher">';
759
- $html .= '<input id="wpvr_compass" class="vr-switcher-check" value="off" name="compass" type="checkbox" disabled />';
760
- $html .= '<label for="wpvr_compass" title="Pro Feature"></label>';
761
- $html .= '</span>';
762
- $html .= '</div>';
763
- //=Compass setup End=//
764
 
765
- $html .= '</div>';
766
- //===end left===//
767
-
768
- $html .= '<div class="right">';
769
- //= Scene Gallery=//
770
- $html .= '<div class="single-settings gallery">';
771
- $html .= '<span>'.__('Scene Gallery: ','wpvr').'</span>';
772
-
773
- $html .= '<span class="wpvr-switcher">';
774
- $html .= '<input id="wpvr_vrgallery" class="vr-switcher-check" value="off" name="vrgallery" type="checkbox" disabled />';
775
- $html .= '<label for="wpvr_vrgallery" title="Pro Feature"></label>';
776
- $html .= '</span>';
777
-
778
- $html .= '<div class="field-tooltip">';
779
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
780
- $html .= '<span>'.__('Turning it On will display a gallery with all the scenes on your tour. By double clicking on a scene thumbnail on the gallery, you can move to that specific scene. The gallery will only show up on the front end and not on the preview.','wpvr').'</span>';
781
- $html .= '</div>';
782
- $html .= '</div>';
783
- //= Scene Gallery end=//
784
-
785
- //=Scene Titles on Gallery=//
786
- $html .= '<div class="single-settings">';
787
- $html .= '<span>'.__('Scene Titles on Gallery: ','wpvr').'</span>';
788
-
789
- $html .= '<span class="wpvr-switcher">';
790
- $html .= '<input id="wpvr_vrgallery_title" class="vr-switcher-check" value="off" name="vrgallery_title" type="checkbox" disabled />';
791
- $html .= '<label for="wpvr_vrgallery_title" title="Pro Feature"></label>';
792
- $html .= '</span>';
793
-
794
- $html .= '<div class="field-tooltip">';
795
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
796
- $html .= '<span>'.__('Turning it on will display scene titles on each scene thumbnail inside the Scene Gallery. The Scene IDs will be used as the Scene Title.','wpvr').'</span>';
797
- $html .= '</div>';
798
- $html .= '</div>';
799
- //=Scene Titles on Gallery End=//
800
-
801
- //===VR Audio setup===//
802
- $html .= '<div class="single-settings">';
803
- $html .= '<span>Tour Background Music: </span>';
804
-
805
- $html .= '<span class="wpvr-switcher">';
806
- $html .= '<input id="wpvr_bg_music" class="vr-switcher-check" value="off" name="bg_music" type="checkbox" disabled />';
807
- $html .= '<label for="wpvr_bg_music" title="Pro Feature"></label>';
808
- $html .= '</span>';
809
- $html .= '</div>';
810
- //==VR audio End==//
811
-
812
- //===Company logo===//
813
- $html .= '<div class="single-settings company-info">';
814
- $html .= '<span>'.__('Add Company Information: ','wpvr').' </span>';
815
-
816
- $html .= '<span class="wpvr-switcher">';
817
- $html .= '<input id="wpvr_cpLogoSwitch" class="vr-switcher-check" value="off" name="cpLogoSwitch" type="checkbox" disabled />';
818
- $html .= '<label for="wpvr_cpLogoSwitch" title="Pro Feature"></label>';
819
- $html .= '</span>';
820
- $html .= '</div>';
821
- //===Company logo end===//
822
 
823
- $html .= '</div>';
824
- //===end right===//
 
 
825
 
826
- $html .= '</div>';
827
- $html .= '</div>';
828
- //===end advanced settings===//
829
-
830
- $html .= '<div class="control-settings-content inner-single-content" id="gen-control">';
831
- $html .= '<div class="content-wrapper">';
832
- $html .= '<div class="left">';
833
- //=====Move up====//
834
- $html .= '<div class="single-settings controls custom-data-set">';
835
- $html .= '<span>'.__('Move Up: ','wpvr').'</span>';
836
-
837
- $html .= '<div class="color-icon">';
838
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-up.jpg'.'" alt="icon" />';
839
- $html .= '</div>';
840
-
841
- $html .= '<span class="wpvr-switcher">';
842
- $html .= '<input id="wpvr_panupControl" class="vr-switcher-check" value="off" name="panupControl" type="checkbox" disabled />';
843
- $html .= '<label for="wpvr_panupControl" title="Pro Feature"></label>';
844
- $html .= '</span>';
845
-
846
- $html .= '</div>';
847
- //=====Moveup End====//
848
-
849
- //=====Move Down====//
850
- $html .= '<div class="single-settings controls custom-data-set">';
851
- $html .= '<span>'.__('Move Down: ','wpvr').'</span>';
852
-
853
- $html .= '<div class="color-icon">';
854
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-down.jpg'.'" alt="icon" />';
855
- $html .= '</div>';
856
-
857
- $html .= '<span class="wpvr-switcher">';
858
- $html .= '<input id="wpvr_panDownControl" class="vr-switcher-check" value="off" name="panDownControl" type="checkbox" disabled />';
859
- $html .= '<label for="wpvr_panDownControl" title="Pro Feature"></label>';
860
- $html .= '</span>';
861
- $html .= '</div>';
862
- //=====Move down End====//
863
-
864
- //=====Move Left====//
865
- $html .= '<div class="single-settings controls custom-data-set">';
866
- $html .= '<span>'.__('Move Left: ','wpvr').'</span>';
867
-
868
- $html .= '<div class="color-icon">';
869
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-left.jpg'.'" alt="icon" />';
870
- $html .= '</div>';
871
-
872
- $html .= '<span class="wpvr-switcher">';
873
- $html .= '<input id="wpvr_panLeftControl" class="vr-switcher-check" value="off" name="panLeftControl" type="checkbox" disabled />';
874
- $html .= '<label for="wpvr_panLeftControl" title="Pro Feature"></label>';
875
- $html .= '</span>';
876
- $html .= '</div>';
877
- //=====Move Left End====//
878
-
879
- //=====Move Right====//
880
- $html .= '<div class="single-settings controls custom-data-set">';
881
- $html .= '<span>'.__('Move Right: ','wpvr').'</span>';
882
-
883
- $html .= '<div class="color-icon">';
884
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-right.jpg'.'" alt="icon" />';
885
- $html .= '</div>';
886
-
887
- $html .= '<span class="wpvr-switcher">';
888
- $html .= '<input id="wpvr_panRightControl" class="vr-switcher-check" value="off" name="panRightControl" type="checkbox" disabled />';
889
- $html .= '<label for="wpvr_panRightControl" title="Pro Feature"></label>';
890
- $html .= '</span>';
891
- $html .= '</div>';
892
- //=====Move Right End====//
893
-
894
- //=====Zoom In====//
895
- $html .= '<div class="single-settings controls custom-data-set">';
896
- $html .= '<span>'.__('Zoom In: ','wpvr').'</span>';
897
-
898
- $html .= '<div class="color-icon">';
899
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/zoom-in.jpg'.'" alt="icon" />';
900
- $html .= '</div>';
901
-
902
- $html .= '<span class="wpvr-switcher">';
903
- $html .= '<input id="wpvr_panZoomInControl" class="vr-switcher-check" value="off" name="panZoomInControl" type="checkbox" disabled />';
904
- $html .= '<label for="wpvr_panZoomInControl" title="Pro Feature"></label>';
905
- $html .= '</span>';
906
-
907
- $html .= '</div>';
908
- //=====Zoom In End====//
909
 
910
- $html .= '</div>';
911
- //===end left===//
 
 
912
 
913
- $html .= '<div class="right">';
914
- //=====Zoom Out====//
915
- $html .= '<div class="single-settings controls custom-data-set">';
916
- $html .= '<span>'.__('Zoom Out: ','wpvr').'</span>';
 
 
 
917
 
918
- $html .= '<div class="color-icon">';
919
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/zoom-out.jpg'.'" alt="icon" />';
920
- $html .= '</div>';
921
 
922
- $html .= '<span class="wpvr-switcher">';
923
- $html .= '<input id="wpvr_panZoomOutControl" class="vr-switcher-check" value="off" name="panZoomOutControl" type="checkbox" disabled />';
924
- $html .= '<label for="wpvr_panZoomOutControl" title="Pro Feature"></label>';
925
- $html .= '</span>';
926
 
927
- $html .= '</div>';
928
- //=====Zoom Out End====//
 
929
 
930
- //===== Full Screen====//
931
- $html .= '<div class="single-settings controls custom-data-set">';
932
- $html .= '<span>'.__('Full Screen: ','wpvr').'</span>';
933
 
934
- $html .= '<div class="color-icon">';
935
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/full-screen.jpg'.'" alt="icon" />';
936
- $html .= '</div>';
 
 
 
937
 
938
- $html .= '<span class="wpvr-switcher">';
939
- $html .= '<input id="wpvr_panFullscreenControl" class="vr-switcher-check" value="off" name="panFullscreenControl" type="checkbox" disabled />';
940
- $html .= '<label for="wpvr_panFullscreenControl" title="Pro Feature"></label>';
941
- $html .= '</span>';
942
 
943
- $html .= '</div>';
944
- //=====Full Screen End====//
 
 
 
 
945
 
946
- //=====Gyroscope====//
947
- $html .= '<div class="single-settings controls custom-data-set">';
948
- $html .= '<span>'.__('Gyroscope: ','wpvr').'</span>';
949
 
950
- $html .= '<div class="color-icon">';
951
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/gryscop.jpg'.'" alt="icon" />';
952
- $html .= '</div>';
 
 
 
953
 
954
- $html .= '<span class="wpvr-switcher">';
955
- $html .= '<input id="wpvr_gyroscope" class="vr-switcher-check" value="off" name="gyroscope" type="checkbox" disabled />';
956
- $html .= '<label for="wpvr_gyroscope" title="Pro Feature"></label>';
957
- $html .= '</span>';
958
 
959
- $html .= '</div>';
960
- //=====Gyroscope End====//
 
 
 
 
961
 
962
- //=====Back to home====//
963
- $html .= '<div class="single-settings controls custom-data-set">';
964
- $html .= '<span>'.__('Home: ','wpvr').'</span>';
965
 
966
- $html .= '<div class="color-icon">';
967
- $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/home.jpg'.'" alt="icon" />';
968
- $html .= '</div>';
 
 
 
969
 
970
- $html .= '<span class="wpvr-switcher">';
971
- $html .= '<input id="wpvr_backToHome" class="vr-switcher-check" value="off" name="backToHome" type="checkbox" disabled />';
972
- $html .= '<label for="wpvr_backToHome" title="Pro Feature"></label>';
973
- $html .= '</span>';
974
 
975
- $html .= '</div>';
976
- //=====Back to home End====//
977
- $html .= '</div>';
978
- //===end right===//
979
 
980
- $html .= '</div>';
981
- $html .= '</div>';
982
- //===end control settings===//
 
 
 
983
 
984
- $html .= '</div>';
985
- //=end inner tab content=
 
986
 
987
- $html .= '<div class="wpvr-use-shortcode">';
988
- $post = get_post();
989
- $id = $post->ID;
990
- $slug = $post->post_name;
991
- $postdata = get_post_meta( $post->ID, 'panodata', true );
 
992
 
993
- $html .= '<h4 class="area-title">'.__('Using this Tour', 'wpvr').'</h4>';
 
994
 
995
- $html .= '<div class="shortcode-wrapper">';
996
- $html .= '<div class="single-shortcode classic">';
997
- $html .= '<span class="shortcode-title">'.__('For Classic Editor:', 'wpvr').'</span>';
 
998
 
999
- $html .= '<div class="field-wapper">';
1000
- $html .= '<span>'.__('To use this WP VR tour in your posts or pages use the following shortcode ','wpvr').'</span>';
 
 
1001
 
1002
- $html .= '<div class="shortcode-field">';
1003
- $html .= '<p class="copycode" id="copy-shortcode">[wpvr id="'.$id.'"]</p>';
 
 
 
 
1004
 
1005
- $html .= '<span id="wpvr-copy-shortcode" class="wpvr-copy-shortcode">';
1006
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/copy.png'.'" alt="icon" />';
1007
- $html .= '</span>';
1008
- $html .= '</div>';
1009
 
 
 
 
 
1010
 
1011
- $html .= '<span id="wpvr-copied-notice" class="wpvr-copied-notice"></span>';
 
 
 
 
 
1012
 
1013
- $html .= '</div>';
1014
- $html .= '</div>';
 
1015
 
1016
- $html .= '</div>';
1017
- $html .= '</div>';
1018
- //=end shortcode area=
 
 
 
1019
 
1020
- $html .= '</div>';
1021
- //=end inner tab=
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
 
 
 
 
 
1023
 
1024
- $html .= '<script>';
1025
- $html .= '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1026
 
1027
  document.getElementById("wpvr-copy-shortcode").addEventListener("click", function() {
1028
  copyToClipboard(document.getElementById("copy-shortcode"));
@@ -1086,1375 +1090,1338 @@ class Wpvr_Admin {
1086
 
1087
  ';
1088
 
1089
- $html .= '</script>';
1090
-
1091
- $html .='</div>';
1092
- //---end general tab----
1093
-
1094
- $html .='<div class="rex-pano-tab" id="scenes">';
1095
-
1096
- //=Scene and Hotspot repeater=//
1097
- if (empty($pano_data)) {
1098
- $html .= '<div class="scene-setup rex-pano-sub-tabs" data-limit="'.$scene_limit.'">';
1099
-
1100
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu scene-nav">';
1101
- $html .= '<ul>';
1102
- $html .= '<li class="active"><span data-index="1" data-href="#scene-1"><i class="fa fa-image"></i></span></li>';
1103
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1104
- $html .= '</ul>';
1105
- $html .= '</nav>';
1106
-
1107
- $html .= '<div data-repeater-list="scene-list" class="rex-pano-tab-content">';
1108
-
1109
- $html .= '<div data-repeater-item class="single-scene rex-pano-tab" data-title="0" id="scene-0">';
1110
-
1111
- $html .= '<div class="scene-content">';
1112
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1113
-
1114
- $html .= '<div class="scene-left">';
1115
- //==Set Default Scene==//
1116
- $html .= '<div class="single-settings dscene">';
1117
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1118
- $html .= '<select class="dscen" name="dscene">';
1119
- $html .= '<option value="on"> Yes</option>';
1120
- $html .= '<option value="off" selected > No</option>';
1121
- $html .= '</select>';
1122
- $html .= '</div>';
1123
- //==Set Default Scene end==//
1124
-
1125
- $html .= '<div class=scene-setting>';
1126
- $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1127
- $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1128
- $html .= '</div>';
1129
-
1130
- $html .= '<div class=scene-setting>';
1131
- $html .= '<label for="scene-type">'.__('Scene Type : ','wpvr').'</label>';
1132
- $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1133
- $html .= '</div>';
1134
-
1135
- $html .= '<div class=scene-setting>';
1136
- $html .= '<label for="scene-upload">'.__('Scene Upload: ','wpvr').'</label>';
1137
- $html .= '<div class="form-group">';
1138
- $html .= '<img src="" style="display: none;"><br>';
1139
- $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1140
- $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="">';
1141
- $html .= '</div>';
1142
- $html .= '</div>';
1143
- $html .= '</div>';
1144
- //---end scene-left---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1146
  $html .= '</div>';
1147
 
1148
- //--hotspot setup--
1149
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1150
-
1151
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1152
- $html .= '<ul>';
1153
- $html .= '<li class="active"><span data-index="1" data-href="#scene-0-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1154
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1155
- $html .= '</ul>';
1156
- $html .= '</nav>';
1157
-
1158
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1159
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-0-hotspot-1">';
1160
-
1161
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1162
-
1163
- $html .= '<div class="wrapper">';
1164
- $html .= '<div class="hotspot-setting">';
1165
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
1166
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1167
- $html .= '</div>';
1168
-
1169
- $html .= '<div class="hotspot-setting">';
1170
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
1171
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1172
- $html .= '</div>';
1173
-
1174
- $html .= '<div class="hotspot-setting">';
1175
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
1176
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1177
- $html .= '</div>';
1178
-
1179
- $html .= '<div class="hotspot-setting">';
1180
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
1181
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1182
- $html .= '</div>';
1183
-
1184
- $html .= '</div>';
1185
-
1186
- $html .= '<div class="hotspot-type hotspot-setting">';
1187
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1188
- $html .= '<select name="hotspot-type">';
1189
- $html .= '<option value="info" selected> Info</option>';
1190
- $html .= '<option value="scene"> Scene</option>';
1191
- $html .= '</select>';
1192
-
1193
- $html .= '<div class="hotspot-url">';
1194
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
1195
- $html .= '<input type="url" name="hotspot-url" value="" />';
1196
- $html .= '</div>';
1197
-
1198
- $html .= '<div class="hotspot-content">';
1199
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1200
- $html .= '<textarea name="hotspot-content"></textarea>';
1201
- $html .= '</div>';
1202
-
1203
- $html .= '<div class="hotspot-hover">';
1204
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
1205
- $html .= '<textarea name="hotspot-hover"></textarea>';
1206
- $html .= '</div>';
1207
-
1208
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1209
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1210
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1211
- $html .= '<option value="none" selected> None</option>';
1212
- $html .= '</select>';
1213
- $html .= '</div>';
1214
-
1215
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1216
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').' </label>';
1217
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1218
- $html .= '</div>';
1219
-
1220
- $html .= '</div>';
1221
- //=Hotspot type End=//
1222
- $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1223
- $html .= '</div>';
1224
- $html .= '</div>';
1225
 
 
 
 
1226
  $html .= '</div>';
1227
- $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1228
- $html .= '</div>';
1229
-
1230
-
1231
- $html .= '<div data-repeater-item class="single-scene rex-pano-tab active" data-title="1" id="scene-1">';
1232
-
1233
- $html .= '<div class="scene-content">';
1234
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1235
-
1236
- $html .= '<div class="scene-left">';
1237
- //==Set Default Scene==//
1238
- $html .= '<div class="single-settings dscene">';
1239
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1240
- $html .= '<select class="dscen" name="dscene">';
1241
- $html .= '<option value="on"> Yes</option>';
1242
- $html .= '<option value="off" selected > No</option>';
1243
- $html .= '</select>';
1244
- $html .= '</div>';
1245
- //==Set Default Scene end==//
1246
-
1247
- $html .= '<div class=scene-setting>';
1248
- $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1249
- $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1250
- $html .= '</div>';
1251
-
1252
- $html .= '<div class=scene-setting>';
1253
- $html .= '<label for="scene-type">'.__('Scene Type : ','wpvr').'</label>';
1254
- $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1255
- $html .= '</div>';
1256
-
1257
- $html .= '<div class=scene-setting>';
1258
- $html .= '<label for="scene-upload">'.__('Scene Upload: ','wpvr').'</label>';
1259
- $html .= '<div class="form-group">';
1260
- $html .= '<img src="" style="display: none;"><br>';
1261
- $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1262
- $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="">';
1263
- $html .= '</div>';
1264
- $html .= '</div>';
1265
- $html .= '</div>';
1266
- //----end scene left------
1267
 
 
 
 
 
 
1268
  $html .= '</div>';
1269
 
1270
- //--hotspot setup--//
1271
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1272
-
1273
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1274
- $html .= '<ul>';
1275
- $html .= '<li class="active"><span data-index="1" data-href="#scene-1-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1276
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1277
- $html .= '</ul>';
1278
- $html .= '</nav>';
1279
-
1280
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1281
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-1-hotspot-1">';
1282
-
1283
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1284
-
1285
- $html .= '<div class="wrapper">';
1286
- $html .= '<div class="hotspot-setting">';
1287
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
1288
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1289
- $html .= '</div>';
1290
-
1291
- $html .= '<div class="hotspot-setting">';
1292
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
1293
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1294
- $html .= '</div>';
1295
-
1296
- $html .= '<div class="hotspot-setting">';
1297
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
1298
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1299
- $html .= '</div>';
1300
-
1301
- $html .= '<div class="hotspot-setting">';
1302
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
1303
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1304
- $html .= '</div>';
1305
-
1306
- $html .= '</div>';
1307
-
1308
- $html .= '<div class="hotspot-type hotspot-setting">';
1309
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1310
- $html .= '<select name="hotspot-type">';
1311
- $html .= '<option value="info" selected> Info</option>';
1312
- $html .= '<option value="scene"> Scene</option>';
1313
- $html .= '</select>';
1314
-
1315
- $html .= '<div class="hotspot-url">';
1316
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').'</label>';
1317
- $html .= '<input type="url" name="hotspot-url" value="" />';
1318
- $html .= '</div>';
1319
-
1320
- $html .= '<div class="hotspot-content">';
1321
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1322
- $html .= '<textarea name="hotspot-content"></textarea>';
1323
- $html .= '</div>';
1324
-
1325
- $html .= '<div class="hotspot-hover">';
1326
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
1327
- $html .= '<textarea name="hotspot-hover"></textarea>';
1328
- $html .= '</div>';
1329
-
1330
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1331
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1332
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1333
- $html .= '<option value="none"> None</option>';
1334
- $html .= '</select>';
1335
- $html .= '</div>';
1336
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1337
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
1338
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1339
- $html .= '</div>';
1340
-
1341
- $html .= '</div>';
1342
- //=Hotspot type End=//
1343
- $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1344
- $html .= '</div>';
1345
- $html .= '</div>';
1346
  $html .= '</div>';
1347
- $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1348
- $html .= '</div>';
1349
- $html .= '</div>';
1350
 
1351
- $html .= '</div>';
1352
- }
1353
- else {
1354
- $html .= '<div class="scene-setup rex-pano-sub-tabs" data-limit="'.$scene_limit.'">';
1355
-
1356
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu scene-nav">';
1357
- $html .= '<ul>';
1358
- $i = 1;
1359
- $firstvalue = reset($pano_data["scene-list"]);
1360
- foreach ($pano_data["scene-list"] as $pano_scenes) {
1361
- if ($pano_scenes['scene-id'] == $firstvalue['scene-id']) {
1362
- $html .= '<li class="active"><span data-index="'.$i.'" data-href="#scene-'.$i.'"><i class="fa fa-image"></i></span></li>';
1363
- }
1364
- else {
1365
- $html .= '<li><span data-index="'.$i.'" data-href="#scene-'.$i.'"><i class="fa fa-image"></i></span></li>';
1366
- }
1367
- $i++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1368
  }
1369
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1370
- $html .= '</ul>';
1371
- $html .= '</nav>';
1372
-
1373
-
1374
- $html .= '<div data-repeater-list="scene-list" class="rex-pano-tab-content">';
1375
-
1376
- //===Default empty repeater declared by nazmus sakib===//
1377
- $html .= '<div data-repeater-item class="single-scene rex-pano-tab" data-title="0" id="scene-0">';
1378
-
1379
- $html .= '<div class="scene-content">';
1380
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1381
-
1382
- $html .= '<div class="scene-left">';
1383
- //==Set Default Scene==//
1384
- $html .= '<div class="single-settings dscene">';
1385
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1386
- $html .= '<select class="dscen" name="dscene">';
1387
- $html .= '<option value="on"> Yes</option>';
1388
- $html .= '<option value="off" selected > No</option>';
1389
- $html .= '</select>';
1390
- $html .= '</div>';
1391
- //==Set Default Scene end==//
1392
- $html .= '<div class=scene-setting>';
1393
- $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1394
- $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1395
- $html .= '</div>';
1396
-
1397
- $html .= '<div class=scene-setting>';
1398
- $html .= '<label for="scene-type">'.__('Scene Type : ','wpvr').'</label>';
1399
- $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1400
- $html .= '</div>';
1401
-
1402
- $html .= '<div class=scene-setting>';
1403
- $html .= '<label for="scene-upload">'.__('Scene Upload: ','wpvr').'</label>';
1404
- $html .= '<div class="form-group">';
1405
- $html .= '<img src="" style="display: none;"><br>';
1406
- $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1407
- $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="">';
1408
- $html .= '</div>';
1409
- $html .= '</div>';
1410
- $html .= '</div>';
1411
- //-----end scene left------
1412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1413
  $html .= '</div>';
1414
 
1415
- //--hotspot setup--//
1416
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1417
-
1418
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1419
- $html .= '<ul>';
1420
- $html .= '<li class="active"><span data-index="1" data-href="#scene-0-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1421
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1422
- $html .= '</ul>';
1423
- $html .= '</nav>';
1424
-
1425
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1426
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-0-hotspot-1">';
1427
-
1428
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1429
-
1430
- $html .= '<div class="wrapper">';
1431
- $html .= '<div class="hotspot-setting">';
1432
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
1433
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1434
- $html .= '</div>';
1435
-
1436
- $html .= '<div class="hotspot-setting">';
1437
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
1438
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1439
- $html .= '</div>';
1440
-
1441
- $html .= '<div class="hotspot-setting">';
1442
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
1443
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1444
- $html .= '</div>';
1445
-
1446
- $html .= '<div class="hotspot-setting">';
1447
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
1448
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1449
- $html .= '</div>';
1450
-
1451
- $html .= '</div>';
1452
-
1453
- $html .= '<div class="hotspot-type hotspot-setting">';
1454
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1455
- $html .= '<select name="hotspot-type">';
1456
- $html .= '<option value="info" selected> Info</option>';
1457
- $html .= '<option value="scene"> Scene</option>';
1458
- $html .= '</select>';
1459
-
1460
- $html .= '<div class="hotspot-url">';
1461
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
1462
- $html .= '<input type="url" name="hotspot-url" value="" />';
1463
- $html .= '</div>';
1464
-
1465
- $html .= '<div class="hotspot-content">';
1466
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1467
- $html .= '<textarea name="hotspot-content"></textarea>';
1468
- $html .= '</div>';
1469
-
1470
- $html .= '<div class="hotspot-hover">';
1471
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
1472
- $html .= '<textarea name="hotspot-hover"></textarea>';
1473
- $html .= '</div>';
1474
-
1475
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1476
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1477
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1478
- $html .= '<option value="none" selected> None</option>';
1479
- $html .= '</select>';
1480
- $html .= '</div>';
1481
-
1482
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1483
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').' </label>';
1484
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1485
- $html .= '</div>';
1486
-
1487
- $html .= '</div>';
1488
- //=Hotspot type End=//
1489
- $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1490
- $html .= '</div>';
1491
- $html .= '</div>';
1492
 
1493
  $html .= '</div>';
1494
- $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1495
- $html .= '</div>';
1496
- //==Empty repeater end==//
1497
-
1498
- $s = 1;
1499
- foreach ($pano_data["scene-list"] as $pano_scenes) {
1500
- $dscene = '';
1501
- if (isset($pano_scenes['dscene'])) {
1502
- $dscene = $pano_scenes['dscene'];
1503
- }
1504
- $scene_id = '';
1505
- $scene_id = $pano_scenes["scene-id"];
1506
- $scene_type = 'equirectangular';
1507
- $scene_type = $pano_scenes["scene-type"];
1508
- $scene_photo = '';
1509
- $scene_photo = $pano_scenes["scene-attachment-url"];
1510
-
1511
- $pano_hotspots = array();
1512
- if (isset($pano_scenes["hotspot-list"])) {
1513
- $pano_hotspots = $pano_scenes["hotspot-list"];
1514
- }
1515
-
1516
- $firstvalueset = reset($pano_data["scene-list"]);
1517
- if ($pano_scenes['scene-id'] == $firstvalueset['scene-id']) {
1518
- $html .= '<div data-repeater-item class="single-scene rex-pano-tab active" data-title="1" id="scene-'.$s.'">';
1519
-
1520
- $html .= '<div class="scene-content">';
1521
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1522
-
1523
- $html .= '<div class="scene-left">';
1524
- //==Set Default Scene==//
1525
- if ($dscene == 'on') {
1526
- $html .= '<div class="single-settings dscene">';
1527
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1528
- $html .= '<select class="dscen" name="dscene">';
1529
- $html .= '<option value="on" selected > Yes</option>';
1530
- $html .= '<option value="off"> No</option>';
1531
- $html .= '</select>';
1532
- $html .= '</div>';
1533
-
1534
- }
1535
- else {
1536
- $html .= '<div class="single-settings dscene">';
1537
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1538
- $html .= '<select class="dscen" name="dscene">';
1539
- $html .= '<option value="on"> Yes</option>';
1540
- $html .= '<option value="off" selected > No</option>';
1541
- $html .= '</select>';
1542
- $html .= '</div>';
1543
- }
1544
- //==Set Default Scene end==//
1545
- $html .= '<div class=scene-setting>';
1546
- $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1547
- $html .= '<input class="sceneid" type="text" name="scene-id" value="'.$scene_id.'" />';
1548
- $html .= '</div>';
1549
-
1550
- $html .= '<div class=scene-setting>';
1551
- $html .= '<label for="scene-type">'.__('Scene Type : ','wpvr').'</label>';
1552
- $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1553
- $html .= '</div>';
1554
-
1555
- $html .= '<div class=scene-setting>';
1556
- $html .= '<label for="scene-upload">'.__('Scene Upload: ','wpvr').'</label>';
1557
- $html .= '<div class="form-group">';
1558
- $html .= '<img name ="scene-photo" src="'.$scene_photo.'"> <br/>';
1559
- $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1560
- $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="'.$scene_photo.'">';
1561
- $html .= '</div>';
1562
- $html .= '</div>';
1563
- $html .= '</div>';
1564
- // ---end scene left---
1565
-
1566
- $html .= '</div>';
1567
-
1568
- if (!empty($pano_hotspots)) {
1569
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1570
-
1571
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1572
- $html .= '<ul>';
1573
- $j = 1;
1574
- $firstvaluehotspot = reset($pano_hotspots);
1575
- foreach ($pano_hotspots as $pano_hotspot) {
1576
-
1577
- if ($pano_hotspot['hotspot-title'] == $firstvaluehotspot['hotspot-title']) {
1578
- $html .= '<li class="active"><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1579
- }
1580
- else {
1581
- $html .= '<li><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1582
- }
1583
- $j++;
1584
- }
1585
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1586
- $html .= '</ul>';
1587
- $html .= '</nav>';
1588
-
1589
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1590
-
1591
- $h = 1;
1592
- $firstvaluehotspotset = reset($pano_hotspots);
1593
- $is_wpvr_premium = apply_filters('is_wpvr_premium', false);
1594
- foreach ($pano_hotspots as $pano_hotspot) {
1595
- $hotspot_title = '';
1596
- $hotspot_title = $pano_hotspot['hotspot-title'];
1597
- $hotspot_pitch = '';
1598
- $hotspot_pitch = $pano_hotspot['hotspot-pitch'];
1599
- $hotspot_yaw = '';
1600
- $hotspot_yaw = $pano_hotspot['hotspot-yaw'];
1601
- $hotspot_type = '';
1602
- $hotspot_type = $pano_hotspot['hotspot-type'];
1603
- $hotspot_url = '';
1604
- $hotspot_url = $pano_hotspot['hotspot-url'];
1605
- $hotspot_content = '';
1606
- $hotspot_content = $pano_hotspot['hotspot-content'];
1607
- $hotspot_hover = '';
1608
- $hotspot_hover = $pano_hotspot['hotspot-hover'];
1609
- $hotspot_target_scene = '';
1610
- $hotspot_target_scene = $pano_hotspot['hotspot-scene'];
1611
- $hotspot_custom_class = '';
1612
- if (isset($pano_hotspot['hotspot-customclass'])) {
1613
- $hotspot_custom_class = $pano_hotspot['hotspot-customclass'];
1614
- }
1615
-
1616
- if ($pano_hotspot['hotspot-title'] == $firstvaluehotspotset['hotspot-title']) {
1617
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
1618
-
1619
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1620
-
1621
- $html .= '<div class="wrapper">';
1622
- $html .= '<div class="hotspot-setting">';
1623
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
1624
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
1625
- $html .= '</div>';
1626
-
1627
- $html .= '<div class="hotspot-setting">';
1628
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'
1629
- </label>';
1630
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
1631
- $html .= '</div>';
1632
-
1633
- $html .= '<div class="hotspot-setting">';
1634
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
1635
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
1636
- $html .= '</div>';
1637
-
1638
- $html .= '<div class="hotspot-setting">';
1639
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
1640
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
1641
- $html .= '</div>';
1642
-
1643
- $html .= '</div>';
1644
-
1645
- //=Hotspot type=//
1646
- if ($hotspot_type == "info") {
1647
-
1648
- $html .= '<div class="hotspot-type hotspot-setting">';
1649
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1650
- $html .= '<select name="hotspot-type">';
1651
- $html .= '<option value="info" selected> Info</option>';
1652
- $html .= '<option value="scene"> Scene</option>';
1653
- $html .= '</select>';
1654
-
1655
- $html .= '<div class="hotspot-url">';
1656
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
1657
- $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
1658
- $html .= '</div>';
1659
-
1660
- $html .= '<div class="hotspot-content">';
1661
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1662
- $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
1663
- $html .= '</div>';
1664
-
1665
- $html .= '<div class="hotspot-hover">';
1666
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').' </label>';
1667
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1668
- $html .= '</div>';
1669
-
1670
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1671
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1672
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1673
- $html .= '<option value="none" selected> None</option>';
1674
- $html .= '</select>';
1675
- $html .= '</div>';
1676
-
1677
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1678
- $html .= '<label for="hotspot-scene"> '.__('Target Scene ID: ','wpvr').'</label>';
1679
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1680
- $html .= '</div>';
1681
-
1682
- $html .= '</div>';
1683
-
1684
- }
1685
- else {
1686
-
1687
- $html .= '<div class="hotspot-type hotspot-setting">';
1688
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1689
- $html .= '<select class="trtr" name="hotspot-type">';
1690
- $html .= '<option value="info"> Info</option>';
1691
- $html .= '<option value="scene" selected> Scene</option>';
1692
- $html .= '</select>';
1693
-
1694
- $html .= '<div class="hotspot-url" style="display:none;">';
1695
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').'</label>';
1696
- $html .= '<input type="url" name="hotspot-url" />';
1697
- $html .= '</div>';
1698
-
1699
- $html .= '<div class="hotspot-content" style="display:none;">';
1700
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').' </label>';
1701
- $html .= '<textarea name="hotspot-content"></textarea>';
1702
- $html .= '</div>';
1703
-
1704
- $html .= '<div class="hotspot-hover">';
1705
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
1706
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1707
- $html .= '</div>';
1708
-
1709
- $html .= '<div class="hotspot-scene" >';
1710
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1711
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1712
- $html .= '<option value="none" selected> None</option>';
1713
- $html .= '</select>';
1714
- $html .= '</div>';
1715
-
1716
- $html .= '<div class="hotspot-scene">';
1717
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
1718
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
1719
- $html .= '</div>';
1720
-
1721
- $html .= '</div>';
1722
-
1723
- }
1724
- //=Hotspot type End=//
1725
- $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1726
- $html .= '</div>';
1727
- }
1728
- else {
1729
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
1730
-
1731
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1732
-
1733
- $html .= '<div class="wrapper">';
1734
- $html .= '<div class="hotspot-setting">';
1735
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
1736
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
1737
- $html .= '</div>';
1738
-
1739
- $html .= '<div class="hotspot-setting">';
1740
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
1741
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
1742
- $html .= '</div>';
1743
-
1744
- $html .= '<div class="hotspot-setting">';
1745
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
1746
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
1747
- $html .= '</div>';
1748
-
1749
- $html .= '<div class="hotspot-setting">';
1750
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
1751
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
1752
- $html .= '</div>';
1753
-
1754
- $html .= '</div>';
1755
-
1756
- //=Hotspot type=//
1757
- if ($hotspot_type == "info") {
1758
-
1759
- $html .= '<div class="hotspot-type hotspot-setting">';
1760
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1761
- $html .= '<select name="hotspot-type">';
1762
- $html .= '<option value="info" selected> Info</option>';
1763
- $html .= '<option value="scene"> Scene</option>';
1764
- $html .= '</select>';
1765
-
1766
- $html .= '<div class="hotspot-url">';
1767
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
1768
- $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
1769
- $html .= '</div>';
1770
-
1771
- $html .= '<div class="hotspot-content">';
1772
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1773
- $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
1774
- $html .= '</div>';
1775
-
1776
- $html .= '<div class="hotspot-hover">';
1777
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
1778
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1779
- $html .= '</div>';
1780
-
1781
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1782
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1783
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1784
- $html .= '<option value="none" selected> None</option>';
1785
- $html .= '</select>';
1786
- $html .= '</div>';
1787
-
1788
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1789
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
1790
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled />';
1791
- $html .= '</div>';
1792
-
1793
- $html .= '</div>';
1794
-
1795
- }
1796
- else {
1797
-
1798
- $html .= '<div class="hotspot-type hotspot-setting">';
1799
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1800
- $html .= '<select class="trtr" name="hotspot-type">';
1801
- $html .= '<option value="info"> Info</option>';
1802
- $html .= '<option value="scene" selected> Scene</option>';
1803
- $html .= '</select>';
1804
-
1805
- $html .= '<div class="hotspot-url" style="display:none;">';
1806
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').'</label>';
1807
- $html .= '<input type="url" name="hotspot-url" />';
1808
- $html .= '</div>';
1809
-
1810
- $html .= '<div class="hotspot-content" style="display:none;">';
1811
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1812
- $html .= '<textarea name="hotspot-content"></textarea>';
1813
- $html .= '</div>';
1814
-
1815
- $html .= '<div class="hotspot-hover">';
1816
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').' </label>';
1817
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1818
- $html .= '</div>';
1819
-
1820
- $html .= '<div class="hotspot-scene" >';
1821
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1822
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1823
- $html .= '<option value="none" selected> None</option>';
1824
- $html .= '</select>';
1825
- $html .= '</div>';
1826
-
1827
- $html .= '<div class="hotspot-scene">';
1828
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
1829
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
1830
- $html .= '</div>';
1831
-
1832
- $html .= '</div>';
1833
-
1834
- }
1835
- //=Hotspot type End=//
1836
- $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1837
- $html .= '</div>';
1838
- }
1839
- $h++;
1840
- }
1841
- $html .= '</div>';
1842
- $html .= '</div>';
1843
- }
1844
- else {
1845
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1846
-
1847
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1848
- $html .= '<ul>';
1849
- $html .= '<li class="active"><span data-index="1" data-href="#scene-'.$s.'-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1850
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1851
- $html .= '</ul>';
1852
- $html .= '</nav>';
1853
-
1854
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1855
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-1">';
1856
-
1857
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1858
-
1859
- $html .= '<div class="wrapper">';
1860
- $html .= '<div class="hotspot-setting">';
1861
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
1862
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1863
- $html .= '</div>';
1864
-
1865
- $html .= '<div class="hotspot-setting">';
1866
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
1867
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1868
- $html .= '</div>';
1869
-
1870
- $html .= '<div class="hotspot-setting">';
1871
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
1872
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1873
- $html .= '</div>';
1874
-
1875
- $html .= '<div class="hotspot-setting">';
1876
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon class: ','wpvr').'</label>';
1877
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1878
- $html .= '</div>';
1879
-
1880
- $html .= '</div>';
1881
-
1882
- $html .= '<div class="hotspot-type hotspot-setting">';
1883
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
1884
- $html .= '<select name="hotspot-type">';
1885
- $html .= '<option value="info" selected> Info</option>';
1886
- $html .= '<option value="scene"> Scene</option>';
1887
- $html .= '</select>';
1888
-
1889
- $html .= '<div class="hotspot-url">';
1890
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').'</label>';
1891
- $html .= '<input type="url" name="hotspot-url" value="" />';
1892
- $html .= '</div>';
1893
-
1894
- $html .= '<div class="hotspot-content">';
1895
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
1896
- $html .= '<textarea name="hotspot-content"></textarea>';
1897
- $html .= '</div>';
1898
-
1899
- $html .= '<div class="hotspot-hover">';
1900
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
1901
- $html .= '<textarea name="hotspot-hover"></textarea>';
1902
- $html .= '</div>';
1903
-
1904
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1905
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
1906
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1907
- $html .= '<option value="none"> None</option>';
1908
- $html .= '</select>';
1909
- $html .= '</div>';
1910
- $html .= '<div class="hotspot-scene" style="display:none;" >';
1911
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
1912
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1913
- $html .= '</div>';
1914
-
1915
- $html .= '</div>';
1916
- //=Hotspot type End=//
1917
- $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1918
- $html .= '</div>';
1919
- $html .= '</div>';
1920
- $html .= '</div>';
1921
- }
1922
- $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1923
- $html .= '</div>';
1924
- }
1925
- else {
1926
- $html .= '<div data-repeater-item class="single-scene rex-pano-tab" data-title="1" id="scene-'.$s.'">';
1927
-
1928
- $html .= '<div class="scene-content">';
1929
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1930
-
1931
- $html .= '<div class="scene-left">';
1932
- //==Set Default Scene==//
1933
- if ($dscene == 'on') {
1934
- $html .= '<div class="single-settings dscene">';
1935
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1936
- $html .= '<select class="dscen" name="dscene">';
1937
- $html .= '<option value="on" selected > Yes</option>';
1938
- $html .= '<option value="off"> No</option>';
1939
- $html .= '</select>';
1940
- $html .= '</div>';
1941
-
1942
- }
1943
- else {
1944
- $html .= '<div class="single-settings dscene">';
1945
- $html .= '<span>'.__('Set as Default: ','wpvr').'</span>';
1946
- $html .= '<select class="dscen" name="dscene">';
1947
- $html .= '<option value="on"> Yes</option>';
1948
- $html .= '<option value="off" selected> No</option>';
1949
- $html .= '</select>';
1950
- $html .= '</div>';
1951
- }
1952
- //==Set Default Scene end==//
1953
-
1954
- $html .= '<div class=scene-setting>';
1955
- $html .= '<label for="scene-id">'.__('Scene ID : ','wpvr').'</label>';
1956
- $html .= '<input class="sceneid" type="text" name="scene-id" value="'.$scene_id.'" />';
1957
- $html .= '</div>';
1958
-
1959
- $html .= '<div class=scene-setting>';
1960
- $html .= '<label for="scene-type">'.__('Scene Type : ','wpvr').'</label>';
1961
- $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1962
- $html .= '</div>';
1963
-
1964
- $html .= '<div class=scene-setting>';
1965
- $html .= '<label for="scene-upload">'.__('Scene Upload: ','wpvr').'</label>';
1966
- $html .= '<div class="form-group">';
1967
- $html .= '<img name ="scene-photo" src="'.$scene_photo.'"> <br/>';
1968
- $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1969
- $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="'.$scene_photo.'">';
1970
- $html .= '</div>';
1971
- $html .= '</div>';
1972
- $html .= '</div>';
1973
- //--end scene left----
1974
-
1975
- $html .= '</div>';
1976
-
1977
- if (!empty($pano_hotspots)) {
1978
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1979
-
1980
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1981
- $html .= '<ul>';
1982
- $j = 1;
1983
- foreach ($pano_hotspots as $pano_hotspot) {
1984
- if ($pano_hotspot['hotspot-title'] == $pano_hotspots[0]['hotspot-title']) {
1985
- $html .= '<li class="active"><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1986
- }
1987
- else {
1988
- $html .= '<li><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1989
- }
1990
- $j++;
1991
- }
1992
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1993
- $html .= '</ul>';
1994
- $html .= '</nav>';
1995
-
1996
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1997
-
1998
- $h = 1;
1999
- foreach ($pano_hotspots as $pano_hotspot) {
2000
- $hotspot_title = '';
2001
- $hotspot_title = $pano_hotspot['hotspot-title'];
2002
- $hotspot_pitch = '';
2003
- $hotspot_pitch = $pano_hotspot['hotspot-pitch'];
2004
- $hotspot_yaw = '';
2005
- $hotspot_yaw = $pano_hotspot['hotspot-yaw'];
2006
- $hotspot_type = '';
2007
- $hotspot_type = $pano_hotspot['hotspot-type'];
2008
- $hotspot_url = '';
2009
- $hotspot_url = $pano_hotspot['hotspot-url'];
2010
- $hotspot_content = '';
2011
- $hotspot_content = $pano_hotspot['hotspot-content'];
2012
- $hotspot_hover = '';
2013
- $hotspot_hover = $pano_hotspot['hotspot-hover'];
2014
- $hotspot_target_scene = '';
2015
- $hotspot_target_scene = $pano_hotspot['hotspot-scene'];
2016
- $hotspot_custom_class = '';
2017
- if (isset($pano_hotspot['hotspot-customclass'])) {
2018
- $hotspot_custom_class = $pano_hotspot['hotspot-customclass'];
2019
- }
2020
-
2021
- if ($pano_hotspot['hotspot-title'] == $pano_hotspots[0]['hotspot-title']) {
2022
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
2023
-
2024
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
2025
-
2026
- $html .= '<div class="wrapper">';
2027
- $html .= '<div class="hotspot-setting">';
2028
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
2029
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
2030
- $html .= '</div>';
2031
-
2032
- $html .= '<div class="hotspot-setting">';
2033
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
2034
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
2035
- $html .= '</div>';
2036
-
2037
- $html .= '<div class="hotspot-setting">';
2038
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
2039
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
2040
- $html .= '</div>';
2041
-
2042
- $html .= '<div class="hotspot-setting">';
2043
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
2044
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
2045
- $html .= '</div>';
2046
-
2047
- $html .= '</div>';
2048
-
2049
- //=Hotspot type=//
2050
- if ($hotspot_type == "info") {
2051
-
2052
- $html .= '<div class="hotspot-type hotspot-setting">';
2053
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
2054
- $html .= '<select name="hotspot-type">';
2055
- $html .= '<option value="info" selected> Info</option>';
2056
- $html .= '<option value="scene"> Scene</option>';
2057
- $html .= '</select>';
2058
-
2059
- $html .= '<div class="hotspot-url">';
2060
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
2061
- $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
2062
- $html .= '</div>';
2063
-
2064
- $html .= '<div class="hotspot-content">';
2065
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').' </label>';
2066
- $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
2067
- $html .= '</div>';
2068
-
2069
- $html .= '<div class="hotspot-hover">';
2070
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').' </label>';
2071
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2072
- $html .= '</div>';
2073
-
2074
- $html .= '<div class="hotspot-scene" style="display:none;" >';
2075
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
2076
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2077
- $html .= '<option value="none" selected> None</option>';
2078
- $html .= '</select>';
2079
- $html .= '</div>';
2080
-
2081
- $html .= '<div class="hotspot-scene" style="display:none;" >';
2082
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').' </label>';
2083
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene"/>';
2084
- $html .= '</div>';
2085
-
2086
- $html .= '</div>';
2087
-
2088
- }
2089
- else {
2090
-
2091
- $html .= '<div class="hotspot-type hotspot-setting">';
2092
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
2093
- $html .= '<select class="trtr" name="hotspot-type">';
2094
- $html .= '<option value="info"> Info</option>';
2095
- $html .= '<option value="scene" selected> Scene</option>';
2096
- $html .= '</select>';
2097
-
2098
- $html .= '<div class="hotspot-url" style="display:none;">';
2099
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
2100
- $html .= '<input type="url" name="hotspot-url" />';
2101
- $html .= '</div>';
2102
-
2103
- $html .= '<div class="hotspot-content" style="display:none;">';
2104
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
2105
- $html .= '<textarea name="hotspot-content"></textarea>';
2106
- $html .= '</div>';
2107
-
2108
- $html .= '<div class="hotspot-hover">';
2109
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').' </label>';
2110
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2111
- $html .= '</div>';
2112
-
2113
- $html .= '<div class="hotspot-scene" >';
2114
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
2115
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2116
- $html .= '<option value="none" selected> None</option>';
2117
- $html .= '</select>';
2118
- $html .= '</div>';
2119
-
2120
- $html .= '<div class="hotspot-scene">';
2121
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
2122
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
2123
- $html .= '</div>';
2124
-
2125
- $html .= '</div>';
2126
-
2127
- }
2128
- //=Hotspot type End=//
2129
- $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
2130
- $html .= '</div>';
2131
- }
2132
- else {
2133
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
2134
-
2135
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting</h6>';
2136
-
2137
- $html .= '<div class="wrapper">';
2138
- $html .= '<div class="hotspot-setting">';
2139
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
2140
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
2141
- $html .= '</div>';
2142
-
2143
- $html .= '<div class="hotspot-setting">';
2144
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
2145
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
2146
- $html .= '</div>';
2147
-
2148
- $html .= '<div class="hotspot-setting">';
2149
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
2150
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
2151
- $html .= '</div>';
2152
-
2153
- $html .= '<div class="hotspot-setting">';
2154
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom icon Class: ','wpvr').'</label>';
2155
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
2156
- $html .= '</div>';
2157
-
2158
- $html .= '</div>';
2159
-
2160
- //=Hotspot type=//
2161
- if ($hotspot_type == "info") {
2162
-
2163
- $html .= '<div class="hotspot-type hotspot-setting">';
2164
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
2165
- $html .= '<select name="hotspot-type">';
2166
- $html .= '<option value="info" selected> Info</option>';
2167
- $html .= '<option value="scene"> Scene</option>';
2168
- $html .= '</select>';
2169
-
2170
- $html .= '<div class="hotspot-url">';
2171
- $html .= '<label for="hotspot-url">'.__(' URL: ','wpvr').'</label>';
2172
- $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
2173
- $html .= '</div>';
2174
-
2175
- $html .= '<div class="hotspot-content">';
2176
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').' </label>';
2177
- $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
2178
- $html .= '</div>';
2179
-
2180
- $html .= '<div class="hotspot-hover">';
2181
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').' </label>';
2182
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2183
- $html .= '</div>';
2184
-
2185
- $html .= '<div class="hotspot-scene" style="display:none;" >';
2186
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
2187
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2188
- $html .= '<option value="none" selected> None</option>';
2189
- $html .= '</select>';
2190
- $html .= '</div>';
2191
-
2192
- $html .= '<div class="hotspot-scene" style="display:none;" >';
2193
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').' </label>';
2194
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled />';
2195
- $html .= '</div>';
2196
-
2197
- $html .= '</div>';
2198
-
2199
- }
2200
- else {
2201
-
2202
- $html .= '<div class="hotspot-type hotspot-setting">';
2203
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
2204
- $html .= '<select class="trtr" name="hotspot-type">';
2205
- $html .= '<option value="info"> Info</option>';
2206
- $html .= '<option value="scene" selected> Scene</option>';
2207
- $html .= '</select>';
2208
-
2209
- $html .= '<div class="hotspot-url" style="display:none;">';
2210
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').' </label>';
2211
- $html .= '<input type="url" name="hotspot-url" />';
2212
- $html .= '</div>';
2213
-
2214
- $html .= '<div class="hotspot-content" style="display:none;">';
2215
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').' </label>';
2216
- $html .= '<textarea name="hotspot-content"></textarea>';
2217
- $html .= '</div>';
2218
-
2219
- $html .= '<div class="hotspot-hover">';
2220
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
2221
- $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2222
- $html .= '</div>';
2223
-
2224
- $html .= '<div class="hotspot-scene" >';
2225
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
2226
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2227
- $html .= '<option value="none" selected> None</option>';
2228
- $html .= '</select>';
2229
- $html .= '</div>';
2230
-
2231
- $html .= '<div class="hotspot-scene">';
2232
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').' </label>';
2233
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
2234
- $html .= '</div>';
2235
-
2236
- $html .= '</div>';
2237
-
2238
- }
2239
- //=Hotspot type End=//
2240
- $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
2241
- $html .= '</div>';
2242
- }
2243
- $h++;
2244
- }
2245
- $html .= '</div>';
2246
- $html .= '</div>';
2247
- }
2248
- else {
2249
- $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
2250
-
2251
- $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
2252
- $html .= '<ul>';
2253
- $html .= '<li class="active"><span data-index="1" data-href="#scene-'.$s.'-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
2254
- $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
2255
- $html .= '</ul>';
2256
- $html .= '</nav>';
2257
-
2258
- $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
2259
- $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-1">';
2260
-
2261
- $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
2262
-
2263
- $html .= '<div class="wrapper">';
2264
- $html .= '<div class="hotspot-setting">';
2265
- $html .= '<label for="hotspot-title">'.__('Hotspot ID : ','wpvr').'</label>';
2266
- $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
2267
- $html .= '</div>';
2268
-
2269
- $html .= '<div class="hotspot-setting">';
2270
- $html .= '<label for="hotspot-pitch">'.__('Pitch: ','wpvr').'</label>';
2271
- $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
2272
- $html .= '</div>';
2273
-
2274
- $html .= '<div class="hotspot-setting">';
2275
- $html .= '<label for="hotspot-yaw">'.__('Yaw: ','wpvr').'</label>';
2276
- $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
2277
- $html .= '</div>';
2278
-
2279
- $html .= '<div class="hotspot-setting">';
2280
- $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ','wpvr').'</label>';
2281
- $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
2282
- $html .= '</div>';
2283
-
2284
- $html .= '</div>';
2285
-
2286
- $html .= '<div class="hotspot-type hotspot-setting">';
2287
- $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ','wpvr').'</label>';
2288
- $html .= '<select name="hotspot-type">';
2289
- $html .= '<option value="info" selected> Info</option>';
2290
- $html .= '<option value="scene"> Scene</option>';
2291
- $html .= '</select>';
2292
-
2293
- $html .= '<div class="hotspot-url">';
2294
- $html .= '<label for="hotspot-url">'.__('URL: ','wpvr').'</label>';
2295
- $html .= '<input type="url" name="hotspot-url" value="" />';
2296
- $html .= '</div>';
2297
-
2298
- $html .= '<div class="hotspot-content">';
2299
- $html .= '<label for="hotspot-content">'.__('On Click Content: ','wpvr').'</label>';
2300
- $html .= '<textarea name="hotspot-content"></textarea>';
2301
- $html .= '</div>';
2302
-
2303
- $html .= '<div class="hotspot-hover">';
2304
- $html .= '<label for="hotspot-hover">'.__('On Hover Content: ','wpvr').'</label>';
2305
- $html .= '<textarea name="hotspot-hover"></textarea>';
2306
- $html .= '</div>';
2307
-
2308
- $html .= '<div class="hotspot-scene" style="display:none;" >';
2309
- $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ','wpvr').'</label>';
2310
- $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2311
- $html .= '<option value="none"> None</option>';
2312
- $html .= '</select>';
2313
- $html .= '</div>';
2314
- $html .= '<div class="hotspot-scene" style="display:none;" >';
2315
- $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ','wpvr').'</label>';
2316
- $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
2317
- $html .= '</div>';
2318
-
2319
- $html .= '</div>';
2320
- //=Hotspot type End=//
2321
- $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
2322
- $html .= '</div>';
2323
- $html .= '</div>';
2324
- $html .= '</div>';
2325
- }
2326
- $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
2327
- $html .= '</div>';
2328
- }
2329
- $s++;
2330
  }
2331
- $html .= '</div>';
 
 
 
 
 
 
 
 
 
2332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2333
  $html .= '</div>';
2334
- }
2335
 
2336
- $html .= '<div class="preview-btn-wrapper">';
2337
- $html .= '<div class="preview-btn-area clearfix">';
 
 
 
 
 
 
 
2338
 
2339
- $html .= '<button id="panolenspreview">'.__('Preview','wpvr').'</button>';
 
 
2340
  $html .= '</div>';
2341
- $html .= '</div>';
2342
- $html .='</div>';
2343
- //---end scenes tab----
2344
- $html .= '<div id="error_occured"></div>';
2345
-
2346
- //----start video tab content---------
2347
- $html .='<div class="rex-pano-tab video" id="video">';
2348
- $html .= '<h6 class="title"> '.__('Video Settings : ','wpvr').'</h6>';
2349
- //==Video Setup==//
2350
- if (isset($postdata['vidid'])) {
2351
- $vidautoplay = $postdata['vidautoplay'];
2352
- $vidautoplay_on = '';
2353
- $vidautoplay_off = '';
2354
- if (!empty($vidautoplay)) {
2355
- $vidautoplay_on = 'checked';
2356
- }
2357
- else {
2358
- $vidautoplay_off = 'checked';
2359
- }
2360
-
2361
- $vidcontrol = $postdata['vidcontrol'];
2362
- $vidcontrol_on = '';
2363
- $vidcontrol_off = '';
2364
- if (!empty($vidcontrol)) {
2365
- $vidcontrol_on = 'checked';
2366
- }
2367
- else {
2368
- $vidcontrol_off = 'checked';
2369
- }
2370
- $html .= '<div class="single-settings videosetup">';
2371
- $html .= '<span>'.__('Enable Video:','wpvr').'</span>';
2372
- $html .= '<ul>';
2373
- $html .= '<li class="radio-btn">';
2374
- $html .= '<input class="styled-radio" id="styled-radio" type="radio" name="panovideo" value="off" >';
2375
- $html .= '<label for="styled-radio">Off</label>';
2376
- $html .= '</li>';
2377
-
2378
- $html .= '<li class="radio-btn">';
2379
- $html .= '<input class="styled-radio" id="styled-radio-0" type="radio" name="panovideo" value="on" checked>';
2380
- $html .= '<label for="styled-radio-0">On</label>';
2381
- $html .= '</li>';
2382
- $html .= '</ul>';
2383
  $html .= '</div>';
2384
 
 
 
 
 
 
 
2385
 
2386
- $html .= '<div class="video-setting" style="display:none;">';
2387
- $html .= '<div class="single-settings">';
2388
- $html .= '<span>'.__('Upload or Add Link: ','wpvr').'</span>';
2389
- $html .= '<div class="form-group">';
2390
- $html .= '<input type="text" name="video-attachment-url" placeholder="Paste Youtube or Vimeo link or upload" class="video-attachment-url" value="'.$postdata['vidurl'].'">';
2391
- $html .= '<input type="button" class="video-upload" data-info="" value="Upload" />';
2392
- $html .= '</div>';
2393
- $html .= '</div>';
2394
- $html .= '<button id="videopreview">Preview</button>';
2395
  $html .= '</div>';
2396
- }
2397
- else {
2398
- $html .= '<div class="single-settings videosetup">';
2399
- $html .= '<span>'.__('Enable Video: ','wpvr').'</span>';
2400
- $html .= '<ul>';
2401
- $html .= '<li class="radio-btn">';
2402
- $html .= '<input class="styled-radio" id="styled-radio" type="radio" name="panovideo" value="off" checked >';
2403
- $html .= '<label for="styled-radio">Off</label>';
2404
- $html .= '</li>';
2405
-
2406
- $html .= '<li class="radio-btn">';
2407
- $html .= '<input class="styled-radio" id="styled-radio-0" type="radio" name="panovideo" value="on" >';
2408
- $html .= '<label for="styled-radio-0">On</label>';
2409
- $html .= '</li>';
2410
- $html .= '</ul>';
2411
  $html .= '</div>';
2412
 
2413
- //==Video setup end==//
 
 
 
 
 
 
 
 
 
2414
 
2415
- //==Video Setting==/
2416
- $html .= '<div class="video-setting" style="display:none;">';
2417
- $html .= '<div class="single-settings">';
2418
- $html .= '<span>'.__('Upload or Add Link: ','wpvr').'</span>';
2419
- $html .= '<div class="form-group">';
2420
- $html .= '<input type="text" placeholder="Paste Youtube or Vimeo link or upload" name="video-attachment-url" class="video-attachment-url" value="">';
2421
- $html .= '<input type="button" class="video-upload" data-info="" value="Upload"/>';
2422
- $html .= '</div>';
2423
- $html .= '</div>';
2424
- $html .= '<button id="videopreview">Preview</button>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2425
  $html .= '</div>';
2426
  }
 
2427
 
2428
- $html .= '<div class="wpvr-use-shortcode">';
2429
- $post = get_post();
2430
- $id = $post->ID;
2431
- $slug = $post->post_name;
2432
- $postdata = get_post_meta( $post->ID, 'panodata', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2433
 
2434
- $html .= '<h4 class="area-title">'.__('Using this Tour', 'wpvr').'</h4>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2435
 
2436
- $html .= '<div class="shortcode-wrapper">';
2437
- $html .= '<div class="single-shortcode classic">';
2438
- $html .= '<span class="shortcode-title">'.__('For Classic Editor:', 'wpvr').'</span>';
2439
 
2440
- $html .= '<div class="field-wapper">';
2441
- $html .= '<span>'.__('To use this WP VR tour in your posts or pages use the following shortcode ','wpvr').'</span>';
2442
 
2443
- $html .= '<div class="shortcode-field">';
2444
- $html .= '<p class="copycode" id="copy-shortcode-video">[wpvr id="'.$id.'"]</p>';
2445
- $html .= '<span id="wpvr-copy-shortcode-video" class="wpvr-copy-shortcode">';
2446
- $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/copy.png'.'" alt="icon" />';
2447
- $html .= '</span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2448
  $html .= '</div>';
2449
 
2450
- $html .= '<span id="wpvr-copied-notice-video" class="wpvr-copied-notice"></span>';
 
 
 
2451
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2452
  $html .= '</div>';
2453
- $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2454
  $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
2455
 
2456
- $html .= '<script>';
2457
- $html .= '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2458
 
2459
  document.getElementById("wpvr-copy-shortcode-video").addEventListener("click", function() {
2460
  copyToClipboardVideo(document.getElementById("copy-shortcode-video"));
@@ -2518,41 +2485,40 @@ class Wpvr_Admin {
2518
 
2519
  ';
2520
 
2521
- $html .= '</script>';
2522
- $html .= '</div>';
2523
- //=end shortcode area=
2524
- //==Video Setting End==//
2525
 
2526
- $html .='</div>';
2527
- //---end video tab----
2528
- $html .='</div>';
2529
- //---end rex-pano-tab-content----
2530
  $html .='</div>';
2531
  //---end rex-pano-tabs---
2532
- $html .= '</div>';
2533
- $html .= '<div class="wpvr-loading" style="display:none;">Loading&#8230;</div>';
2534
- echo $html;
2535
- }
2536
-
2537
- /**
2538
- * Rollback execution
2539
- */
2540
- public function trigger_rollback() {
2541
- if (isset($_GET['wpvr_version'])) {
2542
- $version = $_GET['wpvr_version'];
2543
- $plugin_slug = 'wpvr';
2544
- $rollback = new WPVR_Rollback(
2545
- [
2546
- 'version' => $version,
2547
- 'plugin_name' => 'wpvr',
2548
- 'plugin_slug' => $plugin_slug,
2549
- 'package_url' => sprintf( 'https://downloads.wordpress.org/plugin/%s.%s.zip', $plugin_slug, $version ),
2550
- ]
2551
- );
2552
-
2553
- $rollback->run();
2554
- }
2555
- }
2556
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2557
 
 
 
 
2558
  }
1
  <?php
2
+ if (! defined('ABSPATH')) {
3
+ exit;
4
+ } // Exit if accessed directly
5
  /**
6
  * The admin-specific functionality of the plugin.
7
  *
22
  * @subpackage Wpvr/admin
23
  * @author Rextheme <sakib@coderex.co>
24
  */
25
+ class Wpvr_Admin
26
+ {
27
+
28
+ /**
29
+ * The ID of this plugin.
30
+ *
31
+ * @since 1.0.0
32
+ * @access private
33
+ * @var string $plugin_name The ID of this plugin.
34
+ */
35
+ private $plugin_name;
36
+
37
+ /**
38
+ * The version of this plugin.
39
+ *
40
+ * @since 1.0.0
41
+ * @access private
42
+ * @var string $version The current version of this plugin.
43
+ */
44
+ private $version;
45
+
46
+ /**
47
+ * The post type of this plugin.
48
+ *
49
+ * @since 1.0.0
50
+ */
51
+ private $post_type;
52
+
53
+ /**
54
+ * Initialize the class and set its properties.
55
+ *
56
+ * @since 1.0.0
57
+ * @param string $plugin_name The name of this plugin.
58
+ * @param string $version The version of this plugin.
59
+ */
60
+ public function __construct($plugin_name, $version, $post_type)
61
+ {
62
+ $this->plugin_name = $plugin_name;
63
+ $this->version = $version;
64
+ $this->post_type = $post_type;
65
+ }
66
+
67
+ /**
68
+ * Register the stylesheets for the admin area.
69
+ *
70
+ * @since 1.0.0
71
+ */
72
+ public function enqueue_styles()
73
+ {
74
+
75
+ /**
76
+ * This function is provided for demonstration purposes only.
77
+ *
78
+ * An instance of this class should be passed to the run() function
79
+ * defined in Wpvr_Loader as all of the hooks are defined
80
+ * in that particular class.
81
+ *
82
+ * The Wpvr_Loader will then create the relationship
83
+ * between the defined hooks and the functions defined in this
84
+ * class.
85
+ */
86
+
87
+ $screen = get_current_screen();
88
+ if ($screen->id=="toplevel_page_wpvr") {
89
+ wp_enqueue_style('materialize-css', plugin_dir_url(__FILE__) . 'css/materialize.min.css', array(), $this->version, 'all');
90
+ wp_enqueue_style('materialize-icons', plugin_dir_url(__FILE__) . 'lib/materializeicon.css', array(), $this->version, 'all');
91
+ wp_enqueue_style('owl-css', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css', array(), $this->version, 'all');
92
+
93
+ wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/wpvr-admin.css', array(), $this->version, 'all');
94
+ }
95
+
96
+ if ($screen->id=="wpvr_item") {
97
+ wp_enqueue_style($this->plugin_name . 'fontawesome', plugin_dir_url(__FILE__) . 'lib/fontawesome/css/all.css', array(), $this->version, 'all');
98
+ wp_enqueue_style('icon-picker-css', plugin_dir_url(__FILE__) . 'css/jquery.fonticonpicker.min.css', array(), $this->version, 'all');
99
+ wp_enqueue_style('icon-picker-css-theme', plugin_dir_url(__FILE__) . 'css/jquery.fonticonpicker.grey.min.css', array(), $this->version, 'all');
100
+ wp_enqueue_style('owl-css', plugin_dir_url(__FILE__) . 'css/owl.carousel.css', array(), $this->version, 'all');
101
+ wp_enqueue_style('panellium-css', plugin_dir_url(__FILE__) . 'lib/pannellum/src/css/pannellum.css', array(), true);
102
+ wp_enqueue_style('videojs-css', plugin_dir_url(__FILE__) . 'lib/pannellum/src/css/video-js.css', array(), true);
103
+ wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/wpvr-admin.css', array(), $this->version, 'all');
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Register the JavaScript for the admin area.
109
+ *
110
+ * @since 1.0.0
111
+ */
112
+ public function enqueue_scripts()
113
+ {
114
+
115
+ /**
116
+ * This function is provided for demonstration purposes only.
117
+ *
118
+ * An instance of this class should be passed to the run() function
119
+ * defined in Wpvr_Loader as all of the hooks are defined
120
+ * in that particular class.
121
+ *
122
+ * The Wpvr_Loader will then create the relationship
123
+ * between the defined hooks and the functions defined in this
124
+ * class.
125
+ */
126
+ wp_enqueue_script('wp-api');
127
+ $adscreen = get_current_screen();
128
+ wp_enqueue_media();
129
+ if ($adscreen->id=="wpvr_item" || $adscreen->id=="toplevel_page_wpvr") {
130
+ wp_enqueue_script('wpvr-icon-picker', plugin_dir_url(__FILE__) . 'lib/jquery.fonticonpicker.min.js', array(), true);
131
+ wp_enqueue_script('panellium-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/pannellum.js', array(), true);
132
+ wp_enqueue_script('panelliumlib-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/libpannellum.js', array(), true);
133
+ wp_enqueue_script('videojs-js', plugin_dir_url(__FILE__) .'js/video.js', array('jquery'), true);
134
+ wp_enqueue_script('panelliumvid-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/videojs-pannellum-plugin.js', array(), true);
135
+ wp_enqueue_script('jquery-repeater', plugin_dir_url(__FILE__) .'js/jquery.repeater.min.js', array('jquery'), true);
136
+ wp_enqueue_script('icon-picker', plugin_dir_url(__FILE__) . 'lib/jquery.fonticonpicker.min.js', array(), true);
137
+ wp_enqueue_script('owl', plugin_dir_url(__FILE__) . 'js/owl.carousel.js', array( 'jquery' ), false);
138
+ wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wpvr-admin.js', array( 'jquery' ), $this->version, true);
139
+ wp_localize_script($this->plugin_name, 'wpvr_obj', array(
140
+ 'ajaxurl' => admin_url('admin-ajax.php'),
141
+ 'ajax_nonce' => wp_create_nonce('wpvr'),
142
+ ));
143
+ }
144
+
145
+ if ($adscreen->id=="toplevel_page_wpvr") {
146
+ wp_enqueue_script('materialize-js', plugin_dir_url(__FILE__) . 'js/materialize.min.js', array( 'jquery' ), $this->version, false);
147
+ }
148
+ wp_enqueue_script('owl-js', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js', array( 'jquery' ), false);
149
+ wp_enqueue_script('wpvr-global', plugin_dir_url(__FILE__) . 'js/wpvr-global.js', array( 'jquery' ), $this->version, false);
150
+ wp_localize_script('wpvr-global', 'wpvr_global_obj', array(
151
+ 'ajaxurl' => admin_url('admin-ajax.php'),
152
+ 'ajax_nonce' => wp_create_nonce('wpvr_global'),
153
+ ));
154
  }
 
 
 
 
 
 
 
155
 
156
 
157
  /**
160
  * @param $links
161
  * @return array
162
  */
163
+ public function plugin_action_links_wpvr($actions, $plugin_file, $plugin_data, $context)
164
+ {
165
  $actions['get_started'] = sprintf(
166
  '<a href="%s">%s</a>',
167
+ esc_url(admin_url('admin.php?page=wpvr')),
168
+ esc_html__('Get Started', 'wpvr')
169
  );
170
  $actions['documentation'] = sprintf(
171
  '<a href="%s" target="_blank">%s</a>',
172
+ esc_url('https://rextheme.com/docs-category/wp-vr/'),
173
+ esc_html__('Documentation', 'wpvr')
174
  );
175
 
176
+ if (!apply_filters('is_wpvr_pro_active', false)) {
177
  $actions['go-pro'] = sprintf(
178
  '<a href="%s" target="_blank" style="color: #201cfe; font-weight: bold;">%s</a>',
179
+ esc_url('https://rextheme.com/wpvr/#pricing'),
180
+ esc_html__('Go Pro', 'wpvr')
181
  );
182
  }
183
  return $actions;
185
 
186
 
187
  /**
188
+ * Init the edit screen of the plugin post type item
189
+ *
190
+ * @since 1.0.0
191
+ */
192
+ public function wpvr_admin_init()
193
+ {
194
+ /*
195
+ * Documentation : https://developer.wordpress.org/reference/functions/add_meta_box/
196
+ */
197
+
198
+ add_meta_box(
199
+ $this->post_type . '_builder__box',
200
+ __('Tour Preview', $this->plugin_name),
201
+ array($this, 'wpvr_display_meta_box_builder'),
202
+ $this->post_type,
203
+ 'side',
204
+ 'high'
205
+ );
206
+ }
207
+
208
+
209
+ /**
210
+ * Register the custom post type
211
+ *
212
+ * @since 1.0.0
213
+ */
214
+ public function wpvr_add_plugin_custom_post_type()
215
+ {
216
+ $labels = array(
217
+ 'name' => __('Tours', $this->plugin_name),
218
+ 'singular_name' => __('Tours', $this->plugin_name),
219
+ 'add_new' => __('Add New Tour', $this->plugin_name),
220
+ 'add_new_item' => __('Add New Tour', $this->plugin_name),
221
+ 'edit_item' => __('Edit Tour', $this->plugin_name),
222
+ 'new_item' => __('New Tour', $this->plugin_name),
223
+ 'view_item' => __('View Tour', $this->plugin_name),
224
+ 'search_items' => __('Search Wpvr Tour', $this->plugin_name),
225
+ 'not_found' => __('No Wpvr Tour found', $this->plugin_name),
226
+ 'not_found_in_trash'=> __('No Wpvr Tour found in Trash', $this->plugin_name),
227
+ 'parent_item_colon' => '',
228
+ 'all_items' => __('All Tours', $this->plugin_name),
229
+ 'menu_name' => __('WP VR', $this->plugin_name),
230
+ );
231
+
232
+ $args = array(
233
+ 'labels' => $labels,
234
+ 'public' => false,
235
+ 'show_ui' => true,
236
+ 'show_in_menu' => false,
237
+ 'menu_position' => 100,
238
+ 'supports' => array( 'title' ),
239
+ 'menu_icon' => plugins_url(). '/wpvr/images/icon.png',
240
+ 'capabilities' => array(
241
+ 'edit_post' => 'edit_wpvr_tour',
242
+ 'edit_posts' => 'edit_wpvr_tours',
243
+ 'edit_others_posts' => 'edit_other_wpvr_tours',
244
+ 'publish_posts' => 'publish_wpvr_tours',
245
+ 'read_post' => 'read_wpvr_tour',
246
+ 'read_private_posts' => 'read_private_wpvr_tours',
247
+ 'delete_post' => 'delete_wpvr_tour'
248
+ ),
249
+ 'map_meta_cap' => true,
250
+ );
251
+
252
+ /**
253
+ * Documentation : https://codex.wordpress.org/Function_Reference/register_post_type
254
+ */
255
+ register_post_type($this->post_type, $args);
256
+ }
257
+
258
+ /**
259
+ * Populates the data in the custom columns
260
+ *
261
+ * @since 1.0.0
262
+ */
263
+ public function wpvr_manage_posts_custom_column($column_name)
264
+ {
265
+ $post = get_post();
266
+
267
+ switch ($column_name) {
268
+ case 'shortcode':
269
+ echo '<code>[wpvr id="' . $post->ID . '"]</code>';
270
+ break;
271
+ default:
272
+ break;
273
+ }
274
+ }
275
+
276
+ /**
277
+ * Adds the custom columns to the post type admin screen
278
+ *
279
+ * @since 1.0.0
280
+ */
281
+ public function wpvr_manage_post_columns()
282
+ {
283
+ $columns = array(
284
+ 'cb' => '<input type="checkbox" />',
285
+ 'title' => __('Title', $this->plugin_name),
286
+ 'shortcode' => __('Shortcodes', $this->plugin_name),
287
+ 'author' => __('Author', $this->plugin_name),
288
+ 'date' => __('Date', $this->plugin_name)
289
+ );
290
+ return $columns;
291
+ }
292
+
293
+ /**
294
+ * Sets the messages for the custom post type
295
+ *
296
+ * @since 1.0.0
297
+ */
298
+ public function wpvr_post_updated_messages($messages)
299
+ {
300
+ $messages[$this->post_type][1] = __('WP VR item updated.', $this->plugin_name);
301
+ $messages[$this->post_type][4] = __('WP VR item updated.', $this->plugin_name);
302
+
303
+ return $messages;
304
+ }
305
+
306
+ /**
307
+ * Render the shortcode box for this plugin.
308
+ *
309
+ * @since 1.0.0
310
+ */
311
+ public function wpvr_display_meta_box_shortcode()
312
+ {
313
+ include_once('partials/wpvr-meta-box-shortcode-display.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  }
 
315
 
316
+ /**
317
+ * Render the builder box for this plugin.
318
+ *
319
+ * @since 1.0.0
320
+ */
321
+ public function wpvr_display_meta_box_builder()
322
+ {
323
+ include_once('partials/wpvr-meta-box-builder-display.php');
324
+ }
325
+
326
+ /**
327
+ * Custom Metabox
328
+ */
329
+ public function wpvr_add_setup_metabox()
330
+ {
331
+ add_meta_box('setup', __('Setup'), array($this, 'wpvr_setup'), 'wpvr_item', 'normal', 'high');
332
+ }
333
+ public function wpvr_setup($post)
334
+ {
335
+ $data_limit = 5;
336
 
337
+ $scene_limit = $data_limit + 1;
338
+ $postdata = get_post_meta($post->ID, 'panodata', true);
339
 
340
 
341
+ $autoload = true;
342
+ if (isset($postdata["autoLoad"])) {
343
+ $autoload = $postdata["autoLoad"];
344
+ }
345
 
346
+ $control = true;
347
+ if (isset($postdata["showControls"])) {
348
  $control = $postdata["showControls"];
349
+ }
350
 
351
+ $default_scene = '';
352
+ if (isset($postdata["defaultscene"])) {
353
+ $default_scene = $postdata["defaultscene"];
354
+ }
355
 
356
+ $preview = '';
357
+ if (isset($postdata['preview'])) {
358
+ $preview = $postdata['preview'];
359
+ }
360
 
361
+ $autorotation = '';
362
+ if (isset($postdata["autoRotate"])) {
363
+ $autorotation = $postdata["autoRotate"];
364
+ } else {
365
+ $autorotation = -5;
366
+ }
367
+ $autorotationinactivedelay = '';
368
+ if (isset($postdata["autoRotateInactivityDelay"])) {
369
+ $autorotationinactivedelay = $postdata["autoRotateInactivityDelay"];
370
+ }
 
371
 
372
+ $autorotationstopdelay = '';
373
+ if (isset($postdata["autoRotateStopDelay"])) {
374
+ $autorotationstopdelay = $postdata["autoRotateStopDelay"];
375
+ }
376
 
377
+ $scene_fade_duration = '';
378
+ if (isset($postdata["scenefadeduration"])) {
379
+ $scene_fade_duration = $postdata["scenefadeduration"];
380
+ }
381
 
382
+ $pano_data = '';
383
+ if (isset($postdata["panodata"])) {
384
+ $pano_data = $postdata["panodata"];
385
+ }
386
 
387
+ $custom_icon_array = new Wpvr_fontawesome_icons();
388
+ $custom_icon = $custom_icon_array->icon;
389
 
390
+ $html = '';
391
 
392
 
393
 
394
+ $html .= '<div class="pano-setup">';
395
 
396
  // active tab variables
397
  $active_tab = 'general';
398
  $scene_active_tab = 1;
399
  $hotspot_active_tab = 1;
400
+ if (isset($_GET['active_tab'])) {
401
  $active_tab = $_GET['active_tab'];
402
  }
403
+ if (isset($_GET['scene'])) {
404
  $scene_active_tab = $_GET['scene'];
405
  }
406
+ if (isset($_GET['hotspot'])) {
407
  $hotspot_active_tab = $_GET['hotspot'];
408
  }
409
 
416
  $html .= '<input type="hidden" value="'.$hotspot_active_tab.'" name="wpvr_active_hotspot" id="wpvr_active_hotspot"/>';
417
 
418
  $html .= '<div class="pano-alert scene-alert">';
419
+ $html .= '<span class="destroy"><i class="fa fa-times"></i></span>';
420
+ $html .= '<p></p>';
421
  $html .= '</div>';
422
 
423
  $html .='<div class="rex-pano-tabs">';
424
+ $html .='<nav class="rex-pano-tab-nav rex-pano-nav-menu main-nav" id="wpvr-main-nav">';
425
+ $html .='<ul>';
426
+ $html .='<li class="logo"><img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/logo.png'.'" alt="logo" /></li>';
427
+
428
+ $html .='<li class="general active" data-screen="general">';
429
+ $html .='<span data-href="#general">';
430
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-regular.png'.'" alt="icon" class="regular" />';
431
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/general-hover.png'.'" alt="icon" class="hover" />';
432
+ $html .=''.__('General', 'wpvr').'</span>';
433
+ $html .='</li>';
434
+
435
+ $html .='<li class="scene" data-screen="scene">';
436
+ $html .='<span data-href="#scenes">';
437
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-regular.png'.'" alt="icon" class="regular" />';
438
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/scenes-hover.png'.'" alt="icon" class="hover" />';
439
+ $html .=''.__('Scenes', 'wpvr').'</span>';
440
+ $html .='</li>';
441
+
442
+ $html .='<li class="hotspot" data-screen="hotspot">';
443
+ $html .='<span data-href="#scenes">';
444
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-regular.png'.'" alt="icon" class="regular" />';
445
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/hotspot-hover.png'.'" alt="icon" class="hover" />';
446
+ $html .=''.__('Hotspot', 'wpvr').'</span>';
447
+ $html .='</li>';
448
+
449
+ $html .='<li class="video" data-screen="video">';
450
+ $html .='<span data-href="#video">';
451
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-regular.png'.'" alt="icon" class="regular" />';
452
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/video-hover.png'.'" alt="icon" class="hover" />';
453
+ $html .=''.__('Video', 'wpvr').'</span>';
454
+ $html .='</li>';
455
+ $html .='</ul>';
456
+ $html .='</nav>';
457
+
458
+ $html .='<div class="rex-pano-tab-content" id="wpvr-main-tab-contents">';
459
+ $html .='<div class="rex-pano-tab general active" id="general">';
460
+
461
+ //=start inner tab=
462
+ $html .= '<div class="general-inner-tab">';
463
+ //=start inner nav=
464
+ $html .= '<ul class="inner-nav">';
465
+
466
+ $html .='<li class="gen-basic active">';
467
+ $html .='<span data-href="#gen-basic">';
468
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/basic-settings-regular.png'.'" alt="icon" class="regular" />';
469
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/basic-settings-hover.png'.'" alt="icon" class="hover" />';
470
+ $html .=''.__('Basic Settings ', 'wpvr').'</span>';
471
+ $html .='</li>';
472
+
473
+ $html .='<li class="gen-advanced">';
474
+ $html .='<span data-href="#gen-advanced">';
475
+ $html .='<span class="pro-tag">pro</span>';
476
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/advance-control-regular.png'.'" alt="icon" class="regular" />';
477
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/advance-control-hover.png'.'" alt="icon" class="hover" />';
478
+ $html .=''.__('Advanced Controls ', 'wpvr').'</span>';
479
+ $html .='</li>';
480
+
481
+ $html .='<li class="gen-control">';
482
+ $html .='<span data-href="#gen-control">';
483
+ $html .='<span class="pro-tag">pro</span>';
484
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/control-buttons-regular.png'.'" alt="icon" class="regular" />';
485
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/control-buttons-hover.png'.'" alt="icon" class="hover" />';
486
+ $html .=''.__('Control Buttons ', 'wpvr').'</span>';
487
+ $html .='</li>';
488
+
489
+ $html .='<li class="vr-documentation">';
490
+ $html .='<a href="https://rextheme.com/docs-category/wp-vr/" target="_blank">'.__('Documentation ', 'wpvr').'</a>';
491
+ $html .='</li>';
492
+
493
+ $html .= '</ul>';
494
+ //=end inner nav=
495
+
496
+ $html .= '<div class="inner-nav-content">';
497
+ $html .= '<div class="basic-settings-content inner-single-content active" id="gen-basic">';
498
+ $html .= '<div class="content-wrapper">';
499
+ $html .= '<div class="left">';
500
+ //===preview image===//
501
+ if (!empty($preview)) {
502
+ $html .= '<div class="single-settings preview-setting">';
503
+ $html .= '<span>'.__('Set a Tour Preview Image : ', 'wpvr').'</span>';
504
+ $html .= '<div class="form-group">';
505
+ $html .= '<input type="text" name="preview-attachment-url" class="preview-attachment-url" value="'.$preview.'">';
506
+ $html .= '<input type="button" class="preview-upload" id="vr-preview-img" data-info="" value="Upload"/>';
507
+ $html .= '<div class="img-upload-frame img-uploaded" style="background-image: url('.$preview.')">';
508
+ $html .= '<span class="remove-attachment">x</span>';
509
+ $html .= '<label for="vr-preview-img">';
510
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/uplad-icon.png'.'" alt="preview img" />';
511
+ $html .= '<span>'.__('Click to Upload an Image ', 'wpvr').'</span>';
512
+ $html .= '</label>';
513
+ $html .= '</div>';
514
+
515
+ $html .= '</div>';
516
+ $html .= '<span class="hints">'.__('This option will not work if the "Tour Autoload" is turned on.', 'wpvr').'</span>';
517
+ $html .= '</div>';
518
+ } else {
519
+ $html .= '<div class="single-settings preview-setting">';
520
+ $html .= '<span>'.__('Set a Tour Preview Image : ', 'wpvr').'</span>';
521
+ $html .= '<div class="form-group">';
522
+ $html .= '<input type="text" name="preview-attachment-url" class="preview-attachment-url" value="">';
523
+ $html .= '<input type="button" class="preview-upload" id="vr-preview-img" data-info="" value="Upload"/>';
524
+ $html .= '<div class="img-upload-frame">';
525
+ $html .= '<span class="remove-attachment">x</span>';
526
+ $html .= '<label for="vr-preview-img">';
527
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/uplad-icon.png'.'" alt="icon" />';
528
+ $html .= '<span>'.__('Click to Upload an Image ', 'wpvr').'</span>';
529
+ $html .= '</label>';
530
+ $html .= '</div>';
531
+ $html .= '</div>';
532
+ $html .= '</div>';
533
+ }
534
+ //===preview image end===//
535
+
536
+ //=Autoload setup=//
537
+ if ($autoload == true) {
538
+ $html .= '<div class="single-settings autoload">';
539
+ $html .= '<span>'.__('Tour Autoload: ', 'wpvr').'</span>';
540
+
541
+ $html .= '<span class="wpvr-switcher">';
542
+ $html .= '<input id="wpvr_autoload" class="vr-switcher-check" name="autoload" type="checkbox" value="on" checked />';
543
+ $html .= '<label for="wpvr_autoload"></label>';
544
+ $html .= '</span>';
545
+
546
+ $html .= '<div class="field-tooltip">';
547
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
548
+ $html .= '<span>'.__('Tour Preview Image will not appear if this is turned on.', 'wpvr').'</span>';
549
+ $html .= '</div>';
550
+ $html .= '</div>';
551
+ } else {
552
+ $html .= '<div class="single-settings autoload">';
553
+ $html .= '<span>'.__('Tour Autoload: ', 'wpvr').' </span>';
554
+
555
+ $html .= '<span class="wpvr-switcher">';
556
+ $html .= '<input id="wpvr_autoload" class="vr-switcher-check" name="autoload" type="checkbox" value="off" />';
557
+ $html .= '<label for="wpvr_autoload"></label>';
558
+ $html .= '</span>';
559
+
560
+ $html .= '<div class="field-tooltip">';
561
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
562
+ $html .= '<span>'.__('Tour Preview Image will not appear if this is turned on.', 'wpvr').'</span>';
563
+ $html .= '</div>';
564
+ $html .= '</div>';
565
+ }
566
+ //=Autoload setup End=//
567
+
568
+ //=Control Setup=
569
+ if ($control == false) {
570
+ $html .= '<div class="single-settings controls">';
571
+ $html .= '<span>'.__('Basic Control Buttons: ', 'wpvr').'</span>';
572
+
573
+ $html .= '<span class="wpvr-switcher">';
574
+ $html .= '<input id="wpvr_controls" class="vr-switcher-check" value="off" name="controls" type="checkbox" />';
575
+ $html .= '<label for="wpvr_controls"></label>';
576
+ $html .= '</span>';
577
+
578
+ $html .= '<div class="field-tooltip">';
579
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
580
+ $html .= '<span>'.__('This option will display Zoom In, Zoom Out and Full Screen buttons on the tour.', 'wpvr').'</span>';
581
+ $html .= '</div>';
582
+ $html .= '</div>';
583
+ } else {
584
+ $html .= '<div class="single-settings controls">';
585
+ $html .= '<span>'.__('Basic Control Buttons: ', 'wpvr').'</span>';
586
+
587
+ $html .= '<span class="wpvr-switcher">';
588
+ $html .= '<input id="wpvr_controls" class="vr-switcher-check" value="on" name="controls" type="checkbox" checked />';
589
+ $html .= '<label for="wpvr_controls"></label>';
590
+ $html .= '</span>';
591
+
592
+ $html .= '<div class="field-tooltip">';
593
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
594
+ $html .= '<span>'.__('This option will display Zoom In, Zoom Out and Full Screen buttons on the tour.', 'wpvr').'</span>';
595
+ $html .= '</div>';
596
+ $html .= '</div>';
597
+ }
598
+ //=Control setup End=//
599
 
600
+ $html .= '</div>';
601
+ //===end left===//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
 
603
+ $html .= '<div class="right">';
604
+ //=scene fade duration=//
605
+ $html .= '<div class="single-settings scene-fade-duration">';
606
+ $html .= '<span>'.__('Scene Fade Duration: ', 'wpvr').'</span>';
607
+ $html .= '<input type="number" name="scene-fade-duration" value="'.$scene_fade_duration.'" />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
608
 
609
+ $html .= '<div class="field-tooltip">';
610
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
611
+ $html .= '<span>'.__('This will set the scene fade effect and execution time.', 'wpvr').'</span>';
612
+ $html .= '</div>';
613
+ $html .= '</div>';
614
+ //=scene fade duration End=//
615
+
616
+ //===Autorotation on off set==//
617
+ if (isset($postdata["autoRotate"])) {
618
+ $html .= '<div class="single-settings autoload">';
619
+ $html .= '<span>'.__('Auto Rotation: ', 'wpvr').' </span>';
620
+
621
+ $html .= '<span class="wpvr-switcher">';
622
+ $html .= '<input id="wpvr_autorotation" class="vr-switcher-check" value="on" name="autorotation" type="checkbox" checked />';
623
+ $html .= '<label for="wpvr_autorotation"></label>';
624
+ $html .= '</span>';
625
+ $html .= '</div>';
626
+ } else {
627
+ $html .= '<div class="single-settings autoload">';
628
+ $html .= '<span>'.__('Auto Rotation: ', 'wpvr').' </span>';
629
+
630
+ $html .= '<span class="wpvr-switcher">';
631
+ $html .= '<input id="wpvr_autorotation" class="vr-switcher-check" value="off" name="autorotation" type="checkbox" />';
632
+ $html .= '<label for="wpvr_autorotation"></label>';
633
+ $html .= '</span>';
634
+ $html .= '</div>';
635
+ }
636
+ //===end Autorotation on off set==//
637
 
638
+ //=Auto Rotation=//
639
+ $html .= '<div class="autorotationdata-wrapper">';
640
+ $html .= '<div class="single-settings autorotationdata" >';
641
+ $html .= '<span>'.__('Rotation Speed and Direction: ', 'wpvr').'</span>';
642
+ $html .= '<input type="number" name="auto-rotation" value="'.$autorotation.'" placeholder="-5" />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
 
644
+ $html .= '<div class="field-tooltip">';
645
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
646
+ $html .= '<span>'.__('Set a value to determine the speed of rotation. The higher the number, the faster it will rotate. Positive values will make it rotate clockwise and negative values will make it rotate anti clockwise', 'wpvr').'</span>';
647
+ $html .= '</div>';
648
+ $html .= '</div>';
649
+ //=Auto Rotation=//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
650
 
651
+ //=Auto rotation inactive delay=//
652
+ $html .= '<div class="single-settings autorotationdata" >';
653
+ $html .= '<span>'.__('Resume Auto-rotation after: ', 'wpvr').'</span>';
654
+ $html .= '<input type="number" name="auto-rotation-inactive-delay" value="'.$autorotationinactivedelay.'" placeholder="2000" />';
655
 
656
+ $html .= '<div class="field-tooltip">';
657
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
658
+ $html .= '<span>'.__('When someone clicks on the tour, auto-rotation stops. Here, set a time after which auto rotation will start again. Assign in milliseconds, where 1000 milliseconds = 1 second.', 'wpvr').'</span>';
659
+ $html .= '</div>';
660
+ $html .= '</div>';
661
+ //=Auto rotation inactive delay=//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
 
663
+ //=Auto rotation stop delay=//
664
+ $html .= '<div class="single-settings autorotationdata" >';
665
+ $html .= '<span>'.__('Stop Auto-rotation after: ', 'wpvr').'</span>';
666
+ $html .= '<input type="number" name="auto-rotation-stop-delay" value="'.$autorotationstopdelay.'" placeholder="2000" />';
667
 
668
+ $html .= '<div class="field-tooltip">';
669
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
670
+ $html .= '<span>'.__('Set a time after which auto rotation will stop. Assign in milliseconds, where 1000 milliseconds = 1 second.', 'wpvr').'</span>';
671
+ $html .= '</div>';
672
+ $html .= '</div>';
673
+ $html .= '</div>';
674
+ //=Auto rotation stop delay=//
675
 
676
+ $html .= '</div>';
677
+ //===end right===//
 
678
 
679
+ $html .= '</div>';
680
+ $html .= '</div>';
681
+ //===end basic settings===//
 
682
 
683
+ $html .= '<div class="advanced-settings-content inner-single-content" id="gen-advanced">';
684
+ $html .= '<div class="content-wrapper">';
685
+ $html .= '<div class="left">';
686
 
687
+ //=Keyboard Movement Control=//
688
+ $html .= '<div class="single-settings compass">';
689
+ $html .= '<span>'.__('Keyboard Movement Control: ', 'wpvr').'</span>';
690
 
691
+ $html .= '<span class="wpvr-switcher">';
692
+ $html .= '<input id="wpvr_diskeyboard" class="vr-switcher-check" value="off" name="diskeyboard" type="checkbox" disabled />';
693
+ $html .= '<label for="wpvr_diskeyboard" title="Pro Feature"></label>';
694
+ $html .= '</span>';
695
+ $html .= '</div>';
696
+ //=Keyboard Movement Control end=//
697
 
698
+ //=Keyboard Zoom Control Setup=//
699
+ $html .= '<div class="single-settings">';
700
+ $html .= '<span>'.__('Keyboard Zoom Control: ', 'wpvr').'</span>';
 
701
 
702
+ $html .= '<span class="wpvr-switcher">';
703
+ $html .= '<input id="wpvr_keyboardzoom" class="vr-switcher-check" value="off" name="keyboardzoom" type="checkbox" disabled />';
704
+ $html .= '<label for="wpvr_keyboardzoom" title="Pro Feature"></label>';
705
+ $html .= '</span>';
706
+ $html .= '</div>';
707
+ //=Keyboard Zoom Control End=//
708
 
709
+ //=Mouse Drag Control=//
710
+ $html .= '<div class="single-settings">';
711
+ $html .= '<span>'.__('Mouse Drag Control: ', 'wpvr').'</span>';
712
 
713
+ $html .= '<span class="wpvr-switcher">';
714
+ $html .= '<input id="wpvr_draggable" class="vr-switcher-check" name="draggable" type="checkbox" value="off" disabled />';
715
+ $html .= '<label for="wpvr_draggable" title="Pro Feature"></label>';
716
+ $html .= '</span>';
717
+ $html .= '</div>';
718
+ //=Mouse Drag Control End=//
719
 
720
+ //=Mouse Zoom Control=//
721
+ $html .= '<div class="single-settings">';
722
+ $html .= '<span>'.__('Mouse Zoom Control: ', 'wpvr').'</span>';
 
723
 
724
+ $html .= '<span class="wpvr-switcher">';
725
+ $html .= '<input id="wpvr_mouseZoom" class="vr-switcher-check" value="off" name="mouseZoom" type="checkbox" disabled />';
726
+ $html .= '<label for="wpvr_mouseZoom" title="Pro Feature"></label>';
727
+ $html .= '</span>';
728
+ $html .= '</div>';
729
+ //=Mouse Zoom Control End=//
730
 
731
+ //=Gyroscope Control=//
732
+ $html .= '<div class="single-settings gyro">';
733
+ $html .= '<span>'.__('Gyroscope Control: ', 'wpvr').'</span>';
734
 
735
+ $html .= '<span class="wpvr-switcher">';
736
+ $html .= '<input id="wpvr_gyro" class="vr-switcher-check" value="off" name="gyro" type="checkbox" disabled />';
737
+ $html .= '<label for="wpvr_gyro" title="Pro Feature"></label>';
738
+ $html .= '</span>';
739
+ $html .= '</div>';
740
+ //=Gyroscope Control End=//
741
 
742
+ //=Auto Gyroscope Support=//
743
+ $html .= '<div class="single-settings orientation">';
744
+ $html .= '<span>'.__('Auto Gyroscope Support: ', 'wpvr').'</span>';
 
745
 
746
+ $html .= '<span class="wpvr-switcher">';
747
+ $html .= '<input id="wpvr_deviceorientationcontrol" class="vr-switcher-check" value="off" name="deviceorientationcontrol" type="checkbox" disabled />';
748
+ $html .= '<label for="wpvr_deviceorientationcontrol" title="Pro Feature"></label>';
749
+ $html .= '</span>';
750
 
751
+ $html .= '<div class="field-tooltip">';
752
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
753
+ $html .= '<span>'.__('If set to true, device orientation control will be used when the panorama is loaded, if the device supports it. If false, device orientation control needs to be activated by pressing a button. Defaults to false. Will work if gyroscope is enabled', 'wpvr').'</span>';
754
+ $html .= '</div>';
755
+ $html .= '</div>';
756
+ //=Auto Gyroscope Support End=//
757
 
758
+ //=Compass Setup=//
759
+ $html .= '<div class="single-settings compass">';
760
+ $html .= '<span>'.__('Compass: ', 'wpvr').'</span>';
761
 
762
+ $html .= '<span class="wpvr-switcher">';
763
+ $html .= '<input id="wpvr_compass" class="vr-switcher-check" value="off" name="compass" type="checkbox" disabled />';
764
+ $html .= '<label for="wpvr_compass" title="Pro Feature"></label>';
765
+ $html .= '</span>';
766
+ $html .= '</div>';
767
+ //=Compass setup End=//
768
 
769
+ $html .= '</div>';
770
+ //===end left===//
771
 
772
+ $html .= '<div class="right">';
773
+ //= Scene Gallery=//
774
+ $html .= '<div class="single-settings gallery">';
775
+ $html .= '<span>'.__('Scene Gallery: ', 'wpvr').'</span>';
776
 
777
+ $html .= '<span class="wpvr-switcher">';
778
+ $html .= '<input id="wpvr_vrgallery" class="vr-switcher-check" value="off" name="vrgallery" type="checkbox" disabled />';
779
+ $html .= '<label for="wpvr_vrgallery" title="Pro Feature"></label>';
780
+ $html .= '</span>';
781
 
782
+ $html .= '<div class="field-tooltip">';
783
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
784
+ $html .= '<span>'.__('Turning it On will display a gallery with all the scenes on your tour. By double clicking on a scene thumbnail on the gallery, you can move to that specific scene. The gallery will only show up on the front end and not on the preview.', 'wpvr').'</span>';
785
+ $html .= '</div>';
786
+ $html .= '</div>';
787
+ //= Scene Gallery end=//
788
 
789
+ //=Scene Titles on Gallery=//
790
+ $html .= '<div class="single-settings">';
791
+ $html .= '<span>'.__('Scene Titles on Gallery: ', 'wpvr').'</span>';
 
792
 
793
+ $html .= '<span class="wpvr-switcher">';
794
+ $html .= '<input id="wpvr_vrgallery_title" class="vr-switcher-check" value="off" name="vrgallery_title" type="checkbox" disabled />';
795
+ $html .= '<label for="wpvr_vrgallery_title" title="Pro Feature"></label>';
796
+ $html .= '</span>';
797
 
798
+ $html .= '<div class="field-tooltip">';
799
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/question.png'.'" alt="icon" />';
800
+ $html .= '<span>'.__('Turning it on will display scene titles on each scene thumbnail inside the Scene Gallery. The Scene IDs will be used as the Scene Title.', 'wpvr').'</span>';
801
+ $html .= '</div>';
802
+ $html .= '</div>';
803
+ //=Scene Titles on Gallery End=//
804
 
805
+ //===VR Audio setup===//
806
+ $html .= '<div class="single-settings">';
807
+ $html .= '<span>Tour Background Music: </span>';
808
 
809
+ $html .= '<span class="wpvr-switcher">';
810
+ $html .= '<input id="wpvr_bg_music" class="vr-switcher-check" value="off" name="bg_music" type="checkbox" disabled />';
811
+ $html .= '<label for="wpvr_bg_music" title="Pro Feature"></label>';
812
+ $html .= '</span>';
813
+ $html .= '</div>';
814
+ //==VR audio End==//
815
 
816
+ //===Company logo===//
817
+ $html .= '<div class="single-settings company-info">';
818
+ $html .= '<span>'.__('Add Company Information: ', 'wpvr').' </span>';
819
+
820
+ $html .= '<span class="wpvr-switcher">';
821
+ $html .= '<input id="wpvr_cpLogoSwitch" class="vr-switcher-check" value="off" name="cpLogoSwitch" type="checkbox" disabled />';
822
+ $html .= '<label for="wpvr_cpLogoSwitch" title="Pro Feature"></label>';
823
+ $html .= '</span>';
824
+ $html .= '</div>';
825
+ //===Company logo end===//
826
+
827
+ $html .= '</div>';
828
+ //===end right===//
829
+
830
+ $html .= '</div>';
831
+ $html .= '</div>';
832
+ //===end advanced settings===//
833
+
834
+ $html .= '<div class="control-settings-content inner-single-content" id="gen-control">';
835
+ $html .= '<div class="content-wrapper">';
836
+ $html .= '<div class="left">';
837
+ //=====Move up====//
838
+ $html .= '<div class="single-settings controls custom-data-set">';
839
+ $html .= '<span>'.__('Move Up: ', 'wpvr').'</span>';
840
+
841
+ $html .= '<div class="color-icon">';
842
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-up.jpg'.'" alt="icon" />';
843
+ $html .= '</div>';
844
+
845
+ $html .= '<span class="wpvr-switcher">';
846
+ $html .= '<input id="wpvr_panupControl" class="vr-switcher-check" value="off" name="panupControl" type="checkbox" disabled />';
847
+ $html .= '<label for="wpvr_panupControl" title="Pro Feature"></label>';
848
+ $html .= '</span>';
849
+
850
+ $html .= '</div>';
851
+ //=====Moveup End====//
852
+
853
+ //=====Move Down====//
854
+ $html .= '<div class="single-settings controls custom-data-set">';
855
+ $html .= '<span>'.__('Move Down: ', 'wpvr').'</span>';
856
+
857
+ $html .= '<div class="color-icon">';
858
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-down.jpg'.'" alt="icon" />';
859
+ $html .= '</div>';
860
+
861
+ $html .= '<span class="wpvr-switcher">';
862
+ $html .= '<input id="wpvr_panDownControl" class="vr-switcher-check" value="off" name="panDownControl" type="checkbox" disabled />';
863
+ $html .= '<label for="wpvr_panDownControl" title="Pro Feature"></label>';
864
+ $html .= '</span>';
865
+ $html .= '</div>';
866
+ //=====Move down End====//
867
+
868
+ //=====Move Left====//
869
+ $html .= '<div class="single-settings controls custom-data-set">';
870
+ $html .= '<span>'.__('Move Left: ', 'wpvr').'</span>';
871
+
872
+ $html .= '<div class="color-icon">';
873
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-left.jpg'.'" alt="icon" />';
874
+ $html .= '</div>';
875
+
876
+ $html .= '<span class="wpvr-switcher">';
877
+ $html .= '<input id="wpvr_panLeftControl" class="vr-switcher-check" value="off" name="panLeftControl" type="checkbox" disabled />';
878
+ $html .= '<label for="wpvr_panLeftControl" title="Pro Feature"></label>';
879
+ $html .= '</span>';
880
+ $html .= '</div>';
881
+ //=====Move Left End====//
882
+
883
+ //=====Move Right====//
884
+ $html .= '<div class="single-settings controls custom-data-set">';
885
+ $html .= '<span>'.__('Move Right: ', 'wpvr').'</span>';
886
+
887
+ $html .= '<div class="color-icon">';
888
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/move-right.jpg'.'" alt="icon" />';
889
+ $html .= '</div>';
890
+
891
+ $html .= '<span class="wpvr-switcher">';
892
+ $html .= '<input id="wpvr_panRightControl" class="vr-switcher-check" value="off" name="panRightControl" type="checkbox" disabled />';
893
+ $html .= '<label for="wpvr_panRightControl" title="Pro Feature"></label>';
894
+ $html .= '</span>';
895
+ $html .= '</div>';
896
+ //=====Move Right End====//
897
+
898
+ //=====Zoom In====//
899
+ $html .= '<div class="single-settings controls custom-data-set">';
900
+ $html .= '<span>'.__('Zoom In: ', 'wpvr').'</span>';
901
+
902
+ $html .= '<div class="color-icon">';
903
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/zoom-in.jpg'.'" alt="icon" />';
904
+ $html .= '</div>';
905
+
906
+ $html .= '<span class="wpvr-switcher">';
907
+ $html .= '<input id="wpvr_panZoomInControl" class="vr-switcher-check" value="off" name="panZoomInControl" type="checkbox" disabled />';
908
+ $html .= '<label for="wpvr_panZoomInControl" title="Pro Feature"></label>';
909
+ $html .= '</span>';
910
+
911
+ $html .= '</div>';
912
+ //=====Zoom In End====//
913
+
914
+ $html .= '</div>';
915
+ //===end left===//
916
+
917
+ $html .= '<div class="right">';
918
+ //=====Zoom Out====//
919
+ $html .= '<div class="single-settings controls custom-data-set">';
920
+ $html .= '<span>'.__('Zoom Out: ', 'wpvr').'</span>';
921
+
922
+ $html .= '<div class="color-icon">';
923
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/zoom-out.jpg'.'" alt="icon" />';
924
+ $html .= '</div>';
925
+
926
+ $html .= '<span class="wpvr-switcher">';
927
+ $html .= '<input id="wpvr_panZoomOutControl" class="vr-switcher-check" value="off" name="panZoomOutControl" type="checkbox" disabled />';
928
+ $html .= '<label for="wpvr_panZoomOutControl" title="Pro Feature"></label>';
929
+ $html .= '</span>';
930
+
931
+ $html .= '</div>';
932
+ //=====Zoom Out End====//
933
+
934
+ //===== Full Screen====//
935
+ $html .= '<div class="single-settings controls custom-data-set">';
936
+ $html .= '<span>'.__('Full Screen: ', 'wpvr').'</span>';
937
+
938
+ $html .= '<div class="color-icon">';
939
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/full-screen.jpg'.'" alt="icon" />';
940
+ $html .= '</div>';
941
 
942
+ $html .= '<span class="wpvr-switcher">';
943
+ $html .= '<input id="wpvr_panFullscreenControl" class="vr-switcher-check" value="off" name="panFullscreenControl" type="checkbox" disabled />';
944
+ $html .= '<label for="wpvr_panFullscreenControl" title="Pro Feature"></label>';
945
+ $html .= '</span>';
946
 
947
+ $html .= '</div>';
948
+ //=====Full Screen End====//
949
+
950
+ //=====Gyroscope====//
951
+ $html .= '<div class="single-settings controls custom-data-set">';
952
+ $html .= '<span>'.__('Gyroscope: ', 'wpvr').'</span>';
953
+
954
+ $html .= '<div class="color-icon">';
955
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/gryscop.jpg'.'" alt="icon" />';
956
+ $html .= '</div>';
957
+
958
+ $html .= '<span class="wpvr-switcher">';
959
+ $html .= '<input id="wpvr_gyroscope" class="vr-switcher-check" value="off" name="gyroscope" type="checkbox" disabled />';
960
+ $html .= '<label for="wpvr_gyroscope" title="Pro Feature"></label>';
961
+ $html .= '</span>';
962
+
963
+ $html .= '</div>';
964
+ //=====Gyroscope End====//
965
+
966
+ //=====Back to home====//
967
+ $html .= '<div class="single-settings controls custom-data-set">';
968
+ $html .= '<span>'.__('Home: ', 'wpvr').'</span>';
969
+
970
+ $html .= '<div class="color-icon">';
971
+ $html .='<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/home.jpg'.'" alt="icon" />';
972
+ $html .= '</div>';
973
+
974
+ $html .= '<span class="wpvr-switcher">';
975
+ $html .= '<input id="wpvr_backToHome" class="vr-switcher-check" value="off" name="backToHome" type="checkbox" disabled />';
976
+ $html .= '<label for="wpvr_backToHome" title="Pro Feature"></label>';
977
+ $html .= '</span>';
978
+
979
+ $html .= '</div>';
980
+ //=====Back to home End====//
981
+ $html .= '</div>';
982
+ //===end right===//
983
+
984
+ $html .= '</div>';
985
+ $html .= '</div>';
986
+ //===end control settings===//
987
+
988
+ $html .= '</div>';
989
+ //=end inner tab content=
990
+
991
+ $html .= '<div class="wpvr-use-shortcode">';
992
+ $post = get_post();
993
+ $id = $post->ID;
994
+ $slug = $post->post_name;
995
+ $postdata = get_post_meta($post->ID, 'panodata', true);
996
+
997
+ $html .= '<h4 class="area-title">'.__('Using this Tour', 'wpvr').'</h4>';
998
+
999
+ $html .= '<div class="shortcode-wrapper">';
1000
+ $html .= '<div class="single-shortcode classic">';
1001
+ $html .= '<span class="shortcode-title">'.__('For Classic Editor:', 'wpvr').'</span>';
1002
+
1003
+ $html .= '<div class="field-wapper">';
1004
+ $html .= '<span>'.__('To use this WP VR tour in your posts or pages use the following shortcode ', 'wpvr').'</span>';
1005
+
1006
+ $html .= '<div class="shortcode-field">';
1007
+ $html .= '<p class="copycode" id="copy-shortcode">[wpvr id="'.$id.'"]</p>';
1008
+
1009
+ $html .= '<span id="wpvr-copy-shortcode" class="wpvr-copy-shortcode">';
1010
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/copy.png'.'" alt="icon" />';
1011
+ $html .= '</span>';
1012
+ $html .= '</div>';
1013
+
1014
+
1015
+ $html .= '<span id="wpvr-copied-notice" class="wpvr-copied-notice"></span>';
1016
+
1017
+ $html .= '</div>';
1018
+ $html .= '</div>';
1019
+
1020
+ $html .= '</div>';
1021
+ $html .= '</div>';
1022
+ //=end shortcode area=
1023
+
1024
+ $html .= '</div>';
1025
+ //=end inner tab=
1026
+
1027
+
1028
+ $html .= '<script>';
1029
+ $html .= '
1030
 
1031
  document.getElementById("wpvr-copy-shortcode").addEventListener("click", function() {
1032
  copyToClipboard(document.getElementById("copy-shortcode"));
1090
 
1091
  ';
1092
 
1093
+ $html .= '</script>';
1094
+
1095
+ $html .='</div>';
1096
+ //---end general tab----
1097
+
1098
+ $html .='<div class="rex-pano-tab" id="scenes">';
1099
+
1100
+ //=Scene and Hotspot repeater=//
1101
+ if (empty($pano_data)) {
1102
+ $html .= '<div class="scene-setup rex-pano-sub-tabs" data-limit="'.$scene_limit.'">';
1103
+
1104
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu scene-nav">';
1105
+ $html .= '<ul>';
1106
+ $html .= '<li class="active"><span data-index="1" data-href="#scene-1"><i class="fa fa-image"></i></span></li>';
1107
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1108
+ $html .= '</ul>';
1109
+ $html .= '</nav>';
1110
+
1111
+ $html .= '<div data-repeater-list="scene-list" class="rex-pano-tab-content">';
1112
+
1113
+ $html .= '<div data-repeater-item class="single-scene rex-pano-tab" data-title="0" id="scene-0">';
1114
+
1115
+ $html .= '<div class="scene-content">';
1116
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1117
+
1118
+ $html .= '<div class="scene-left">';
1119
+ //==Set Default Scene==//
1120
+ $html .= '<div class="single-settings dscene">';
1121
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1122
+ $html .= '<select class="dscen" name="dscene">';
1123
+ $html .= '<option value="on"> Yes</option>';
1124
+ $html .= '<option value="off" selected > No</option>';
1125
+ $html .= '</select>';
1126
+ $html .= '</div>';
1127
+ //==Set Default Scene end==//
1128
+
1129
+ $html .= '<div class=scene-setting>';
1130
+ $html .= '<label for="scene-id">'.__('Scene ID : ', 'wpvr').'</label>';
1131
+ $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1132
+ $html .= '</div>';
1133
+
1134
+ $html .= '<div class=scene-setting>';
1135
+ $html .= '<label for="scene-type">'.__('Scene Type : ', 'wpvr').'</label>';
1136
+ $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1137
+ $html .= '</div>';
1138
+
1139
+ $html .= '<div class=scene-setting>';
1140
+ $html .= '<label for="scene-upload">'.__('Scene Upload: ', 'wpvr').'</label>';
1141
+ $html .= '<div class="form-group">';
1142
+ $html .= '<img src="" style="display: none;"><br>';
1143
+ $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1144
+ $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="">';
1145
+ $html .= '</div>';
1146
+ $html .= '</div>';
1147
+ $html .= '</div>';
1148
+ //---end scene-left---
1149
+
1150
+ $html .= '</div>';
1151
+
1152
+ //--hotspot setup--
1153
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1154
+
1155
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1156
+ $html .= '<ul>';
1157
+ $html .= '<li class="active"><span data-index="1" data-href="#scene-0-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1158
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1159
+ $html .= '</ul>';
1160
+ $html .= '</nav>';
1161
+
1162
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1163
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-0-hotspot-1">';
1164
+
1165
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1166
+
1167
+ $html .= '<div class="wrapper">';
1168
+ $html .= '<div class="hotspot-setting">';
1169
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
1170
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1171
+ $html .= '</div>';
1172
+
1173
+ $html .= '<div class="hotspot-setting">';
1174
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
1175
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1176
+ $html .= '</div>';
1177
+
1178
+ $html .= '<div class="hotspot-setting">';
1179
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
1180
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1181
+ $html .= '</div>';
1182
+
1183
+ $html .= '<div class="hotspot-setting">';
1184
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
1185
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1186
+ $html .= '</div>';
1187
+
1188
+ $html .= '</div>';
1189
+
1190
+ $html .= '<div class="hotspot-type hotspot-setting">';
1191
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1192
+ $html .= '<select name="hotspot-type">';
1193
+ $html .= '<option value="info" selected> Info</option>';
1194
+ $html .= '<option value="scene"> Scene</option>';
1195
+ $html .= '</select>';
1196
+
1197
+ $html .= '<div class="hotspot-url">';
1198
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
1199
+ $html .= '<input type="url" name="hotspot-url" value="" />';
1200
+ $html .= '</div>';
1201
+
1202
+ $html .= '<div class="hotspot-content">';
1203
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1204
+ $html .= '<textarea name="hotspot-content"></textarea>';
1205
+ $html .= '</div>';
1206
+
1207
+ $html .= '<div class="hotspot-hover">';
1208
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
1209
+ $html .= '<textarea name="hotspot-hover"></textarea>';
1210
+ $html .= '</div>';
1211
+
1212
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1213
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1214
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1215
+ $html .= '<option value="none" selected> None</option>';
1216
+ $html .= '</select>';
1217
+ $html .= '</div>';
1218
+
1219
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1220
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').' </label>';
1221
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1222
+ $html .= '</div>';
1223
+
1224
+ $html .= '</div>';
1225
+ //=Hotspot type End=//
1226
+ $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1227
+ $html .= '</div>';
1228
+ $html .= '</div>';
1229
+
1230
+ $html .= '</div>';
1231
+ $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1232
+ $html .= '</div>';
1233
+
1234
+
1235
+ $html .= '<div data-repeater-item class="single-scene rex-pano-tab active" data-title="1" id="scene-1">';
1236
+
1237
+ $html .= '<div class="scene-content">';
1238
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1239
+
1240
+ $html .= '<div class="scene-left">';
1241
+ //==Set Default Scene==//
1242
+ $html .= '<div class="single-settings dscene">';
1243
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1244
+ $html .= '<select class="dscen" name="dscene">';
1245
+ $html .= '<option value="on"> Yes</option>';
1246
+ $html .= '<option value="off" selected > No</option>';
1247
+ $html .= '</select>';
1248
+ $html .= '</div>';
1249
+ //==Set Default Scene end==//
1250
+
1251
+ $html .= '<div class=scene-setting>';
1252
+ $html .= '<label for="scene-id">'.__('Scene ID : ', 'wpvr').'</label>';
1253
+ $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1254
+ $html .= '</div>';
1255
+
1256
+ $html .= '<div class=scene-setting>';
1257
+ $html .= '<label for="scene-type">'.__('Scene Type : ', 'wpvr').'</label>';
1258
+ $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1259
+ $html .= '</div>';
1260
+
1261
+ $html .= '<div class=scene-setting>';
1262
+ $html .= '<label for="scene-upload">'.__('Scene Upload: ', 'wpvr').'</label>';
1263
+ $html .= '<div class="form-group">';
1264
+ $html .= '<img src="" style="display: none;"><br>';
1265
+ $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1266
+ $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="">';
1267
+ $html .= '</div>';
1268
+ $html .= '</div>';
1269
+ $html .= '</div>';
1270
+ //----end scene left------
1271
+
1272
+ $html .= '</div>';
1273
+
1274
+ //--hotspot setup--//
1275
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1276
+
1277
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1278
+ $html .= '<ul>';
1279
+ $html .= '<li class="active"><span data-index="1" data-href="#scene-1-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1280
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1281
+ $html .= '</ul>';
1282
+ $html .= '</nav>';
1283
+
1284
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1285
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-1-hotspot-1">';
1286
+
1287
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1288
+
1289
+ $html .= '<div class="wrapper">';
1290
+ $html .= '<div class="hotspot-setting">';
1291
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
1292
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1293
+ $html .= '</div>';
1294
+
1295
+ $html .= '<div class="hotspot-setting">';
1296
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
1297
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1298
+ $html .= '</div>';
1299
+
1300
+ $html .= '<div class="hotspot-setting">';
1301
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
1302
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1303
+ $html .= '</div>';
1304
+
1305
+ $html .= '<div class="hotspot-setting">';
1306
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
1307
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1308
+ $html .= '</div>';
1309
+
1310
+ $html .= '</div>';
1311
+
1312
+ $html .= '<div class="hotspot-type hotspot-setting">';
1313
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1314
+ $html .= '<select name="hotspot-type">';
1315
+ $html .= '<option value="info" selected> Info</option>';
1316
+ $html .= '<option value="scene"> Scene</option>';
1317
+ $html .= '</select>';
1318
+
1319
+ $html .= '<div class="hotspot-url">';
1320
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').'</label>';
1321
+ $html .= '<input type="url" name="hotspot-url" value="" />';
1322
+ $html .= '</div>';
1323
+
1324
+ $html .= '<div class="hotspot-content">';
1325
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1326
+ $html .= '<textarea name="hotspot-content"></textarea>';
1327
+ $html .= '</div>';
1328
+
1329
+ $html .= '<div class="hotspot-hover">';
1330
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
1331
+ $html .= '<textarea name="hotspot-hover"></textarea>';
1332
+ $html .= '</div>';
1333
+
1334
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1335
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1336
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1337
+ $html .= '<option value="none"> None</option>';
1338
+ $html .= '</select>';
1339
+ $html .= '</div>';
1340
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1341
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
1342
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1343
+ $html .= '</div>';
1344
+
1345
+ $html .= '</div>';
1346
+ //=Hotspot type End=//
1347
+ $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1348
+ $html .= '</div>';
1349
+ $html .= '</div>';
1350
+ $html .= '</div>';
1351
+ $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1352
+ $html .= '</div>';
1353
+ $html .= '</div>';
1354
+
1355
+ $html .= '</div>';
1356
+ } else {
1357
+ $html .= '<div class="scene-setup rex-pano-sub-tabs" data-limit="'.$scene_limit.'">';
1358
+
1359
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu scene-nav">';
1360
+ $html .= '<ul>';
1361
+ $i = 1;
1362
+ $firstvalue = reset($pano_data["scene-list"]);
1363
+ foreach ($pano_data["scene-list"] as $pano_scenes) {
1364
+ if ($pano_scenes['scene-id'] == $firstvalue['scene-id']) {
1365
+ $html .= '<li class="active"><span data-index="'.$i.'" data-href="#scene-'.$i.'"><i class="fa fa-image"></i></span></li>';
1366
+ } else {
1367
+ $html .= '<li><span data-index="'.$i.'" data-href="#scene-'.$i.'"><i class="fa fa-image"></i></span></li>';
1368
+ }
1369
+ $i++;
1370
+ }
1371
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1372
+ $html .= '</ul>';
1373
+ $html .= '</nav>';
1374
+
1375
+
1376
+ $html .= '<div data-repeater-list="scene-list" class="rex-pano-tab-content">';
1377
+
1378
+ //===Default empty repeater declared by nazmus sakib===//
1379
+ $html .= '<div data-repeater-item class="single-scene rex-pano-tab" data-title="0" id="scene-0">';
1380
+
1381
+ $html .= '<div class="scene-content">';
1382
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1383
+
1384
+ $html .= '<div class="scene-left">';
1385
+ //==Set Default Scene==//
1386
+ $html .= '<div class="single-settings dscene">';
1387
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1388
+ $html .= '<select class="dscen" name="dscene">';
1389
+ $html .= '<option value="on"> Yes</option>';
1390
+ $html .= '<option value="off" selected > No</option>';
1391
+ $html .= '</select>';
1392
+ $html .= '</div>';
1393
+ //==Set Default Scene end==//
1394
+ $html .= '<div class=scene-setting>';
1395
+ $html .= '<label for="scene-id">'.__('Scene ID : ', 'wpvr').'</label>';
1396
+ $html .= '<input class="sceneid" type="text" name="scene-id"/>';
1397
+ $html .= '</div>';
1398
+
1399
+ $html .= '<div class=scene-setting>';
1400
+ $html .= '<label for="scene-type">'.__('Scene Type : ', 'wpvr').'</label>';
1401
+ $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1402
+ $html .= '</div>';
1403
+
1404
+ $html .= '<div class=scene-setting>';
1405
+ $html .= '<label for="scene-upload">'.__('Scene Upload: ', 'wpvr').'</label>';
1406
+ $html .= '<div class="form-group">';
1407
+ $html .= '<img src="" style="display: none;"><br>';
1408
+ $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1409
+ $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="">';
1410
+ $html .= '</div>';
1411
+ $html .= '</div>';
1412
+ $html .= '</div>';
1413
+ //-----end scene left------
1414
+
1415
+ $html .= '</div>';
1416
+
1417
+ //--hotspot setup--//
1418
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1419
+
1420
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1421
+ $html .= '<ul>';
1422
+ $html .= '<li class="active"><span data-index="1" data-href="#scene-0-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1423
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1424
+ $html .= '</ul>';
1425
+ $html .= '</nav>';
1426
+
1427
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1428
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-0-hotspot-1">';
1429
+
1430
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1431
+
1432
+ $html .= '<div class="wrapper">';
1433
+ $html .= '<div class="hotspot-setting">';
1434
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
1435
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1436
+ $html .= '</div>';
1437
+
1438
+ $html .= '<div class="hotspot-setting">';
1439
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
1440
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1441
+ $html .= '</div>';
1442
+
1443
+ $html .= '<div class="hotspot-setting">';
1444
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
1445
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1446
+ $html .= '</div>';
1447
+
1448
+ $html .= '<div class="hotspot-setting">';
1449
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
1450
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1451
+ $html .= '</div>';
1452
+
1453
+ $html .= '</div>';
1454
+
1455
+ $html .= '<div class="hotspot-type hotspot-setting">';
1456
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1457
+ $html .= '<select name="hotspot-type">';
1458
+ $html .= '<option value="info" selected> Info</option>';
1459
+ $html .= '<option value="scene"> Scene</option>';
1460
+ $html .= '</select>';
1461
+
1462
+ $html .= '<div class="hotspot-url">';
1463
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
1464
+ $html .= '<input type="url" name="hotspot-url" value="" />';
1465
+ $html .= '</div>';
1466
+
1467
+ $html .= '<div class="hotspot-content">';
1468
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1469
+ $html .= '<textarea name="hotspot-content"></textarea>';
1470
+ $html .= '</div>';
1471
+
1472
+ $html .= '<div class="hotspot-hover">';
1473
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
1474
+ $html .= '<textarea name="hotspot-hover"></textarea>';
1475
+ $html .= '</div>';
1476
+
1477
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1478
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1479
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1480
+ $html .= '<option value="none" selected> None</option>';
1481
+ $html .= '</select>';
1482
+ $html .= '</div>';
1483
+
1484
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1485
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').' </label>';
1486
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1487
+ $html .= '</div>';
1488
+
1489
+ $html .= '</div>';
1490
+ //=Hotspot type End=//
1491
+ $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1492
+ $html .= '</div>';
1493
+ $html .= '</div>';
1494
+
1495
+ $html .= '</div>';
1496
+ $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1497
+ $html .= '</div>';
1498
+ //==Empty repeater end==//
1499
+
1500
+ $s = 1;
1501
+ foreach ($pano_data["scene-list"] as $pano_scenes) {
1502
+ $dscene = '';
1503
+ if (isset($pano_scenes['dscene'])) {
1504
+ $dscene = $pano_scenes['dscene'];
1505
+ }
1506
+ $scene_id = '';
1507
+ $scene_id = $pano_scenes["scene-id"];
1508
+ $scene_type = 'equirectangular';
1509
+ $scene_type = $pano_scenes["scene-type"];
1510
+ $scene_photo = '';
1511
+ $scene_photo = $pano_scenes["scene-attachment-url"];
1512
+
1513
+ $pano_hotspots = array();
1514
+ if (isset($pano_scenes["hotspot-list"])) {
1515
+ $pano_hotspots = $pano_scenes["hotspot-list"];
1516
+ }
1517
+
1518
+ $firstvalueset = reset($pano_data["scene-list"]);
1519
+ if ($pano_scenes['scene-id'] == $firstvalueset['scene-id']) {
1520
+ $html .= '<div data-repeater-item class="single-scene rex-pano-tab active" data-title="1" id="scene-'.$s.'">';
1521
+
1522
+ $html .= '<div class="scene-content">';
1523
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1524
+
1525
+ $html .= '<div class="scene-left">';
1526
+ //==Set Default Scene==//
1527
+ if ($dscene == 'on') {
1528
+ $html .= '<div class="single-settings dscene">';
1529
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1530
+ $html .= '<select class="dscen" name="dscene">';
1531
+ $html .= '<option value="on" selected > Yes</option>';
1532
+ $html .= '<option value="off"> No</option>';
1533
+ $html .= '</select>';
1534
+ $html .= '</div>';
1535
+ } else {
1536
+ $html .= '<div class="single-settings dscene">';
1537
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1538
+ $html .= '<select class="dscen" name="dscene">';
1539
+ $html .= '<option value="on"> Yes</option>';
1540
+ $html .= '<option value="off" selected > No</option>';
1541
+ $html .= '</select>';
1542
+ $html .= '</div>';
1543
+ }
1544
+ //==Set Default Scene end==//
1545
+ $html .= '<div class=scene-setting>';
1546
+ $html .= '<label for="scene-id">'.__('Scene ID : ', 'wpvr').'</label>';
1547
+ $html .= '<input class="sceneid" type="text" name="scene-id" value="'.$scene_id.'" />';
1548
+ $html .= '</div>';
1549
+
1550
+ $html .= '<div class=scene-setting>';
1551
+ $html .= '<label for="scene-type">'.__('Scene Type : ', 'wpvr').'</label>';
1552
+ $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1553
+ $html .= '</div>';
1554
+
1555
+ $html .= '<div class=scene-setting>';
1556
+ $html .= '<label for="scene-upload">'.__('Scene Upload: ', 'wpvr').'</label>';
1557
+ $html .= '<div class="form-group">';
1558
+ $html .= '<img name ="scene-photo" src="'.$scene_photo.'"> <br/>';
1559
+ $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1560
+ $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="'.$scene_photo.'">';
1561
+ $html .= '</div>';
1562
+ $html .= '</div>';
1563
+ $html .= '</div>';
1564
+ // ---end scene left---
1565
+
1566
+ $html .= '</div>';
1567
+
1568
+ if (!empty($pano_hotspots)) {
1569
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1570
+
1571
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1572
+ $html .= '<ul>';
1573
+ $j = 1;
1574
+ $firstvaluehotspot = reset($pano_hotspots);
1575
+ foreach ($pano_hotspots as $pano_hotspot) {
1576
+ if ($pano_hotspot['hotspot-title'] == $firstvaluehotspot['hotspot-title']) {
1577
+ $html .= '<li class="active"><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1578
+ } else {
1579
+ $html .= '<li><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1580
+ }
1581
+ $j++;
1582
+ }
1583
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1584
+ $html .= '</ul>';
1585
+ $html .= '</nav>';
1586
+
1587
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1588
+
1589
+ $h = 1;
1590
+ $firstvaluehotspotset = reset($pano_hotspots);
1591
+ $is_wpvr_premium = apply_filters('is_wpvr_premium', false);
1592
+ foreach ($pano_hotspots as $pano_hotspot) {
1593
+ $hotspot_title = '';
1594
+ $hotspot_title = $pano_hotspot['hotspot-title'];
1595
+ $hotspot_pitch = '';
1596
+ $hotspot_pitch = $pano_hotspot['hotspot-pitch'];
1597
+ $hotspot_yaw = '';
1598
+ $hotspot_yaw = $pano_hotspot['hotspot-yaw'];
1599
+ $hotspot_type = '';
1600
+ $hotspot_type = $pano_hotspot['hotspot-type'];
1601
+ $hotspot_url = '';
1602
+ $hotspot_url = $pano_hotspot['hotspot-url'];
1603
+ $hotspot_content = '';
1604
+ $hotspot_content = $pano_hotspot['hotspot-content'];
1605
+ $hotspot_hover = '';
1606
+ $hotspot_hover = $pano_hotspot['hotspot-hover'];
1607
+ $hotspot_target_scene = '';
1608
+ $hotspot_target_scene = $pano_hotspot['hotspot-scene'];
1609
+ $hotspot_custom_class = '';
1610
+ if (isset($pano_hotspot['hotspot-customclass'])) {
1611
+ $hotspot_custom_class = $pano_hotspot['hotspot-customclass'];
1612
+ }
1613
 
1614
+ if ($pano_hotspot['hotspot-title'] == $firstvaluehotspotset['hotspot-title']) {
1615
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
1616
+
1617
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1618
+
1619
+ $html .= '<div class="wrapper">';
1620
+ $html .= '<div class="hotspot-setting">';
1621
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
1622
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
1623
+ $html .= '</div>';
1624
+
1625
+ $html .= '<div class="hotspot-setting">';
1626
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'
1627
+ </label>';
1628
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
1629
+ $html .= '</div>';
1630
+
1631
+ $html .= '<div class="hotspot-setting">';
1632
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
1633
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
1634
+ $html .= '</div>';
1635
+
1636
+ $html .= '<div class="hotspot-setting">';
1637
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
1638
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
1639
+ $html .= '</div>';
1640
+
1641
+ $html .= '</div>';
1642
+
1643
+ //=Hotspot type=//
1644
+ if ($hotspot_type == "info") {
1645
+ $html .= '<div class="hotspot-type hotspot-setting">';
1646
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1647
+ $html .= '<select name="hotspot-type">';
1648
+ $html .= '<option value="info" selected> Info</option>';
1649
+ $html .= '<option value="scene"> Scene</option>';
1650
+ $html .= '</select>';
1651
+
1652
+ $html .= '<div class="hotspot-url">';
1653
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
1654
+ $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
1655
  $html .= '</div>';
1656
 
1657
+ $html .= '<div class="hotspot-content">';
1658
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1659
+ $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
1660
+ $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1661
 
1662
+ $html .= '<div class="hotspot-hover">';
1663
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').' </label>';
1664
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1665
  $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1666
 
1667
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1668
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1669
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1670
+ $html .= '<option value="none" selected> None</option>';
1671
+ $html .= '</select>';
1672
  $html .= '</div>';
1673
 
1674
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1675
+ $html .= '<label for="hotspot-scene"> '.__('Target Scene ID: ', 'wpvr').'</label>';
1676
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1677
  $html .= '</div>';
 
 
 
1678
 
1679
+ $html .= '</div>';
1680
+ } else {
1681
+ $html .= '<div class="hotspot-type hotspot-setting">';
1682
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1683
+ $html .= '<select class="trtr" name="hotspot-type">';
1684
+ $html .= '<option value="info"> Info</option>';
1685
+ $html .= '<option value="scene" selected> Scene</option>';
1686
+ $html .= '</select>';
1687
+
1688
+ $html .= '<div class="hotspot-url" style="display:none;">';
1689
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').'</label>';
1690
+ $html .= '<input type="url" name="hotspot-url" />';
1691
+ $html .= '</div>';
1692
+
1693
+ $html .= '<div class="hotspot-content" style="display:none;">';
1694
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').' </label>';
1695
+ $html .= '<textarea name="hotspot-content"></textarea>';
1696
+ $html .= '</div>';
1697
+
1698
+ $html .= '<div class="hotspot-hover">';
1699
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
1700
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1701
+ $html .= '</div>';
1702
+
1703
+ $html .= '<div class="hotspot-scene" >';
1704
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1705
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1706
+ $html .= '<option value="none" selected> None</option>';
1707
+ $html .= '</select>';
1708
+ $html .= '</div>';
1709
+
1710
+ $html .= '<div class="hotspot-scene">';
1711
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
1712
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
1713
+ $html .= '</div>';
1714
+
1715
+ $html .= '</div>';
1716
  }
1717
+ //=Hotspot type End=//
1718
+ $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1719
+ $html .= '</div>';
1720
+ } else {
1721
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
1722
+
1723
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1724
+
1725
+ $html .= '<div class="wrapper">';
1726
+ $html .= '<div class="hotspot-setting">';
1727
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
1728
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
1729
+ $html .= '</div>';
1730
+
1731
+ $html .= '<div class="hotspot-setting">';
1732
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
1733
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
1734
+ $html .= '</div>';
1735
+
1736
+ $html .= '<div class="hotspot-setting">';
1737
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
1738
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
1739
+ $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1740
 
1741
+ $html .= '<div class="hotspot-setting">';
1742
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
1743
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
1744
+ $html .= '</div>';
1745
+
1746
+ $html .= '</div>';
1747
+
1748
+ //=Hotspot type=//
1749
+ if ($hotspot_type == "info") {
1750
+ $html .= '<div class="hotspot-type hotspot-setting">';
1751
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1752
+ $html .= '<select name="hotspot-type">';
1753
+ $html .= '<option value="info" selected> Info</option>';
1754
+ $html .= '<option value="scene"> Scene</option>';
1755
+ $html .= '</select>';
1756
+
1757
+ $html .= '<div class="hotspot-url">';
1758
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
1759
+ $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
1760
  $html .= '</div>';
1761
 
1762
+ $html .= '<div class="hotspot-content">';
1763
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1764
+ $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
1765
+ $html .= '</div>';
1766
+
1767
+ $html .= '<div class="hotspot-hover">';
1768
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
1769
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1770
+ $html .= '</div>';
1771
+
1772
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1773
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1774
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1775
+ $html .= '<option value="none" selected> None</option>';
1776
+ $html .= '</select>';
1777
+ $html .= '</div>';
1778
+
1779
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1780
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
1781
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled />';
1782
+ $html .= '</div>';
1783
+
1784
+ $html .= '</div>';
1785
+ } else {
1786
+ $html .= '<div class="hotspot-type hotspot-setting">';
1787
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1788
+ $html .= '<select class="trtr" name="hotspot-type">';
1789
+ $html .= '<option value="info"> Info</option>';
1790
+ $html .= '<option value="scene" selected> Scene</option>';
1791
+ $html .= '</select>';
1792
+
1793
+ $html .= '<div class="hotspot-url" style="display:none;">';
1794
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').'</label>';
1795
+ $html .= '<input type="url" name="hotspot-url" />';
1796
+ $html .= '</div>';
1797
+
1798
+ $html .= '<div class="hotspot-content" style="display:none;">';
1799
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1800
+ $html .= '<textarea name="hotspot-content"></textarea>';
1801
+ $html .= '</div>';
1802
+
1803
+ $html .= '<div class="hotspot-hover">';
1804
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').' </label>';
1805
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
1806
+ $html .= '</div>';
1807
+
1808
+ $html .= '<div class="hotspot-scene" >';
1809
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1810
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1811
+ $html .= '<option value="none" selected> None</option>';
1812
+ $html .= '</select>';
1813
+ $html .= '</div>';
1814
+
1815
+ $html .= '<div class="hotspot-scene">';
1816
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
1817
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
1818
+ $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1819
 
1820
  $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1821
  }
1822
+ //=Hotspot type End=//
1823
+ $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1824
+ $html .= '</div>';
1825
+ }
1826
+ $h++;
1827
+ }
1828
+ $html .= '</div>';
1829
+ $html .= '</div>';
1830
+ } else {
1831
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1832
 
1833
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1834
+ $html .= '<ul>';
1835
+ $html .= '<li class="active"><span data-index="1" data-href="#scene-'.$s.'-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
1836
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
1837
+ $html .= '</ul>';
1838
+ $html .= '</nav>';
1839
+
1840
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1841
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-1">';
1842
+
1843
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
1844
+
1845
+ $html .= '<div class="wrapper">';
1846
+ $html .= '<div class="hotspot-setting">';
1847
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
1848
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
1849
  $html .= '</div>';
 
1850
 
1851
+ $html .= '<div class="hotspot-setting">';
1852
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
1853
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
1854
+ $html .= '</div>';
1855
+
1856
+ $html .= '<div class="hotspot-setting">';
1857
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
1858
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
1859
+ $html .= '</div>';
1860
 
1861
+ $html .= '<div class="hotspot-setting">';
1862
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon class: ', 'wpvr').'</label>';
1863
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
1864
  $html .= '</div>';
1865
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1866
  $html .= '</div>';
1867
 
1868
+ $html .= '<div class="hotspot-type hotspot-setting">';
1869
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
1870
+ $html .= '<select name="hotspot-type">';
1871
+ $html .= '<option value="info" selected> Info</option>';
1872
+ $html .= '<option value="scene"> Scene</option>';
1873
+ $html .= '</select>';
1874
 
1875
+ $html .= '<div class="hotspot-url">';
1876
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').'</label>';
1877
+ $html .= '<input type="url" name="hotspot-url" value="" />';
1878
+ $html .= '</div>';
1879
+
1880
+ $html .= '<div class="hotspot-content">';
1881
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
1882
+ $html .= '<textarea name="hotspot-content"></textarea>';
 
1883
  $html .= '</div>';
1884
+
1885
+ $html .= '<div class="hotspot-hover">';
1886
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
1887
+ $html .= '<textarea name="hotspot-hover"></textarea>';
 
 
 
 
 
 
 
 
 
 
 
1888
  $html .= '</div>';
1889
 
1890
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1891
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
1892
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
1893
+ $html .= '<option value="none"> None</option>';
1894
+ $html .= '</select>';
1895
+ $html .= '</div>';
1896
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
1897
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
1898
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
1899
+ $html .= '</div>';
1900
 
1901
+ $html .= '</div>';
1902
+ //=Hotspot type End=//
1903
+ $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
1904
+ $html .= '</div>';
1905
+ $html .= '</div>';
1906
+ $html .= '</div>';
1907
+ }
1908
+ $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
1909
+ $html .= '</div>';
1910
+ } else {
1911
+ $html .= '<div data-repeater-item class="single-scene rex-pano-tab" data-title="1" id="scene-'.$s.'">';
1912
+
1913
+ $html .= '<div class="scene-content">';
1914
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Scene Setting </h6>';
1915
+
1916
+ $html .= '<div class="scene-left">';
1917
+ //==Set Default Scene==//
1918
+ if ($dscene == 'on') {
1919
+ $html .= '<div class="single-settings dscene">';
1920
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1921
+ $html .= '<select class="dscen" name="dscene">';
1922
+ $html .= '<option value="on" selected > Yes</option>';
1923
+ $html .= '<option value="off"> No</option>';
1924
+ $html .= '</select>';
1925
+ $html .= '</div>';
1926
+ } else {
1927
+ $html .= '<div class="single-settings dscene">';
1928
+ $html .= '<span>'.__('Set as Default: ', 'wpvr').'</span>';
1929
+ $html .= '<select class="dscen" name="dscene">';
1930
+ $html .= '<option value="on"> Yes</option>';
1931
+ $html .= '<option value="off" selected> No</option>';
1932
+ $html .= '</select>';
1933
  $html .= '</div>';
1934
  }
1935
+ //==Set Default Scene end==//
1936
 
1937
+ $html .= '<div class=scene-setting>';
1938
+ $html .= '<label for="scene-id">'.__('Scene ID : ', 'wpvr').'</label>';
1939
+ $html .= '<input class="sceneid" type="text" name="scene-id" value="'.$scene_id.'" />';
1940
+ $html .= '</div>';
1941
+
1942
+ $html .= '<div class=scene-setting>';
1943
+ $html .= '<label for="scene-type">'.__('Scene Type : ', 'wpvr').'</label>';
1944
+ $html .= '<input type="text" name="scene-type" value="equirectangular" disabled/>';
1945
+ $html .= '</div>';
1946
+
1947
+ $html .= '<div class=scene-setting>';
1948
+ $html .= '<label for="scene-upload">'.__('Scene Upload: ', 'wpvr').'</label>';
1949
+ $html .= '<div class="form-group">';
1950
+ $html .= '<img name ="scene-photo" src="'.$scene_photo.'"> <br/>';
1951
+ $html .= '<input type="button" class="scene-upload" data-info="" value="Upload"/>';
1952
+ $html .= '<input type="hidden" name="scene-attachment-url" class="scene-attachment-url" value="'.$scene_photo.'">';
1953
+ $html .= '</div>';
1954
+ $html .= '</div>';
1955
+ $html .= '</div>';
1956
+ //--end scene left----
1957
 
1958
+ $html .= '</div>';
1959
+
1960
+ if (!empty($pano_hotspots)) {
1961
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
1962
+
1963
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
1964
+ $html .= '<ul>';
1965
+ $j = 1;
1966
+ foreach ($pano_hotspots as $pano_hotspot) {
1967
+ if ($pano_hotspot['hotspot-title'] == $pano_hotspots[0]['hotspot-title']) {
1968
+ $html .= '<li class="active"><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1969
+ } else {
1970
+ $html .= '<li><span data-index="'.$j.'" data-href="#scene-'.$s.'-hotspot-'.$j.'"><i class="far fa-dot-circle"></i></span></li>';
1971
+ }
1972
+ $j++;
1973
+ }
1974
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i></span></li>';
1975
+ $html .= '</ul>';
1976
+ $html .= '</nav>';
1977
+
1978
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
1979
+
1980
+ $h = 1;
1981
+ foreach ($pano_hotspots as $pano_hotspot) {
1982
+ $hotspot_title = '';
1983
+ $hotspot_title = $pano_hotspot['hotspot-title'];
1984
+ $hotspot_pitch = '';
1985
+ $hotspot_pitch = $pano_hotspot['hotspot-pitch'];
1986
+ $hotspot_yaw = '';
1987
+ $hotspot_yaw = $pano_hotspot['hotspot-yaw'];
1988
+ $hotspot_type = '';
1989
+ $hotspot_type = $pano_hotspot['hotspot-type'];
1990
+ $hotspot_url = '';
1991
+ $hotspot_url = $pano_hotspot['hotspot-url'];
1992
+ $hotspot_content = '';
1993
+ $hotspot_content = $pano_hotspot['hotspot-content'];
1994
+ $hotspot_hover = '';
1995
+ $hotspot_hover = $pano_hotspot['hotspot-hover'];
1996
+ $hotspot_target_scene = '';
1997
+ $hotspot_target_scene = $pano_hotspot['hotspot-scene'];
1998
+ $hotspot_custom_class = '';
1999
+ if (isset($pano_hotspot['hotspot-customclass'])) {
2000
+ $hotspot_custom_class = $pano_hotspot['hotspot-customclass'];
2001
+ }
2002
 
2003
+ if ($pano_hotspot['hotspot-title'] == $pano_hotspots[0]['hotspot-title']) {
2004
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
 
2005
 
2006
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
 
2007
 
2008
+ $html .= '<div class="wrapper">';
2009
+ $html .= '<div class="hotspot-setting">';
2010
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
2011
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
2012
+ $html .= '</div>';
2013
+
2014
+ $html .= '<div class="hotspot-setting">';
2015
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
2016
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
2017
+ $html .= '</div>';
2018
+
2019
+ $html .= '<div class="hotspot-setting">';
2020
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
2021
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
2022
+ $html .= '</div>';
2023
+
2024
+ $html .= '<div class="hotspot-setting">';
2025
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
2026
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
2027
+ $html .= '</div>';
2028
+
2029
+ $html .= '</div>';
2030
+
2031
+ //=Hotspot type=//
2032
+ if ($hotspot_type == "info") {
2033
+ $html .= '<div class="hotspot-type hotspot-setting">';
2034
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
2035
+ $html .= '<select name="hotspot-type">';
2036
+ $html .= '<option value="info" selected> Info</option>';
2037
+ $html .= '<option value="scene"> Scene</option>';
2038
+ $html .= '</select>';
2039
+
2040
+ $html .= '<div class="hotspot-url">';
2041
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
2042
+ $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
2043
  $html .= '</div>';
2044
 
2045
+ $html .= '<div class="hotspot-content">';
2046
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').' </label>';
2047
+ $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
2048
+ $html .= '</div>';
2049
 
2050
+ $html .= '<div class="hotspot-hover">';
2051
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').' </label>';
2052
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2053
+ $html .= '</div>';
2054
+
2055
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
2056
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
2057
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2058
+ $html .= '<option value="none" selected> None</option>';
2059
+ $html .= '</select>';
2060
+ $html .= '</div>';
2061
+
2062
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
2063
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').' </label>';
2064
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene"/>';
2065
+ $html .= '</div>';
2066
+
2067
+ $html .= '</div>';
2068
+ } else {
2069
+ $html .= '<div class="hotspot-type hotspot-setting">';
2070
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
2071
+ $html .= '<select class="trtr" name="hotspot-type">';
2072
+ $html .= '<option value="info"> Info</option>';
2073
+ $html .= '<option value="scene" selected> Scene</option>';
2074
+ $html .= '</select>';
2075
+
2076
+ $html .= '<div class="hotspot-url" style="display:none;">';
2077
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
2078
+ $html .= '<input type="url" name="hotspot-url" />';
2079
+ $html .= '</div>';
2080
+
2081
+ $html .= '<div class="hotspot-content" style="display:none;">';
2082
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
2083
+ $html .= '<textarea name="hotspot-content"></textarea>';
2084
+ $html .= '</div>';
2085
+
2086
+ $html .= '<div class="hotspot-hover">';
2087
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').' </label>';
2088
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2089
+ $html .= '</div>';
2090
+
2091
+ $html .= '<div class="hotspot-scene" >';
2092
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
2093
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2094
+ $html .= '<option value="none" selected> None</option>';
2095
+ $html .= '</select>';
2096
+ $html .= '</div>';
2097
+
2098
+ $html .= '<div class="hotspot-scene">';
2099
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
2100
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
2101
+ $html .= '</div>';
2102
+
2103
+ $html .= '</div>';
2104
+ }
2105
+ //=Hotspot type End=//
2106
+ $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
2107
+ $html .= '</div>';
2108
+ } else {
2109
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab clearfix" id="scene-'.$s.'-hotspot-'.$h.'">';
2110
+
2111
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting</h6>';
2112
+
2113
+ $html .= '<div class="wrapper">';
2114
+ $html .= '<div class="hotspot-setting">';
2115
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
2116
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title" value="'.$hotspot_title.'" />';
2117
+ $html .= '</div>';
2118
+
2119
+ $html .= '<div class="hotspot-setting">';
2120
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
2121
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch" value="'.$hotspot_pitch.'" />';
2122
  $html .= '</div>';
2123
+
2124
+ $html .= '<div class="hotspot-setting">';
2125
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
2126
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw" value="'.$hotspot_yaw.'" />';
2127
+ $html .= '</div>';
2128
+
2129
+ $html .= '<div class="hotspot-setting">';
2130
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom icon Class: ', 'wpvr').'</label>';
2131
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass" value="'.$hotspot_custom_class.'"/>';
2132
+ $html .= '</div>';
2133
+
2134
+ $html .= '</div>';
2135
+
2136
+ //=Hotspot type=//
2137
+ if ($hotspot_type == "info") {
2138
+ $html .= '<div class="hotspot-type hotspot-setting">';
2139
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
2140
+ $html .= '<select name="hotspot-type">';
2141
+ $html .= '<option value="info" selected> Info</option>';
2142
+ $html .= '<option value="scene"> Scene</option>';
2143
+ $html .= '</select>';
2144
+
2145
+ $html .= '<div class="hotspot-url">';
2146
+ $html .= '<label for="hotspot-url">'.__(' URL: ', 'wpvr').'</label>';
2147
+ $html .= '<input type="url" name="hotspot-url" value="'.$hotspot_url.'" />';
2148
+ $html .= '</div>';
2149
+
2150
+ $html .= '<div class="hotspot-content">';
2151
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').' </label>';
2152
+ $html .= '<textarea name="hotspot-content">'.$hotspot_content.'</textarea>';
2153
+ $html .= '</div>';
2154
+
2155
+ $html .= '<div class="hotspot-hover">';
2156
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').' </label>';
2157
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2158
+ $html .= '</div>';
2159
+
2160
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
2161
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
2162
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2163
+ $html .= '<option value="none" selected> None</option>';
2164
+ $html .= '</select>';
2165
+ $html .= '</div>';
2166
+
2167
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
2168
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').' </label>';
2169
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled />';
2170
+ $html .= '</div>';
2171
+
2172
+ $html .= '</div>';
2173
+ } else {
2174
+ $html .= '<div class="hotspot-type hotspot-setting">';
2175
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
2176
+ $html .= '<select class="trtr" name="hotspot-type">';
2177
+ $html .= '<option value="info"> Info</option>';
2178
+ $html .= '<option value="scene" selected> Scene</option>';
2179
+ $html .= '</select>';
2180
+
2181
+ $html .= '<div class="hotspot-url" style="display:none;">';
2182
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').' </label>';
2183
+ $html .= '<input type="url" name="hotspot-url" />';
2184
+ $html .= '</div>';
2185
+
2186
+ $html .= '<div class="hotspot-content" style="display:none;">';
2187
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').' </label>';
2188
+ $html .= '<textarea name="hotspot-content"></textarea>';
2189
+ $html .= '</div>';
2190
+
2191
+ $html .= '<div class="hotspot-hover">';
2192
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
2193
+ $html .= '<textarea name="hotspot-hover">'.$hotspot_hover.'</textarea>';
2194
+ $html .= '</div>';
2195
+
2196
+ $html .= '<div class="hotspot-scene" >';
2197
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
2198
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2199
+ $html .= '<option value="none" selected> None</option>';
2200
+ $html .= '</select>';
2201
+ $html .= '</div>';
2202
+
2203
+ $html .= '<div class="hotspot-scene">';
2204
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').' </label>';
2205
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" value="'.$hotspot_target_scene.'" disabled />';
2206
+ $html .= '</div>';
2207
+
2208
+ $html .= '</div>';
2209
+ }
2210
+ //=Hotspot type End=//
2211
+ $html .= '<button data-repeater-delete type="button" title="Delete Hotspot" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
2212
+ $html .= '</div>';
2213
+ }
2214
+ $h++;
2215
+ }
2216
+ $html .= '</div>';
2217
  $html .= '</div>';
2218
+ } else {
2219
+ $html .= '<div class="hotspot-setup rex-pano-sub-tabs" data-limit="'.$data_limit.'">';
2220
+
2221
+ $html .= '<nav class="rex-pano-tab-nav rex-pano-nav-menu hotspot-nav">';
2222
+ $html .= '<ul>';
2223
+ $html .= '<li class="active"><span data-index="1" data-href="#scene-'.$s.'-hotspot-1"><i class="far fa-dot-circle"></i></span></li>';
2224
+ $html .= '<li class="add" data-repeater-create><span><i class="fa fa-plus-circle"></i> </span></li>';
2225
+ $html .= '</ul>';
2226
+ $html .= '</nav>';
2227
+
2228
+ $html .= '<div data-repeater-list="hotspot-list" class="rex-pano-tab-content">';
2229
+ $html .= '<div data-repeater-item class="single-hotspot rex-pano-tab active clearfix" id="scene-'.$s.'-hotspot-1">';
2230
 
2231
+ $html .= '<h6 class="title"><i class="fa fa-cog"></i> Hotspot Setting </h6>';
2232
+
2233
+ $html .= '<div class="wrapper">';
2234
+ $html .= '<div class="hotspot-setting">';
2235
+ $html .= '<label for="hotspot-title">'.__('Hotspot ID : ', 'wpvr').'</label>';
2236
+ $html .= '<input type="text" id="hotspot-title" name="hotspot-title"/>';
2237
+ $html .= '</div>';
2238
+
2239
+ $html .= '<div class="hotspot-setting">';
2240
+ $html .= '<label for="hotspot-pitch">'.__('Pitch: ', 'wpvr').'</label>';
2241
+ $html .= '<input type="text" class="hotspot-pitch" name="hotspot-pitch"/>';
2242
+ $html .= '</div>';
2243
+
2244
+ $html .= '<div class="hotspot-setting">';
2245
+ $html .= '<label for="hotspot-yaw">'.__('Yaw: ', 'wpvr').'</label>';
2246
+ $html .= '<input type="text" class="hotspot-yaw" name="hotspot-yaw"/>';
2247
+ $html .= '</div>';
2248
+
2249
+ $html .= '<div class="hotspot-setting">';
2250
+ $html .= '<label for="hotspot-customclass">'.__('Hotspot Custom Icon Class: ', 'wpvr').'</label>';
2251
+ $html .= '<input type="text" id="hotspot-customclass" name="hotspot-customclass"/>';
2252
+ $html .= '</div>';
2253
+
2254
+ $html .= '</div>';
2255
+
2256
+ $html .= '<div class="hotspot-type hotspot-setting">';
2257
+ $html .= '<label for="hotspot-type">'.__('Hotspot-Type: ', 'wpvr').'</label>';
2258
+ $html .= '<select name="hotspot-type">';
2259
+ $html .= '<option value="info" selected> Info</option>';
2260
+ $html .= '<option value="scene"> Scene</option>';
2261
+ $html .= '</select>';
2262
+
2263
+ $html .= '<div class="hotspot-url">';
2264
+ $html .= '<label for="hotspot-url">'.__('URL: ', 'wpvr').'</label>';
2265
+ $html .= '<input type="url" name="hotspot-url" value="" />';
2266
+ $html .= '</div>';
2267
+
2268
+ $html .= '<div class="hotspot-content">';
2269
+ $html .= '<label for="hotspot-content">'.__('On Click Content: ', 'wpvr').'</label>';
2270
+ $html .= '<textarea name="hotspot-content"></textarea>';
2271
+ $html .= '</div>';
2272
+
2273
+ $html .= '<div class="hotspot-hover">';
2274
+ $html .= '<label for="hotspot-hover">'.__('On Hover Content: ', 'wpvr').'</label>';
2275
+ $html .= '<textarea name="hotspot-hover"></textarea>';
2276
+ $html .= '</div>';
2277
+
2278
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
2279
+ $html .= '<label for="hotspot-scene">'.__('Select Target Scene from List: ', 'wpvr').'</label>';
2280
+ $html .= '<select class="hotspotscene" name="hotspot-scene-list">';
2281
+ $html .= '<option value="none"> None</option>';
2282
+ $html .= '</select>';
2283
+ $html .= '</div>';
2284
+ $html .= '<div class="hotspot-scene" style="display:none;" >';
2285
+ $html .= '<label for="hotspot-scene">'.__('Target Scene ID: ', 'wpvr').'</label>';
2286
+ $html .= '<input class="hotspotsceneinfodata" type="text" name="hotspot-scene" disabled/>';
2287
+ $html .= '</div>';
2288
+
2289
+ $html .= '</div>';
2290
+ //=Hotspot type End=//
2291
+ $html .= '<button data-repeater-delete title="Delete Hotspot" type="button" class="delete-hotspot"><i class="far fa-trash-alt"></i></button>';
2292
+ $html .= '</div>';
2293
+ $html .= '</div>';
2294
+ $html .= '</div>';
2295
+ }
2296
+ $html .= '<button data-repeater-delete type="button" title="Delete Scene" class="delete-scene"><i class="far fa-trash-alt"></i></button>';
2297
+ $html .= '</div>';
2298
+ }
2299
+ $s++;
2300
+ }
2301
+ $html .= '</div>';
2302
+
2303
+ $html .= '</div>';
2304
+ }
2305
+
2306
+ $html .= '<div class="preview-btn-wrapper">';
2307
+ $html .= '<div class="preview-btn-area clearfix">';
2308
+
2309
+ $html .= '<button id="panolenspreview">'.__('Preview', 'wpvr').'</button>';
2310
+ $html .= '</div>';
2311
+ $html .= '</div>';
2312
+ $html .='</div>';
2313
+ //---end scenes tab----
2314
+ $html .= '<div id="error_occured"></div>';
2315
+
2316
+ //----start video tab content---------
2317
+ $html .='<div class="rex-pano-tab video" id="video">';
2318
+ $html .= '<h6 class="title"> '.__('Video Settings : ', 'wpvr').'</h6>';
2319
+ //==Video Setup==//
2320
+ if (isset($postdata['vidid'])) {
2321
+ $vidautoplay = $postdata['vidautoplay'];
2322
+ $vidautoplay_on = '';
2323
+ $vidautoplay_off = '';
2324
+ if (!empty($vidautoplay)) {
2325
+ $vidautoplay_on = 'checked';
2326
+ } else {
2327
+ $vidautoplay_off = 'checked';
2328
+ }
2329
+
2330
+ $vidcontrol = $postdata['vidcontrol'];
2331
+ $vidcontrol_on = '';
2332
+ $vidcontrol_off = '';
2333
+ if (!empty($vidcontrol)) {
2334
+ $vidcontrol_on = 'checked';
2335
+ } else {
2336
+ $vidcontrol_off = 'checked';
2337
+ }
2338
+ $html .= '<div class="single-settings videosetup">';
2339
+ $html .= '<span>'.__('Enable Video:', 'wpvr').'</span>';
2340
+ $html .= '<ul>';
2341
+ $html .= '<li class="radio-btn">';
2342
+ $html .= '<input class="styled-radio" id="styled-radio" type="radio" name="panovideo" value="off" >';
2343
+ $html .= '<label for="styled-radio">Off</label>';
2344
+ $html .= '</li>';
2345
+
2346
+ $html .= '<li class="radio-btn">';
2347
+ $html .= '<input class="styled-radio" id="styled-radio-0" type="radio" name="panovideo" value="on" checked>';
2348
+ $html .= '<label for="styled-radio-0">On</label>';
2349
+ $html .= '</li>';
2350
+ $html .= '</ul>';
2351
+ $html .= '</div>';
2352
+
2353
+
2354
+ $html .= '<div class="video-setting" style="display:none;">';
2355
+ $html .= '<div class="single-settings">';
2356
+ $html .= '<span>'.__('Upload or Add Link: ', 'wpvr').'</span>';
2357
+ $html .= '<div class="form-group">';
2358
+ $html .= '<input type="text" name="video-attachment-url" placeholder="Paste Youtube or Vimeo link or upload" class="video-attachment-url" value="'.$postdata['vidurl'].'">';
2359
+ $html .= '<input type="button" class="video-upload" data-info="" value="Upload" />';
2360
+ $html .= '</div>';
2361
+ $html .= '</div>';
2362
+ $html .= '<button id="videopreview">Preview</button>';
2363
+ $html .= '</div>';
2364
+ } else {
2365
+ $html .= '<div class="single-settings videosetup">';
2366
+ $html .= '<span>'.__('Enable Video: ', 'wpvr').'</span>';
2367
+ $html .= '<ul>';
2368
+ $html .= '<li class="radio-btn">';
2369
+ $html .= '<input class="styled-radio" id="styled-radio" type="radio" name="panovideo" value="off" checked >';
2370
+ $html .= '<label for="styled-radio">Off</label>';
2371
+ $html .= '</li>';
2372
+
2373
+ $html .= '<li class="radio-btn">';
2374
+ $html .= '<input class="styled-radio" id="styled-radio-0" type="radio" name="panovideo" value="on" >';
2375
+ $html .= '<label for="styled-radio-0">On</label>';
2376
+ $html .= '</li>';
2377
+ $html .= '</ul>';
2378
+ $html .= '</div>';
2379
+
2380
+ //==Video setup end==//
2381
+
2382
+ //==Video Setting==/
2383
+ $html .= '<div class="video-setting" style="display:none;">';
2384
+ $html .= '<div class="single-settings">';
2385
+ $html .= '<span>'.__('Upload or Add Link: ', 'wpvr').'</span>';
2386
+ $html .= '<div class="form-group">';
2387
+ $html .= '<input type="text" placeholder="Paste Youtube or Vimeo link or upload" name="video-attachment-url" class="video-attachment-url" value="">';
2388
+ $html .= '<input type="button" class="video-upload" data-info="" value="Upload"/>';
2389
+ $html .= '</div>';
2390
+ $html .= '</div>';
2391
+ $html .= '<button id="videopreview">Preview</button>';
2392
+ $html .= '</div>';
2393
+ }
2394
+
2395
+ $html .= '<div class="wpvr-use-shortcode">';
2396
+ $post = get_post();
2397
+ $id = $post->ID;
2398
+ $slug = $post->post_name;
2399
+ $postdata = get_post_meta($post->ID, 'panodata', true);
2400
+
2401
+ $html .= '<h4 class="area-title">'.__('Using this Tour', 'wpvr').'</h4>';
2402
+
2403
+ $html .= '<div class="shortcode-wrapper">';
2404
+ $html .= '<div class="single-shortcode classic">';
2405
+ $html .= '<span class="shortcode-title">'.__('For Classic Editor:', 'wpvr').'</span>';
2406
+
2407
+ $html .= '<div class="field-wapper">';
2408
+ $html .= '<span>'.__('To use this WP VR tour in your posts or pages use the following shortcode ', 'wpvr').'</span>';
2409
+
2410
+ $html .= '<div class="shortcode-field">';
2411
+ $html .= '<p class="copycode" id="copy-shortcode-video">[wpvr id="'.$id.'"]</p>';
2412
+ $html .= '<span id="wpvr-copy-shortcode-video" class="wpvr-copy-shortcode">';
2413
+ $html .= '<img src="'.WPVR_PLUGIN_DIR_URL . 'admin/icon/copy.png'.'" alt="icon" />';
2414
+ $html .= '</span>';
2415
+ $html .= '</div>';
2416
+
2417
+ $html .= '<span id="wpvr-copied-notice-video" class="wpvr-copied-notice"></span>';
2418
+
2419
+ $html .= '</div>';
2420
+ $html .= '</div>';
2421
+ $html .= '</div>';
2422
+
2423
+ $html .= '<script>';
2424
+ $html .= '
2425
 
2426
  document.getElementById("wpvr-copy-shortcode-video").addEventListener("click", function() {
2427
  copyToClipboardVideo(document.getElementById("copy-shortcode-video"));
2485
 
2486
  ';
2487
 
2488
+ $html .= '</script>';
2489
+ $html .= '</div>';
2490
+ //=end shortcode area=
2491
+ //==Video Setting End==//
2492
 
2493
+ $html .='</div>';
2494
+ //---end video tab----
2495
+ $html .='</div>';
2496
+ //---end rex-pano-tab-content----
2497
  $html .='</div>';
2498
  //---end rex-pano-tabs---
2499
+ $html .= '</div>';
2500
+ $html .= '<div class="wpvr-loading" style="display:none;">Loading&#8230;</div>';
2501
+ echo $html;
2502
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2503
 
2504
+ /**
2505
+ * Rollback execution
2506
+ */
2507
+ public function trigger_rollback()
2508
+ {
2509
+ if (isset($_GET['wpvr_version'])) {
2510
+ $version = $_GET['wpvr_version'];
2511
+ $plugin_slug = 'wpvr';
2512
+ $rollback = new WPVR_Rollback(
2513
+ [
2514
+ 'version' => $version,
2515
+ 'plugin_name' => 'wpvr',
2516
+ 'plugin_slug' => $plugin_slug,
2517
+ 'package_url' => sprintf('https://downloads.wordpress.org/plugin/%s.%s.zip', $plugin_slug, $version),
2518
+ ]
2519
+ );
2520
 
2521
+ $rollback->run();
2522
+ }
2523
+ }
2524
  }
admin/class-wpvr-ajax.php CHANGED
@@ -860,6 +860,14 @@ class Wpvr_Ajax {
860
  $vrgallery_title = false;
861
  }
862
 
 
 
 
 
 
 
 
 
863
  $gyro = sanitize_text_field($_POST['gyro']);
864
  $deviceorientationcontrol = sanitize_text_field($_POST['deviceorientationcontrol']);
865
 
@@ -1255,7 +1263,7 @@ class Wpvr_Ajax {
1255
  //===audio===//
1256
 
1257
  $pano_array = array();
1258
- $pano_array = array(__( "panoid" )=>$panoid,__( "autoLoad" )=>$autoload,__( "showControls" )=>$control,__( "cpLogoSwitch" )=>$cpLogoSwitch,__( "cpLogoImg" )=>$cpLogoImg,__( "cpLogoContent" )=>$cpLogoContent,__( "vrgallery" )=>$vrgallery,__( "vrgallery_title" )=>$vrgallery_title,__( "customcontrol" )=>$custom_control,__( "gyro" )=>$gyro,__( "deviceorientationcontrol" )=>$deviceorientationcontrol,__( "compass" )=>$compass,__( "mouseZoom" )=>$mouseZoom,__( "draggable" )=>$draggable,__( "diskeyboard" )=>$diskeyboard,__( "keyboardzoom" )=>$keyboardzoom,__( "autoRotate" )=>$autorotation,__( "autoRotateInactivityDelay" )=>$autorotationinactivedelay,__( "autoRotateStopDelay" )=>$autorotationstopdelay,__( "preview" )=>$preview,__( "defaultscene" )=>$default_scene,__( "scenefadeduration" )=>$scene_fade_duration,__( "bg_music" )=>$bg_music,__( "bg_music_url" )=>$bg_music_url,__( "autoplay_bg_music" )=>$autoplay_bg_music,__( "loop_bg_music" )=>$loop_bg_music,__( "panodata" )=>$panodata);
1259
 
1260
  if ($rotation == 'off') {
1261
  unset($pano_array['autoRotate']);
860
  $vrgallery_title = false;
861
  }
862
 
863
+ $vrgallery_display = sanitize_text_field($_POST['vrgallery_display']);
864
+ if ($vrgallery_display == 'on') {
865
+ $vrgallery_display = true;
866
+ }
867
+ else {
868
+ $vrgallery_display = false;
869
+ }
870
+
871
  $gyro = sanitize_text_field($_POST['gyro']);
872
  $deviceorientationcontrol = sanitize_text_field($_POST['deviceorientationcontrol']);
873
 
1263
  //===audio===//
1264
 
1265
  $pano_array = array();
1266
+ $pano_array = array(__( "panoid" )=>$panoid,__( "autoLoad" )=>$autoload,__( "showControls" )=>$control,__( "cpLogoSwitch" )=>$cpLogoSwitch,__( "cpLogoImg" )=>$cpLogoImg,__( "cpLogoContent" )=>$cpLogoContent,__( "vrgallery" )=>$vrgallery,__( "vrgallery_title" )=>$vrgallery_title,__( "vrgallery_display" )=>$vrgallery_display,__( "customcontrol" )=>$custom_control,__( "gyro" )=>$gyro,__( "deviceorientationcontrol" )=>$deviceorientationcontrol,__( "compass" )=>$compass,__( "mouseZoom" )=>$mouseZoom,__( "draggable" )=>$draggable,__( "diskeyboard" )=>$diskeyboard,__( "keyboardzoom" )=>$keyboardzoom,__( "autoRotate" )=>$autorotation,__( "autoRotateInactivityDelay" )=>$autorotationinactivedelay,__( "autoRotateStopDelay" )=>$autorotationstopdelay,__( "preview" )=>$preview,__( "defaultscene" )=>$default_scene,__( "scenefadeduration" )=>$scene_fade_duration,__( "bg_music" )=>$bg_music,__( "bg_music_url" )=>$bg_music_url,__( "autoplay_bg_music" )=>$autoplay_bg_music,__( "loop_bg_music" )=>$loop_bg_music,__( "panodata" )=>$panodata);
1267
 
1268
  if ($rotation == 'off') {
1269
  unset($pano_array['autoRotate']);
admin/css/iconpicker.ttf CHANGED
File without changes
admin/css/iconpicker.woff CHANGED
File without changes
admin/css/jquery.fonticonpicker.grey.min.css CHANGED
File without changes
admin/css/jquery.fonticonpicker.min.css CHANGED
File without changes
admin/css/owl.carousel.css CHANGED
File without changes
admin/css/owl.theme.default.css CHANGED
File without changes
admin/js/owl.carousel.js CHANGED
File without changes
admin/lib/jquery.fonticonpicker.min.js CHANGED
File without changes
admin/lib/pannellum/src/css/img/background.svg CHANGED
File without changes
admin/lib/pannellum/src/css/img/compass.svg CHANGED
File without changes
admin/lib/pannellum/src/css/img/grab.svg CHANGED
File without changes
admin/lib/pannellum/src/css/img/grabbing.svg CHANGED
File without changes
admin/lib/pannellum/src/css/img/sprites.svg CHANGED
File without changes
admin/lib/pannellum/src/css/pannellum.css CHANGED
File without changes
admin/lib/pannellum/src/js/libpannellum.js CHANGED
File without changes
admin/lib/pannellum/src/js/pannellum.js CHANGED
File without changes
public/class-wpvr-public.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit; // Exit if accessed directly
 
 
3
 
4
  /**
5
  * The public-facing functionality of the plugin.
@@ -22,176 +24,173 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
22
  * @author Rextheme <sakib@coderex.co>
23
  */
24
 
25
- class Wpvr_Public {
26
-
27
- /**
28
- * The ID of this plugin.
29
- *
30
- * @since 1.0.0
31
- * @access private
32
- * @var string $plugin_name The ID of this plugin.
33
- */
34
- private $plugin_name;
35
-
36
- /**
37
- * The version of this plugin.
38
- *
39
- * @since 1.0.0
40
- * @access private
41
- * @var string $version The current version of this plugin.
42
- */
43
- private $version;
44
-
45
- /**
46
- * Initialize the class and set its properties.
47
- *
48
- * @since 1.0.0
49
- * @param string $plugin_name The name of the plugin.
50
- * @param string $version The version of this plugin.
51
- */
52
- public function __construct( $plugin_name, $version ) {
53
-
54
- $this->plugin_name = $plugin_name;
55
- $this->version = $version;
56
-
57
- }
58
-
59
- /**
60
- * Register the stylesheets for the public-facing side of the site.
61
- *
62
- * @since 1.0.0
63
- */
64
- public function enqueue_styles() {
65
-
66
- /**
67
- * This function is provided for demonstration purposes only.
68
- *
69
- * An instance of this class should be passed to the run() function
70
- * defined in Wpvr_Loader as all of the hooks are defined
71
- * in that particular class.
72
- *
73
- * The Wpvr_Loader will then create the relationship
74
- * between the defined hooks and the functions defined in this
75
- * class.
76
- */
77
-
78
- global $wp;
79
- $wpvr_script_control = get_option('wpvr_script_control');
80
- $wpvr_script_list = get_option('wpvr_script_list');
81
- $allowed_pages_modified = array();
82
- $allowed_pages = explode(",",$wpvr_script_list);
83
- foreach ($allowed_pages as $value) {
84
- $allowed_pages_modified[] = untrailingslashit($value);
85
- }
86
- $current_url = home_url(add_query_arg(array($_GET), $wp->request));
87
-
88
- if ($wpvr_script_control == 'true') {
89
-
90
- foreach ($allowed_pages_modified as $value) {
91
- if ($value) {
92
- if (strpos($current_url, $value) !== false) {
93
- $fontawesome_disable = get_option('wpvr_fontawesome_disable');
94
- if ($fontawesome_disable == 'true') {
95
- }
96
- else {
97
- wp_enqueue_style( $this->plugin_name . 'fontawesome', 'https://use.fontawesome.com/releases/v5.7.2/css/all.css', array(), $this->version, 'all' );
98
- }
99
- wp_enqueue_style('panellium-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/pannellum.css', array(), true);
100
- wp_enqueue_style('videojs-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/video-js.css', array(), true);
101
- wp_enqueue_style( 'owl-css', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), $this->version, 'all' );
102
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-public.css', array(), $this->version, 'all' );
103
- }
104
- }
105
- }
106
- }
107
- else {
108
- $fontawesome_disable = get_option('wpvr_fontawesome_disable');
109
- if ($fontawesome_disable == 'true') {
110
- }
111
- else {
112
- wp_enqueue_style( $this->plugin_name . 'fontawesome', 'https://use.fontawesome.com/releases/v5.7.2/css/all.css', array(), $this->version, 'all' );
113
- }
114
- wp_enqueue_style('panellium-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/pannellum.css', array(), true);
115
- wp_enqueue_style('videojs-css', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/css/video-js.css', array(), true);
116
- wp_enqueue_style( 'owl-css', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), $this->version, 'all' );
117
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpvr-public.css', array(), $this->version, 'all' );
118
- }
119
- }
120
-
121
- /**
122
- * Register the JavaScript for the public-facing side of the site.
123
- *
124
- * @since 1.0.0
125
- */
126
- public function enqueue_scripts() {
127
-
128
- /**
129
- * This function is provided for demonstration purposes only.
130
- *
131
- * An instance of this class should be passed to the run() function
132
- * defined in Wpvr_Loader as all of the hooks are defined
133
- * in that particular class.
134
- *
135
- * The Wpvr_Loader will then create the relationship
136
- * between the defined hooks and the functions defined in this
137
- * class.
138
- */
139
- $notice = '';
140
- $wpvr_frontend_notice = get_option('wpvr_frontend_notice');
141
- if ($wpvr_frontend_notice) {
142
- $notice = get_option('wpvr_frontend_notice_area');
143
- }
144
- global $wp;
145
- $wpvr_script_control = get_option('wpvr_script_control');
146
- $wpvr_script_list = get_option('wpvr_script_list');
147
- $allowed_pages_modified = array();
148
- $allowed_pages = explode(",",$wpvr_script_list);
149
- foreach ($allowed_pages as $value) {
150
- $allowed_pages_modified[] = untrailingslashit($value);
151
- }
152
- $current_url = home_url(add_query_arg(array($_GET), $wp->request));
153
-
154
- if ($wpvr_script_control == 'true') {
155
- foreach ($allowed_pages_modified as $value) {
156
- if (strpos($current_url, $value) !== false) {
157
- wp_enqueue_script('panellium-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/pannellum.js', array(), true);
158
- wp_enqueue_script('panelliumlib-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/libpannellum.js', array(), true);
159
- wp_enqueue_script('videojs-js', plugin_dir_url( __FILE__ ) . 'js/video.js', array(), true);
160
- wp_enqueue_script('panelliumvid-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/videojs-pannellum-plugin.js', array(), true);
161
- wp_enqueue_script( 'owl-js', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), false );
162
- wp_enqueue_script('jquery_cookie', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js', array('jquery'), true);
163
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpvr-public.js', array('jquery', 'jquery_cookie' ), $this->version, false );
164
- wp_localize_script('wpvr', 'wpvr_public', array(
165
  'notice_active' => $wpvr_frontend_notice ,
166
  'notice' => $notice ,
167
  ));
168
- }
169
- }
170
- }
171
- else {
172
- wp_enqueue_script('panellium-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/pannellum.js', array(), true);
173
- wp_enqueue_script('panelliumlib-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/libpannellum.js', array(), true);
174
- wp_enqueue_script('videojs-js', plugin_dir_url( __FILE__ ) . 'js/video.js', array(), true);
175
- wp_enqueue_script('panelliumvid-js', plugin_dir_url( __FILE__ ) . 'lib/pannellum/src/js/videojs-pannellum-plugin.js', array(), true);
176
- wp_enqueue_script( 'owl-js', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), false );
177
- wp_enqueue_script('jquery_cookie', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js', array('jquery'), true);
178
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpvr-public.js', array( 'jquery', 'jquery_cookie' ), $this->version, true );
179
- wp_localize_script('wpvr', 'wpvr_public', array(
180
  'notice_active' => $wpvr_frontend_notice ,
181
  'notice' => $notice ,
182
  ));
183
- }
184
-
185
- }
186
 
187
- /**
188
- * Init the edit screen of the plugin post type item
189
- *
190
- * @since 1.0.0
191
- */
192
- public function public_init() {
193
- add_shortcode( $this->plugin_name, array( $this , 'wpvr_shortcode') );
194
- }
 
195
 
196
 
197
  /**
@@ -199,29 +198,30 @@ class Wpvr_Public {
199
  *
200
  * @since 1.0.0
201
  */
202
- public function wpvr_shortcode( $atts ) {
203
-
204
  extract(
205
  shortcode_atts(
206
  array(
207
  'id' => 0,
208
- 'width' => NULL,
209
- 'height' => NULL,
210
- 'radius' => NULL
211
- ), $atts
 
212
  )
213
  );
214
 
215
- if ( !$id ) {
216
- $obj = get_page_by_path( $slug, OBJECT, $this->post_type );
217
- if ( $obj ) {
218
  $id = $obj->ID;
219
  } else {
220
  return __('Invalid Wpvr slug attribute', $this->plugin_name);
221
  }
222
  }
223
 
224
- $postdata = get_post_meta( $id, 'panodata', true );
225
  $panoid = 'pano'.$id;
226
 
227
  if (isset($postdata['streetviewdata'])) {
@@ -260,22 +260,20 @@ class Wpvr_Public {
260
 
261
  if (strpos($videourl, 'youtube') > 0) {
262
  $explodeid = '';
263
- $explodeid = explode("=",$videourl);
264
  $foundid = '';
265
 
266
  if ($autoplay == 'on') {
267
  $autoplay = '&autoplay=1';
268
  $muted = '&mute=1';
269
- }
270
- else {
271
  $autoplay = '';
272
  $muted = '';
273
  }
274
 
275
  if ($loop == 'on') {
276
  $loop = '&loop=1';
277
- }
278
- else {
279
  $loop = '';
280
  }
281
 
@@ -286,32 +284,26 @@ class Wpvr_Public {
286
  <iframe src="https://www.youtube.com/embed/'.$explodeid[1].'?rel=0&modestbranding=1'.$loop.'&autohide=1'.$muted.'&showinfo=0&controls=1'.$autoplay.'" width="560" height="315" frameborder="0" allowfullscreen></iframe>
287
  ';
288
  $html .= '</div>';
289
-
290
-
291
  } elseif (strpos($videourl, 'vimeo') > 0) {
292
-
293
  $explodeid = '';
294
- $explodeid = explode("/",$videourl);
295
  $foundid = '';
296
  if ($autoplay == 'on') {
297
  $autoplay = '&autoplay=1&muted=1';
298
- }
299
- else {
300
  $autoplay = '';
301
  }
302
 
303
  if ($loop == 'on') {
304
  $loop = '&loop=1';
305
- }
306
- else {
307
  $loop = '';
308
  }
309
  $foundid = $explodeid[3].'?'.$autoplay.$loop;
310
  $html = '';
311
  $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
312
- $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.trim($width,'px').'" height="'.trim($height,'px').'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
313
  $html .= '</div>';
314
-
315
  } else {
316
  $html = '';
317
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto;">';
@@ -356,6 +348,11 @@ class Wpvr_Public {
356
  $vrgallery_title = $postdata['vrgallery_title'];
357
  }
358
 
 
 
 
 
 
359
  $gyro = false;
360
  $gyro_orientation = false;
361
  if (isset($postdata['gyro'])) {
@@ -440,7 +437,6 @@ class Wpvr_Public {
440
 
441
  if (!empty($panodata["scene-list"])) {
442
  foreach ($panodata["scene-list"] as $panoscenes) {
443
-
444
  $scene_ititle = '';
445
  if (isset($panoscenes["scene-ititle"])) {
446
  $scene_ititle = sanitize_text_field($panoscenes["scene-ititle"]);
@@ -512,8 +508,7 @@ class Wpvr_Public {
512
 
513
  if (!empty($default_zoom)) {
514
  $default_zoom = (int)$default_zoom;
515
- }
516
- else {
517
  $default_zoom = 100;
518
  }
519
 
@@ -524,8 +519,7 @@ class Wpvr_Public {
524
 
525
  if (!empty($max_zoom)) {
526
  $max_zoom = (int)$max_zoom;
527
- }
528
- else {
529
  $max_zoom = 120;
530
  }
531
 
@@ -536,8 +530,7 @@ class Wpvr_Public {
536
 
537
  if (!empty($min_zoom)) {
538
  $min_zoom = (int)$min_zoom;
539
- }
540
- else {
541
  $min_zoom = 50;
542
  }
543
  $hotspot_datas = array();
@@ -549,9 +542,8 @@ class Wpvr_Public {
549
 
550
 
551
  foreach ($hotspot_datas as $hotspot_data) {
552
-
553
- $status = get_option( 'wpvr_edd_license_status' );
554
- if( $status !== false && $status == 'valid' ) {
555
  if (isset($hotspot_data["hotspot-customclass-pro"]) && $hotspot_data["hotspot-customclass-pro"] != 'none') {
556
  $hotspot_data["hotspot-customclass"] = $hotspot_data["hotspot-customclass-pro"];
557
  $hotspoticoncolor = $hotspot_data["hotspot-customclass-color-icon-value"];
@@ -576,7 +568,9 @@ class Wpvr_Public {
576
  do_action('wpvr_hotspot_content', $hotspot_data);
577
  $hotspot_content = ob_get_clean();
578
 
579
- if (!$hotspot_content) $hotspot_content = $hotspot_data["hotspot-content"];
 
 
580
 
581
  $hotspot_info = array(
582
  "text"=>$hotspot_data["hotspot-title"],
@@ -605,37 +599,36 @@ class Wpvr_Public {
605
  array_push($hotspots, $hotspot_info);
606
  }
607
 
608
- $device_scene = $panoscenes['scene-attachment-url'];
609
- $mobile_media_resize = get_option('mobile_media_resize');
610
- $file_accessible = ini_get('allow_url_fopen');
611
-
612
- if ($mobile_media_resize == "true") {
613
- if ($file_accessible == "1") {
614
- $image_info = getimagesize($device_scene);
615
- if ($image_info[0] > 4096) {
616
- $src_to_id_for_mobile = '';
617
- $src_to_id_for_desktop = '';
618
- if (wpvr_isMobileDevice()) {
619
- $src_to_id_for_mobile = attachment_url_to_postid($panoscenes['scene-attachment-url']);
620
- if ($src_to_id_for_mobile) {
621
- $mobile_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'wpvr_mobile');
622
- if ($mobile_scene[3]) {
623
- $device_scene = $mobile_scene[0];
624
- }
625
- }
626
- }
627
- else {
628
- $src_to_id_for_desktop = attachment_url_to_postid($panoscenes['scene-attachment-url']);
629
- if ($src_to_id_for_desktop) {
630
- $desktop_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'full');
631
- if ($desktop_scene[0]) {
632
- $device_scene = $desktop_scene[0];
633
- }
634
- }
635
- }
636
- }
637
- }
638
- }
639
 
640
  $scene_info = array();
641
  $scene_info = array("type"=>$panoscenes["scene-type"],"panorama"=>$device_scene,"pitch"=>$default_scene_pitch,"maxPitch"=>$scene_max_pitch,"minPitch"=>$scene_min_pitch,"maxYaw"=>$scene_max_yaw,"minYaw"=>$scene_min_yaw,"yaw"=>$default_scene_yaw,"hfov"=>$default_zoom,"maxHfov"=>$max_zoom,"minHfov"=>$min_zoom,"title"=>$scene_ititle,"author"=>$scene_author, "authorURL"=>$scene_author_url, "vaov"=>$scene_vaov, "haov"=>$scene_haov, "vOffset"=>$scene_vertical_offset, "hotSpots"=>$hotspots);
@@ -746,20 +739,18 @@ class Wpvr_Public {
746
  $pulse_color = wpvr_hex2rgb($hotspoticoncolor);
747
  $rgb = wpvr_HTMLToRGB($hotspoticoncolor);
748
  $hsl = wpvr_RGBToHSL($rgb);
749
- if($hsl->lightness > 200) {
750
  $foreground_color = '#000000';
751
- }
752
- else {
753
  $foreground_color = '#fff';
754
  }
755
  $html = '';
756
 
757
  $html .= '<style>';
758
- if ($width == 'embed'){
759
  $html .= 'body{
760
  overflow: hidden;
761
  }';
762
-
763
  }
764
  $html .= '#'.$panoid.' div.pnlm-hotspot-base.fas,
765
  #'.$panoid.' div.pnlm-hotspot-base.fab,
@@ -792,15 +783,14 @@ class Wpvr_Public {
792
  }';
793
  }
794
 
795
- $status = get_option( 'wpvr_edd_license_status' );
796
- if( $status !== false && $status == 'valid' ) {
797
  if (!$gyro) {
798
  $html .= '#'.$panoid.' div.pnlm-orientation-button {
799
  display: none;
800
  }';
801
  }
802
- }
803
- else {
804
  $html .= '#'.$panoid.' div.pnlm-orientation-button {
805
  display: none;
806
  }';
@@ -811,36 +801,26 @@ class Wpvr_Public {
811
  if (wpvr_isMobileDevice()) {
812
  if ($radius) {
813
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;">';
814
- }
815
- else {
816
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center;">';
817
  }
818
-
819
- }
820
- else {
821
  if ($radius) {
822
  $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; border-radius:'.$radius.'; direction:ltr;" >';
823
- }
824
- else {
825
  $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; direction:ltr;" >';
826
  }
827
-
828
  }
829
- }
830
-
831
- elseif ($width == 'embed') {
832
- if (apply_filters('is_wpvr_embed_addon_premium', false)) {
833
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; direction:ltr;" >';
834
- }
835
- }
836
- else {
837
  if ($radius) {
838
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
839
- }
840
- else {
841
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; direction:ltr;">';
842
  }
843
-
844
  }
845
 
846
  //===company logo===//
@@ -865,8 +845,7 @@ class Wpvr_Public {
865
 
866
  //===Custom Control===//
867
  if (isset($custom_control)) {
868
- if ( $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
869
-
870
  $html .= '<div id="zoom-in-out-controls'.$id.'" class="zoom-in-out-controls">';
871
 
872
  if ($custom_control['backToHomeSwitch'] == "on") {
@@ -929,9 +908,8 @@ class Wpvr_Public {
929
  $scene_key = $panoscenes['scene-id'];
930
  if ($vrgallery_title == 'on') {
931
  $scene_key_title = $panoscenes['scene-ititle'];
932
- // $scene_key_title = $panoscenes['scene-id'];
933
- }
934
- else {
935
  $scene_key_title = "";
936
  }
937
  $img_src_url = $panoscenes['scene-attachment-url'];
@@ -939,8 +917,7 @@ class Wpvr_Public {
939
  $thumbnail_array = wp_get_attachment_image_src($src_to_id, 'thumbnail');
940
  if ($thumbnail_array) {
941
  $thumbnail = $thumbnail_array[0];
942
- }
943
- else {
944
  $thumbnail = $img_src_url;
945
  }
946
 
@@ -976,24 +953,24 @@ class Wpvr_Public {
976
 
977
 
978
  $html .= '<div class="wpvr-hotspot-tweak-contents-wrapper" style="display: none">';
979
- $html .= '<i class="fa fa-times cross"></i>';
980
- $html .= '<div class="wpvr-hotspot-tweak-contents-flex">';
981
- $html .= '<div class="wpvr-hotspot-tweak-contents">';
982
- ob_start();
983
- do_action('wpvr_hotspot_tweak_contents', $scene_data);
984
- $hotspot_content = ob_get_clean();
985
- $html .= $hotspot_content;
986
- $html .= '</div>';
987
- $html .= '</div>';
988
  $html .= '</div>';
989
 
990
  $html .= '<div class="custom-ifram-wrapper" style="display: none;">';
991
- $html .= '<i class="fa fa-times cross"></i>';
992
 
993
- $html .= '<div class="custom-ifram-flex">';
994
- $html .= '<div class="custom-ifram">';
995
- $html .= '</div>';
996
- $html .= '</div>';
997
  $html .= '</div>';
998
 
999
  $html .= '</div>';
@@ -1049,7 +1026,7 @@ class Wpvr_Public {
1049
  $html .= 'var response = '.$response.';';
1050
  $html .= 'var scenes = response[1];';
1051
  $html .= 'if(scenes) {';
1052
- $html .= 'var scenedata = scenes.scenes;';
1053
  $html .= 'for(var i in scenedata) {';
1054
  $html .= 'var scenehotspot = scenedata[i].hotSpots;';
1055
  $html .= 'for(var i = 0; i < scenehotspot.length; i++) {';
@@ -1177,30 +1154,57 @@ class Wpvr_Public {
1177
  $angle_down = '<i class="fa fa-angle-down"></i>';
1178
  $sin_qout = "'";
1179
 
1180
- $html .= '
1181
- jQuery(document).ready(function($){
1182
- jQuery("#sccontrols'.$id.'").hide();
1183
- jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1184
- });
1185
- ';
 
1186
 
1187
- $html .= '
1188
- var slide'.$id.' = "down";
1189
- jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1190
 
1191
- if (slide'.$id.' == "up") {
1192
- jQuery(".vrgctrl'.$id.'").empty();
1193
- jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1194
- slide'.$id.' = "down";
1195
- }
1196
- else {
1197
- jQuery(".vrgctrl'.$id.'").empty();
1198
- jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1199
- slide'.$id.' = "up";
1200
- }
1201
- jQuery("#sccontrols'.$id.'").slideToggle();
1202
- });
1203
- ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1204
 
1205
 
1206
 
1
  <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit;
4
+ } // Exit if accessed directly
5
 
6
  /**
7
  * The public-facing functionality of the plugin.
24
  * @author Rextheme <sakib@coderex.co>
25
  */
26
 
27
+ class Wpvr_Public
28
+ {
29
+
30
+ /**
31
+ * The ID of this plugin.
32
+ *
33
+ * @since 1.0.0
34
+ * @access private
35
+ * @var string $plugin_name The ID of this plugin.
36
+ */
37
+ private $plugin_name;
38
+
39
+ /**
40
+ * The version of this plugin.
41
+ *
42
+ * @since 1.0.0
43
+ * @access private
44
+ * @var string $version The current version of this plugin.
45
+ */
46
+ private $version;
47
+
48
+ /**
49
+ * Initialize the class and set its properties.
50
+ *
51
+ * @since 1.0.0
52
+ * @param string $plugin_name The name of the plugin.
53
+ * @param string $version The version of this plugin.
54
+ */
55
+ public function __construct($plugin_name, $version)
56
+ {
57
+ $this->plugin_name = $plugin_name;
58
+ $this->version = $version;
59
+ }
60
+
61
+ /**
62
+ * Register the stylesheets for the public-facing side of the site.
63
+ *
64
+ * @since 1.0.0
65
+ */
66
+ public function enqueue_styles()
67
+ {
68
+
69
+ /**
70
+ * This function is provided for demonstration purposes only.
71
+ *
72
+ * An instance of this class should be passed to the run() function
73
+ * defined in Wpvr_Loader as all of the hooks are defined
74
+ * in that particular class.
75
+ *
76
+ * The Wpvr_Loader will then create the relationship
77
+ * between the defined hooks and the functions defined in this
78
+ * class.
79
+ */
80
+
81
+ global $wp;
82
+ $wpvr_script_control = get_option('wpvr_script_control');
83
+ $wpvr_script_list = get_option('wpvr_script_list');
84
+ $allowed_pages_modified = array();
85
+ $allowed_pages = explode(",", $wpvr_script_list);
86
+ foreach ($allowed_pages as $value) {
87
+ $allowed_pages_modified[] = untrailingslashit($value);
88
+ }
89
+ $current_url = home_url(add_query_arg(array($_GET), $wp->request));
90
+
91
+ if ($wpvr_script_control == 'true') {
92
+ foreach ($allowed_pages_modified as $value) {
93
+ if ($value) {
94
+ if (strpos($current_url, $value) !== false) {
95
+ $fontawesome_disable = get_option('wpvr_fontawesome_disable');
96
+ if ($fontawesome_disable == 'true') {
97
+ } else {
98
+ wp_enqueue_style($this->plugin_name . 'fontawesome', 'https://use.fontawesome.com/releases/v5.7.2/css/all.css', array(), $this->version, 'all');
99
+ }
100
+ wp_enqueue_style('panellium-css', plugin_dir_url(__FILE__) . 'lib/pannellum/src/css/pannellum.css', array(), true);
101
+ wp_enqueue_style('videojs-css', plugin_dir_url(__FILE__) . 'lib/pannellum/src/css/video-js.css', array(), true);
102
+ wp_enqueue_style('owl-css', plugin_dir_url(__FILE__) . 'css/owl.carousel.css', array(), $this->version, 'all');
103
+ wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/wpvr-public.css', array(), $this->version, 'all');
104
+ }
105
+ }
106
+ }
107
+ } else {
108
+ $fontawesome_disable = get_option('wpvr_fontawesome_disable');
109
+ if ($fontawesome_disable == 'true') {
110
+ } else {
111
+ wp_enqueue_style($this->plugin_name . 'fontawesome', 'https://use.fontawesome.com/releases/v5.7.2/css/all.css', array(), $this->version, 'all');
112
+ }
113
+ wp_enqueue_style('panellium-css', plugin_dir_url(__FILE__) . 'lib/pannellum/src/css/pannellum.css', array(), true);
114
+ wp_enqueue_style('videojs-css', plugin_dir_url(__FILE__) . 'lib/pannellum/src/css/video-js.css', array(), true);
115
+ wp_enqueue_style('owl-css', plugin_dir_url(__FILE__) . 'css/owl.carousel.css', array(), $this->version, 'all');
116
+ wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/wpvr-public.css', array(), $this->version, 'all');
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Register the JavaScript for the public-facing side of the site.
122
+ *
123
+ * @since 1.0.0
124
+ */
125
+ public function enqueue_scripts()
126
+ {
127
+
128
+ /**
129
+ * This function is provided for demonstration purposes only.
130
+ *
131
+ * An instance of this class should be passed to the run() function
132
+ * defined in Wpvr_Loader as all of the hooks are defined
133
+ * in that particular class.
134
+ *
135
+ * The Wpvr_Loader will then create the relationship
136
+ * between the defined hooks and the functions defined in this
137
+ * class.
138
+ */
139
+ $notice = '';
140
+ $wpvr_frontend_notice = get_option('wpvr_frontend_notice');
141
+ if ($wpvr_frontend_notice) {
142
+ $notice = get_option('wpvr_frontend_notice_area');
143
+ }
144
+ global $wp;
145
+ $wpvr_script_control = get_option('wpvr_script_control');
146
+ $wpvr_script_list = get_option('wpvr_script_list');
147
+ $allowed_pages_modified = array();
148
+ $allowed_pages = explode(",", $wpvr_script_list);
149
+ foreach ($allowed_pages as $value) {
150
+ $allowed_pages_modified[] = untrailingslashit($value);
151
+ }
152
+ $current_url = home_url(add_query_arg(array($_GET), $wp->request));
153
+
154
+ if ($wpvr_script_control == 'true') {
155
+ foreach ($allowed_pages_modified as $value) {
156
+ if (strpos($current_url, $value) !== false) {
157
+ wp_enqueue_script('panellium-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/pannellum.js', array(), true);
158
+ wp_enqueue_script('panelliumlib-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/libpannellum.js', array(), true);
159
+ wp_enqueue_script('videojs-js', plugin_dir_url(__FILE__) . 'js/video.js', array(), true);
160
+ wp_enqueue_script('panelliumvid-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/videojs-pannellum-plugin.js', array(), true);
161
+ wp_enqueue_script('owl-js', plugin_dir_url(__FILE__) . 'js/owl.carousel.js', array( 'jquery' ), false);
162
+ wp_enqueue_script('jquery_cookie', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js', array('jquery'), true);
163
+ wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wpvr-public.js', array('jquery', 'jquery_cookie' ), $this->version, false);
164
+ wp_localize_script('wpvr', 'wpvr_public', array(
 
 
165
  'notice_active' => $wpvr_frontend_notice ,
166
  'notice' => $notice ,
167
  ));
168
+ }
169
+ }
170
+ } else {
171
+ wp_enqueue_script('panellium-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/pannellum.js', array(), true);
172
+ wp_enqueue_script('panelliumlib-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/libpannellum.js', array(), true);
173
+ wp_enqueue_script('videojs-js', plugin_dir_url(__FILE__) . 'js/video.js', array(), true);
174
+ wp_enqueue_script('panelliumvid-js', plugin_dir_url(__FILE__) . 'lib/pannellum/src/js/videojs-pannellum-plugin.js', array(), true);
175
+ wp_enqueue_script('owl-js', plugin_dir_url(__FILE__) . 'js/owl.carousel.js', array( 'jquery' ), false);
176
+ wp_enqueue_script('jquery_cookie', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js', array('jquery'), true);
177
+ wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wpvr-public.js', array( 'jquery', 'jquery_cookie' ), $this->version, true);
178
+ wp_localize_script('wpvr', 'wpvr_public', array(
 
179
  'notice_active' => $wpvr_frontend_notice ,
180
  'notice' => $notice ,
181
  ));
182
+ }
183
+ }
 
184
 
185
+ /**
186
+ * Init the edit screen of the plugin post type item
187
+ *
188
+ * @since 1.0.0
189
+ */
190
+ public function public_init()
191
+ {
192
+ add_shortcode($this->plugin_name, array( $this , 'wpvr_shortcode'));
193
+ }
194
 
195
 
196
  /**
198
  *
199
  * @since 1.0.0
200
  */
201
+ public function wpvr_shortcode($atts)
202
+ {
203
  extract(
204
  shortcode_atts(
205
  array(
206
  'id' => 0,
207
+ 'width' => null,
208
+ 'height' => null,
209
+ 'radius' => null
210
+ ),
211
+ $atts
212
  )
213
  );
214
 
215
+ if (!$id) {
216
+ $obj = get_page_by_path($slug, OBJECT, $this->post_type);
217
+ if ($obj) {
218
  $id = $obj->ID;
219
  } else {
220
  return __('Invalid Wpvr slug attribute', $this->plugin_name);
221
  }
222
  }
223
 
224
+ $postdata = get_post_meta($id, 'panodata', true);
225
  $panoid = 'pano'.$id;
226
 
227
  if (isset($postdata['streetviewdata'])) {
260
 
261
  if (strpos($videourl, 'youtube') > 0) {
262
  $explodeid = '';
263
+ $explodeid = explode("=", $videourl);
264
  $foundid = '';
265
 
266
  if ($autoplay == 'on') {
267
  $autoplay = '&autoplay=1';
268
  $muted = '&mute=1';
269
+ } else {
 
270
  $autoplay = '';
271
  $muted = '';
272
  }
273
 
274
  if ($loop == 'on') {
275
  $loop = '&loop=1';
276
+ } else {
 
277
  $loop = '';
278
  }
279
 
284
  <iframe src="https://www.youtube.com/embed/'.$explodeid[1].'?rel=0&modestbranding=1'.$loop.'&autohide=1'.$muted.'&showinfo=0&controls=1'.$autoplay.'" width="560" height="315" frameborder="0" allowfullscreen></iframe>
285
  ';
286
  $html .= '</div>';
 
 
287
  } elseif (strpos($videourl, 'vimeo') > 0) {
 
288
  $explodeid = '';
289
+ $explodeid = explode("/", $videourl);
290
  $foundid = '';
291
  if ($autoplay == 'on') {
292
  $autoplay = '&autoplay=1&muted=1';
293
+ } else {
 
294
  $autoplay = '';
295
  }
296
 
297
  if ($loop == 'on') {
298
  $loop = '&loop=1';
299
+ } else {
 
300
  $loop = '';
301
  }
302
  $foundid = $explodeid[3].'?'.$autoplay.$loop;
303
  $html = '';
304
  $html .= '<div style="text-align: center; max-width:100%; width:'.$width.'; height:'.$height.'; margin: 0 auto;">';
305
+ $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.trim($width, 'px').'" height="'.trim($height, 'px').'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
306
  $html .= '</div>';
 
307
  } else {
308
  $html = '';
309
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto;">';
348
  $vrgallery_title = $postdata['vrgallery_title'];
349
  }
350
 
351
+ $vrgallery_display = false;
352
+ if (isset($postdata['vrgallery_display'])) {
353
+ $vrgallery_display = $postdata['vrgallery_display'];
354
+ }
355
+
356
  $gyro = false;
357
  $gyro_orientation = false;
358
  if (isset($postdata['gyro'])) {
437
 
438
  if (!empty($panodata["scene-list"])) {
439
  foreach ($panodata["scene-list"] as $panoscenes) {
 
440
  $scene_ititle = '';
441
  if (isset($panoscenes["scene-ititle"])) {
442
  $scene_ititle = sanitize_text_field($panoscenes["scene-ititle"]);
508
 
509
  if (!empty($default_zoom)) {
510
  $default_zoom = (int)$default_zoom;
511
+ } else {
 
512
  $default_zoom = 100;
513
  }
514
 
519
 
520
  if (!empty($max_zoom)) {
521
  $max_zoom = (int)$max_zoom;
522
+ } else {
 
523
  $max_zoom = 120;
524
  }
525
 
530
 
531
  if (!empty($min_zoom)) {
532
  $min_zoom = (int)$min_zoom;
533
+ } else {
 
534
  $min_zoom = 50;
535
  }
536
  $hotspot_datas = array();
542
 
543
 
544
  foreach ($hotspot_datas as $hotspot_data) {
545
+ $status = get_option('wpvr_edd_license_status');
546
+ if ($status !== false && $status == 'valid') {
 
547
  if (isset($hotspot_data["hotspot-customclass-pro"]) && $hotspot_data["hotspot-customclass-pro"] != 'none') {
548
  $hotspot_data["hotspot-customclass"] = $hotspot_data["hotspot-customclass-pro"];
549
  $hotspoticoncolor = $hotspot_data["hotspot-customclass-color-icon-value"];
568
  do_action('wpvr_hotspot_content', $hotspot_data);
569
  $hotspot_content = ob_get_clean();
570
 
571
+ if (!$hotspot_content) {
572
+ $hotspot_content = $hotspot_data["hotspot-content"];
573
+ }
574
 
575
  $hotspot_info = array(
576
  "text"=>$hotspot_data["hotspot-title"],
599
  array_push($hotspots, $hotspot_info);
600
  }
601
 
602
+ $device_scene = $panoscenes['scene-attachment-url'];
603
+ $mobile_media_resize = get_option('mobile_media_resize');
604
+ $file_accessible = ini_get('allow_url_fopen');
605
+
606
+ if ($mobile_media_resize == "true") {
607
+ if ($file_accessible == "1") {
608
+ $image_info = getimagesize($device_scene);
609
+ if ($image_info[0] > 4096) {
610
+ $src_to_id_for_mobile = '';
611
+ $src_to_id_for_desktop = '';
612
+ if (wpvr_isMobileDevice()) {
613
+ $src_to_id_for_mobile = attachment_url_to_postid($panoscenes['scene-attachment-url']);
614
+ if ($src_to_id_for_mobile) {
615
+ $mobile_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'wpvr_mobile');
616
+ if ($mobile_scene[3]) {
617
+ $device_scene = $mobile_scene[0];
618
+ }
619
+ }
620
+ } else {
621
+ $src_to_id_for_desktop = attachment_url_to_postid($panoscenes['scene-attachment-url']);
622
+ if ($src_to_id_for_desktop) {
623
+ $desktop_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'full');
624
+ if ($desktop_scene[0]) {
625
+ $device_scene = $desktop_scene[0];
626
+ }
627
+ }
628
+ }
629
+ }
630
+ }
631
+ }
 
632
 
633
  $scene_info = array();
634
  $scene_info = array("type"=>$panoscenes["scene-type"],"panorama"=>$device_scene,"pitch"=>$default_scene_pitch,"maxPitch"=>$scene_max_pitch,"minPitch"=>$scene_min_pitch,"maxYaw"=>$scene_max_yaw,"minYaw"=>$scene_min_yaw,"yaw"=>$default_scene_yaw,"hfov"=>$default_zoom,"maxHfov"=>$max_zoom,"minHfov"=>$min_zoom,"title"=>$scene_ititle,"author"=>$scene_author, "authorURL"=>$scene_author_url, "vaov"=>$scene_vaov, "haov"=>$scene_haov, "vOffset"=>$scene_vertical_offset, "hotSpots"=>$hotspots);
739
  $pulse_color = wpvr_hex2rgb($hotspoticoncolor);
740
  $rgb = wpvr_HTMLToRGB($hotspoticoncolor);
741
  $hsl = wpvr_RGBToHSL($rgb);
742
+ if ($hsl->lightness > 200) {
743
  $foreground_color = '#000000';
744
+ } else {
 
745
  $foreground_color = '#fff';
746
  }
747
  $html = '';
748
 
749
  $html .= '<style>';
750
+ if ($width == 'embed') {
751
  $html .= 'body{
752
  overflow: hidden;
753
  }';
 
754
  }
755
  $html .= '#'.$panoid.' div.pnlm-hotspot-base.fas,
756
  #'.$panoid.' div.pnlm-hotspot-base.fab,
783
  }';
784
  }
785
 
786
+ $status = get_option('wpvr_edd_license_status');
787
+ if ($status !== false && $status == 'valid') {
788
  if (!$gyro) {
789
  $html .= '#'.$panoid.' div.pnlm-orientation-button {
790
  display: none;
791
  }';
792
  }
793
+ } else {
 
794
  $html .= '#'.$panoid.' div.pnlm-orientation-button {
795
  display: none;
796
  }';
801
  if (wpvr_isMobileDevice()) {
802
  if ($radius) {
803
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;">';
804
+ } else {
 
805
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center;">';
806
  }
807
+ } else {
 
 
808
  if ($radius) {
809
  $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; border-radius:'.$radius.'; direction:ltr;" >';
810
+ } else {
 
811
  $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'; direction:ltr;" >';
812
  }
 
813
  }
814
+ } elseif ($width == 'embed') {
815
+ if (apply_filters('is_wpvr_embed_addon_premium', false)) {
816
+ $html .= '<div id="pano'.$id.'" class="pano-wrap vrembed" style=" text-align:center; direction:ltr;" >';
817
+ }
818
+ } else {
 
 
 
819
  if ($radius) {
820
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
821
+ } else {
 
822
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'; height: '.$height.'; margin: 0 auto; direction:ltr;">';
823
  }
 
824
  }
825
 
826
  //===company logo===//
845
 
846
  //===Custom Control===//
847
  if (isset($custom_control)) {
848
+ if ($custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
 
849
  $html .= '<div id="zoom-in-out-controls'.$id.'" class="zoom-in-out-controls">';
850
 
851
  if ($custom_control['backToHomeSwitch'] == "on") {
908
  $scene_key = $panoscenes['scene-id'];
909
  if ($vrgallery_title == 'on') {
910
  $scene_key_title = $panoscenes['scene-ititle'];
911
+ // $scene_key_title = $panoscenes['scene-id'];
912
+ } else {
 
913
  $scene_key_title = "";
914
  }
915
  $img_src_url = $panoscenes['scene-attachment-url'];
917
  $thumbnail_array = wp_get_attachment_image_src($src_to_id, 'thumbnail');
918
  if ($thumbnail_array) {
919
  $thumbnail = $thumbnail_array[0];
920
+ } else {
 
921
  $thumbnail = $img_src_url;
922
  }
923
 
953
 
954
 
955
  $html .= '<div class="wpvr-hotspot-tweak-contents-wrapper" style="display: none">';
956
+ $html .= '<i class="fa fa-times cross"></i>';
957
+ $html .= '<div class="wpvr-hotspot-tweak-contents-flex">';
958
+ $html .= '<div class="wpvr-hotspot-tweak-contents">';
959
+ ob_start();
960
+ do_action('wpvr_hotspot_tweak_contents', $scene_data);
961
+ $hotspot_content = ob_get_clean();
962
+ $html .= $hotspot_content;
963
+ $html .= '</div>';
964
+ $html .= '</div>';
965
  $html .= '</div>';
966
 
967
  $html .= '<div class="custom-ifram-wrapper" style="display: none;">';
968
+ $html .= '<i class="fa fa-times cross"></i>';
969
 
970
+ $html .= '<div class="custom-ifram-flex">';
971
+ $html .= '<div class="custom-ifram">';
972
+ $html .= '</div>';
973
+ $html .= '</div>';
974
  $html .= '</div>';
975
 
976
  $html .= '</div>';
1026
  $html .= 'var response = '.$response.';';
1027
  $html .= 'var scenes = response[1];';
1028
  $html .= 'if(scenes) {';
1029
+ $html .= 'var scenedata = scenes.scenes;';
1030
  $html .= 'for(var i in scenedata) {';
1031
  $html .= 'var scenehotspot = scenedata[i].hotSpots;';
1032
  $html .= 'for(var i = 0; i < scenehotspot.length; i++) {';
1154
  $angle_down = '<i class="fa fa-angle-down"></i>';
1155
  $sin_qout = "'";
1156
 
1157
+ if ($vrgallery_display) {
1158
+ $html .= '
1159
+ jQuery(document).ready(function($){
1160
+ jQuery("#sccontrols'.$id.'").show();
1161
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1162
+ });
1163
+ ';
1164
 
1165
+ $html .= '
1166
+ var slide'.$id.' = "down";
1167
+ jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1168
 
1169
+ if (slide'.$id.' == "up") {
1170
+ jQuery(".vrgctrl'.$id.'").empty();
1171
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1172
+ slide'.$id.' = "down";
1173
+ }
1174
+ else {
1175
+ jQuery(".vrgctrl'.$id.'").empty();
1176
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1177
+ slide'.$id.' = "up";
1178
+ }
1179
+ jQuery("#sccontrols'.$id.'").slideToggle();
1180
+ });
1181
+ ';
1182
+ } else {
1183
+ $html .= '
1184
+ jQuery(document).ready(function($){
1185
+ jQuery("#sccontrols'.$id.'").hide();
1186
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1187
+ });
1188
+ ';
1189
+
1190
+ $html .= '
1191
+ var slide'.$id.' = "down";
1192
+ jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1193
+
1194
+ if (slide'.$id.' == "up") {
1195
+ jQuery(".vrgctrl'.$id.'").empty();
1196
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1197
+ slide'.$id.' = "down";
1198
+ }
1199
+ else {
1200
+ jQuery(".vrgctrl'.$id.'").empty();
1201
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1202
+ slide'.$id.' = "up";
1203
+ }
1204
+ jQuery("#sccontrols'.$id.'").slideToggle();
1205
+ });
1206
+ ';
1207
+ }
1208
 
1209
 
1210
 
public/css/owl.carousel.css CHANGED
File without changes
public/js/owl.carousel.js CHANGED
File without changes
public/lib/pannellum/src/css/img/background.svg CHANGED
File without changes
public/lib/pannellum/src/css/img/compass.svg CHANGED
File without changes
public/lib/pannellum/src/css/img/grab.svg CHANGED
File without changes
public/lib/pannellum/src/css/img/grabbing.svg CHANGED
File without changes
public/lib/pannellum/src/css/img/sprites.svg CHANGED
File without changes
public/lib/pannellum/src/css/pannellum.css CHANGED
File without changes
public/lib/pannellum/src/js/libpannellum.js CHANGED
File without changes
public/lib/pannellum/src/js/pannellum.js CHANGED
File without changes
public/lib/pannellum/src/js/videojs-pannellum-plugin.js CHANGED
File without changes
wpvr.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: WP VR
17
  * Plugin URI: https://rextheme.com/wpvr/
18
  * Description: WP VR - 360 Panorama and virtual tour creator for WordPress is a customized panaroma & virtual builder tool for WordPress Website.
19
- * Version: 6.7.0
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
@@ -25,20 +25,20 @@
25
  * Domain Path: /languages
26
  */
27
  // If this file is called directly, abort.
28
- if ( !defined( 'WPINC' ) ) {
29
  die;
30
  }
31
- require plugin_dir_path( __FILE__ ) . 'elementor/elementor.php';
32
  /**
33
  * Currently plugin version.
34
  * Start at version 1.0.0 and use SemVer - https://semver.org
35
  * Rename this for your plugin and update it as you release new versions.
36
  */
37
- define( 'WPVR', '1.0.0' );
38
- define('WPVR_FILE', __FILE__ );
39
- define( "WPVR_PLUGIN_DIR_URL", plugin_dir_url( __FILE__ ) );
40
- define( "WPVR_PLUGIN_PUBLIC_DIR_URL", plugin_dir_url( __FILE__ ) .'public/' );
41
- define('WPVR_BASE', plugin_basename( WPVR_FILE ) );
42
 
43
  /**
44
  * The code that runs during plugin activation.
@@ -46,7 +46,7 @@ define('WPVR_BASE', plugin_basename( WPVR_FILE ) );
46
  */
47
  function activate_wpvr()
48
  {
49
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpvr-activator.php';
50
  Wpvr_Activator::activate();
51
  }
52
 
@@ -56,18 +56,18 @@ function activate_wpvr()
56
  */
57
  function deactivate_wpvr()
58
  {
59
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpvr-deactivator.php';
60
  Wpvr_Deactivator::deactivate();
61
  }
62
 
63
- register_activation_hook( __FILE__, 'activate_wpvr' );
64
- register_deactivation_hook( __FILE__, 'deactivate_wpvr' );
65
  /**
66
  * The core plugin class that is used to define internationalization,
67
  * admin-specific hooks, and public-facing site hooks.
68
  */
69
 
70
- require plugin_dir_path( __FILE__ ) . 'includes/class-wpvr.php';
71
  /**
72
  * Begins execution of the plugin.
73
  *
@@ -87,10 +87,10 @@ run_wpvr();
87
  /**
88
  * array information checker
89
  */
90
- function wpvr_in_array_r( $needle, $haystack, $strict = false )
91
  {
92
- foreach ( $haystack as $item ) {
93
- if ( (( $strict ? $item === $needle : $item == $needle )) || is_array( $item ) && wpvr_in_array_r( $needle, $item, $strict ) ) {
94
  return true;
95
  }
96
  }
@@ -102,33 +102,34 @@ function wpvr_in_array_r( $needle, $haystack, $strict = false )
102
  *
103
  * @return void
104
  */
105
- function appsero_init_tracker_wpvr() {
106
-
107
- if ( ! class_exists( 'Appsero\Client' ) ) {
108
  require_once __DIR__ . '/appsero/src/Client.php';
109
  }
110
 
111
- $client = new Appsero\Client( 'cab9761e-b067-4824-9c71-042df5d58598', 'WP VR', __FILE__ );
112
  $client->insights()->init();
113
  $client->updater();
114
  }
115
 
116
  appsero_init_tracker_wpvr();
117
 
118
- function wpvr_block() {
 
119
  wp_register_script(
120
  'wpvr-block',
121
- plugins_url( 'build/index.build.js', __FILE__ ),
122
  array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' )
123
  );
124
  wp_enqueue_style(
125
- 'gutyblocks/guty-block',
126
- plugins_url( 'src/view.css', __FILE__ ),
127
  array()
128
- );
129
 
130
  if (function_exists('register_block_type')) {
131
- register_block_type( 'wpvr/wpvr-block', array(
132
  'attributes' => array(
133
  'id' => array(
134
  'type' => 'string',
@@ -154,18 +155,17 @@ function wpvr_block() {
154
  ),
155
  'editor_script' => 'wpvr-block',
156
  'render_callback' => 'wpvr_block_render',
157
- ) );
158
  }
159
  }
160
 
161
- add_action( 'init', 'wpvr_block' );
162
-
163
- function wpvr_block_render( $attributes ) {
164
 
 
 
165
  if (isset($attributes['id'])) {
166
  $id = $attributes['id'];
167
- }
168
- else {
169
  $id = 0;
170
  }
171
  if (isset($attributes['width'])) {
@@ -174,29 +174,29 @@ function wpvr_block_render( $attributes ) {
174
  if (isset($attributes['height'])) {
175
  $height = $attributes['height'];
176
  }
177
- if(isset($attributes['radius'])) {
178
- $radius = $attributes['radius'].'px';
179
  }
180
 
181
- $postdata = get_post_meta( $id, 'panodata', true );
182
  $panoid = 'pano'.$id;
183
 
184
  if (isset($postdata['streetviewdata'])) {
185
- if (empty($width)) {
186
- $width = '600px';
187
- }
188
- if (empty($height)) {
189
- $height = '400px';
190
- }
191
- $streetviewurl = $postdata['streetviewurl'];
192
- $html = '';
193
- $html .= '<div class="vr-streetview" style="text-align: center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
194
  $html .= '<iframe src="'.$streetviewurl.'" frameborder="0" style="border:0; width:100px; height:100%;" allowfullscreen=""></iframe>';
195
- $html .= '</div>';
196
 
197
 
198
 
199
- return $html;
200
  }
201
 
202
  if (isset($postdata['vidid'])) {
@@ -211,77 +211,72 @@ function wpvr_block_render( $attributes ) {
211
  $videourl = $postdata['vidurl'];
212
  $autoplay = 'off';
213
  if (isset($postdata['autoplay'])) {
214
- $autoplay = $postdata['autoplay'];
215
  }
216
  $loop = 'off';
217
  if (isset($postdata['loop'])) {
218
- $loop = $postdata['loop'];
219
  }
220
 
221
  if (strpos($videourl, 'youtube') > 0) {
222
- $explodeid = '';
223
- $explodeid = explode("=",$videourl);
224
- $foundid = '';
225
-
226
- if ($autoplay == 'on') {
227
- $autoplay = '&autoplay=1';
228
- $muted = '&mute=1';
229
- }
230
- else {
231
- $autoplay = '';
232
- $muted = '';
233
- }
234
-
235
- if ($loop == 'on') {
236
- $loop = '&loop=1';
237
- }
238
- else {
239
- $loop = '';
240
- }
241
-
242
- $foundid = $explodeid[1].'?'.$autoplay.$loop;
243
- $html = '';
244
- $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
245
- $html .= '
246
  <iframe src="https://www.youtube.com/embed/'.$explodeid[1].'?rel=0&modestbranding=1'.$loop.'&autohide=1'.$muted.'&showinfo=0&controls=1'.$autoplay.'" width="560" height="315" frameborder="0" allowfullscreen></iframe>
247
  ';
248
- $html .= '</div>';
249
  } elseif (strpos($videourl, 'vimeo') > 0) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
 
251
- $explodeid = '';
252
- $explodeid = explode("/",$videourl);
253
- $foundid = '';
254
-
255
- if ($autoplay == 'on') {
256
- $autoplay = '&autoplay=1&muted=1';
257
- }
258
- else {
259
- $autoplay = '';
260
- }
261
-
262
- if ($loop == 'on') {
263
- $loop = '&loop=1';
264
- }
265
- else {
266
- $loop = '';
267
- }
268
-
269
- $foundid = $explodeid[3].'?'.$autoplay.$loop;
270
- $html = '';
271
- $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
272
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.$width.'" height="'.$height.'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
273
- $html .='</div>';
274
  } else {
275
  $html = '';
276
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width:'.$width.'px; height: '.$height.'px; margin: 0 auto;">';
277
- $html .= '<div style="width:100%; height:100%; ">'.$postdata['panoviddata'].'</div>';
278
- $html .= '<script>';
279
- $html .= 'videojs('.$postdata['vidid'].', {';
280
- $html .= 'plugins: {';
281
- $html .= 'pannellum: {}';
282
- $html .= '}';
283
- $html .= '});';
284
- $html .= '</script>';
285
  $html .= '</div>';
286
  }
287
  return $html;
@@ -293,61 +288,66 @@ function wpvr_block_render( $attributes ) {
293
  }
294
 
295
  if ($control) {
296
- if (isset($postdata['customcontrol'])) {
297
- $custom_control = $postdata['customcontrol'];
298
- if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
299
- $control = false;
 
300
  }
301
- }
302
  }
303
 
304
  $vrgallery = false;
305
  if (isset($postdata['vrgallery'])) {
306
- $vrgallery = $postdata['vrgallery'];
307
  }
308
 
309
  $vrgallery_title = false;
310
  if (isset($postdata['vrgallery_title'])) {
311
- $vrgallery_title = $postdata['vrgallery_title'];
 
 
 
 
 
312
  }
313
 
314
  $gyro = false;
315
  $gyro_orientation = false;
316
  if (isset($postdata['gyro'])) {
317
- $gyro = $postdata['gyro'];
318
- if (isset($postdata['deviceorientationcontrol'])) {
319
- $gyro_orientation = $postdata['deviceorientationcontrol'];
320
- }
321
  }
322
 
323
  $compass = false;
324
  $audio_right = "5px";
325
  if (isset($postdata['compass'])) {
326
- $compass = $postdata['compass'];
327
- if ($compass) {
328
- $audio_right = "60px";
329
- }
330
  }
331
 
332
  $mouseZoom = true;
333
  if (isset($postdata['mouseZoom'])) {
334
- $mouseZoom = $postdata['mouseZoom'];
335
  }
336
 
337
  $draggable = true;
338
  if (isset($postdata['draggable'])) {
339
- $draggable = $postdata['draggable'];
340
  }
341
 
342
  $diskeyboard = false;
343
  if (isset($postdata['diskeyboard'])) {
344
- $diskeyboard = $postdata['diskeyboard'];
345
  }
346
 
347
  $keyboardzoom = true;
348
- if (isset($postdata['keyboardzoom'])) {
349
- $keyboardzoom = $postdata['keyboardzoom'];
350
- }
351
 
352
  $autoload = false;
353
 
@@ -362,20 +362,20 @@ function wpvr_block_render( $attributes ) {
362
 
363
  $preview = '';
364
  if (isset($postdata['preview'])) {
365
- $preview = $postdata['preview'];
366
  }
367
 
368
  $autorotation = '';
369
  if (isset($postdata["autoRotate"])) {
370
- $autorotation = $postdata["autoRotate"];
371
  }
372
  $autorotationinactivedelay = '';
373
  if (isset($postdata["autoRotateInactivityDelay"])) {
374
- $autorotationinactivedelay = $postdata["autoRotateInactivityDelay"];
375
  }
376
  $autorotationstopdelay = '';
377
  if (isset($postdata["autoRotateStopDelay"])) {
378
- $autorotationstopdelay = $postdata["autoRotateStopDelay"];
379
  }
380
 
381
  $scene_fade_duration = '';
@@ -389,112 +389,107 @@ function wpvr_block_render( $attributes ) {
389
  }
390
  $hotspoticoncolor = '#00b4ff';
391
  $hotspotblink = 'on';
392
- $default_data = array();
393
- $default_data = array('firstScene'=>$default_scene, 'sceneFadeDuration'=>$scene_fade_duration);
394
- $scene_data = array();
395
-
396
- if (!empty($panodata['scene-list'])) {
397
- foreach ($panodata['scene-list'] as $panoscenes) {
398
-
399
 
 
 
400
  $scene_ititle = '';
401
  if (isset($panoscenes["scene-ititle"])) {
402
- $scene_ititle = sanitize_text_field($panoscenes["scene-ititle"]);
403
  }
404
 
405
  $scene_author = '';
406
  if (isset($panoscenes["scene-author"])) {
407
- $scene_author = sanitize_text_field($panoscenes["scene-author"]);
408
  }
409
 
410
  $scene_author_url = '';
411
  if (isset($panoscenes["scene-author-url"])) {
412
- $scene_author_url = sanitize_text_field($panoscenes["scene-author-url"]);
413
  }
414
 
415
  $scene_vaov = 180;
416
  if (isset($panoscenes["scene-vaov"])) {
417
- $scene_vaov = (float)$panoscenes["scene-vaov"];
418
  }
419
 
420
  $scene_haov = 360;
421
  if (isset($panoscenes["scene-haov"])) {
422
- $scene_haov = (float)$panoscenes["scene-haov"];
423
  }
424
 
425
 
426
  $scene_vertical_offset = 0;
427
  if (isset($panoscenes["scene-vertical-offset"])) {
428
- $scene_vertical_offset = (float)$panoscenes["scene-vertical-offset"];
429
  }
430
 
431
  $default_scene_pitch = null;
432
  if (isset($panoscenes["scene-pitch"])) {
433
- $default_scene_pitch = (float)$panoscenes["scene-pitch"];
434
  }
435
 
436
  $default_scene_yaw = null;
437
  if (isset($panoscenes["scene-yaw"])) {
438
- $default_scene_yaw = (float)$panoscenes["scene-yaw"];
439
  }
440
 
441
  $scene_max_pitch = '';
442
  if (isset($panoscenes["scene-maxpitch"])) {
443
- $scene_max_pitch = (float)$panoscenes["scene-maxpitch"];
444
  }
445
 
446
 
447
  $scene_min_pitch = '';
448
  if (isset($panoscenes["scene-minpitch"])) {
449
- $scene_min_pitch = (float)$panoscenes["scene-minpitch"];
450
  }
451
 
452
 
453
  $scene_max_yaw = '';
454
  if (isset($panoscenes["scene-maxyaw"])) {
455
- $scene_max_yaw = (float)$panoscenes["scene-maxyaw"];
456
  }
457
 
458
 
459
  $scene_min_yaw = '';
460
  if (isset($panoscenes["scene-minyaw"])) {
461
- $scene_min_yaw = (float)$panoscenes["scene-minyaw"];
462
  }
463
 
464
  $default_zoom = 100;
465
  if (isset($panoscenes["scene-zoom"])) {
466
- $default_zoom = $panoscenes["scene-zoom"];
467
  }
468
 
469
  if (!empty($default_zoom)) {
470
- $default_zoom = (int)$default_zoom;
471
- }
472
- else {
473
- $default_zoom = 100;
474
  }
475
 
476
  $max_zoom = 120;
477
  if (isset($panoscenes["scene-maxzoom"])) {
478
- $max_zoom = $panoscenes["scene-maxzoom"];
479
  }
480
 
481
  if (!empty($max_zoom)) {
482
- $max_zoom = (int)$max_zoom;
483
- }
484
- else {
485
- $max_zoom = 120;
486
  }
487
 
488
  $min_zoom = 50;
489
  if (isset($panoscenes["scene-minzoom"])) {
490
- $min_zoom = $panoscenes["scene-minzoom"];
491
  }
492
 
493
  if (!empty($min_zoom)) {
494
- $min_zoom = (int)$min_zoom;
495
- }
496
- else {
497
- $min_zoom = 50;
498
  }
499
 
500
  $hotspot_datas = array();
@@ -505,24 +500,24 @@ function wpvr_block_render( $attributes ) {
505
  $hotspots = array();
506
 
507
  foreach ($hotspot_datas as $hotspot_data) {
508
- $status = get_option( 'wpvr_edd_license_status' );
509
- if( $status !== false && $status == 'valid' ) {
510
  if (isset($hotspot_data["hotspot-customclass-pro"]) && $hotspot_data["hotspot-customclass-pro"] != 'none') {
511
- $hotspot_data["hotspot-customclass"] = $hotspot_data["hotspot-customclass-pro"];
512
- $hotspoticoncolor = $hotspot_data["hotspot-customclass-color-icon-value"];
513
  }
514
  if (isset($hotspot_data['hotspot-blink'])) {
515
- $hotspotblink = $hotspot_data['hotspot-blink'];
516
  }
517
  }
518
- $hotspot_scene_pitch = '';
519
- if (isset($hotspot_data["hotspot-scene-pitch"])) {
520
- $hotspot_scene_pitch = $hotspot_data["hotspot-scene-pitch"];
521
- }
522
- $hotspot_scene_yaw = '';
523
- if (isset($hotspot_data["hotspot-scene-yaw"])) {
524
- $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
525
- }
526
 
527
  $hotspot_type = $hotspot_data["hotspot-type"] !== 'scene' ? 'info' : $hotspot_data["hotspot-type"];
528
  $hotspot_content = '';
@@ -531,9 +526,11 @@ function wpvr_block_render( $attributes ) {
531
  do_action('wpvr_hotspot_content', $hotspot_data);
532
  $hotspot_content = ob_get_clean();
533
 
534
- if(!$hotspot_content) $hotspot_content = $hotspot_data["hotspot-content"];
 
 
535
 
536
- $hotspot_info = array(
537
  'text'=>$hotspot_data['hotspot-title'],
538
  'pitch'=>$hotspot_data['hotspot-pitch'],
539
  'yaw'=>$hotspot_data['hotspot-yaw'],
@@ -549,14 +546,14 @@ function wpvr_block_render( $attributes ) {
549
 
550
  $hotspot_info['URL'] = ($hotspot_data['hotspot-type'] === 'fluent_form' || $hotspot_data['hotspot-type'] === 'wc_product') ? '' : $hotspot_info['URL'];
551
 
552
- if ($hotspot_data["hotspot-customclass"] == 'none' || $hotspot_data["hotspot-customclass"] == '') {
553
- unset($hotspot_info["cssClass"]);
554
- }
555
- if (empty($hotspot_data["hotspot-scene"])) {
556
- unset($hotspot_info['targetPitch']);
557
- unset($hotspot_info['targetYaw']);
558
- }
559
- array_push($hotspots, $hotspot_info);
560
  }
561
 
562
  $device_scene = $panoscenes['scene-attachment-url'];
@@ -564,98 +561,97 @@ function wpvr_block_render( $attributes ) {
564
  $file_accessible = ini_get('allow_url_fopen');
565
 
566
  if ($mobile_media_resize == "true") {
567
- if ($file_accessible == "1") {
568
- $image_info = getimagesize($device_scene);
569
- if ($image_info[0] > 4096) {
570
- $src_to_id_for_mobile = '';
571
- $src_to_id_for_desktop = '';
572
- if (wpvr_isMobileDevice()) {
573
- $src_to_id_for_mobile = attachment_url_to_postid($panoscenes['scene-attachment-url']);
574
- if ($src_to_id_for_mobile) {
575
- $mobile_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'wpvr_mobile');
576
- if ($mobile_scene[3]) {
577
- $device_scene = $mobile_scene[0];
578
- }
579
- }
580
- }
581
- else {
582
- $src_to_id_for_desktop = attachment_url_to_postid($panoscenes['scene-attachment-url']);
583
- if ($src_to_id_for_desktop) {
584
- $desktop_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'full');
585
- if ($desktop_scene[0]) {
586
- $device_scene = $desktop_scene[0];
587
- }
588
- }
589
- }
590
  }
591
- }
592
  }
593
 
594
  $scene_info = array();
595
  $scene_info = array('type'=>$panoscenes['scene-type'],'panorama'=>$device_scene,"pitch"=>$default_scene_pitch,"maxPitch"=>$scene_max_pitch,"minPitch"=>$scene_min_pitch,"maxYaw"=>$scene_max_yaw,"minYaw"=>$scene_min_yaw,"yaw"=>$default_scene_yaw,"hfov"=>$default_zoom,"maxHfov"=>$max_zoom,"minHfov"=>$min_zoom,"title"=>$scene_ititle,"author"=>$scene_author, "authorURL"=>$scene_author_url, "vaov"=>$scene_vaov, "haov"=>$scene_haov, "vOffset"=>$scene_vertical_offset, 'hotSpots'=>$hotspots);
596
 
597
  if (isset($panoscenes["ptyscene"])) {
598
- if ($panoscenes["ptyscene"] == "off") {
599
- unset($scene_info['pitch']);
600
- unset($scene_info['yaw']);
601
- }
602
  }
603
 
604
  if (empty($panoscenes["scene-ititle"])) {
605
- unset($scene_info['title']);
606
  }
607
  if (empty($panoscenes["scene-author"])) {
608
- unset($scene_info['author']);
609
  }
610
  if (empty($panoscenes["scene-author-url"])) {
611
- unset($scene_info['authorURL']);
612
  }
613
 
614
  if (empty($scene_vaov)) {
615
- unset($scene_info['vaov']);
616
  }
617
 
618
  if (empty($scene_haov)) {
619
- unset($scene_info['haov']);
620
  }
621
 
622
  if (empty($scene_vertical_offset)) {
623
- unset($scene_info['vOffset']);
624
  }
625
 
626
  if (isset($panoscenes["cvgscene"])) {
627
- if ($panoscenes["cvgscene"] == "off") {
628
- unset($scene_info['maxPitch']);
629
- unset($scene_info['minPitch']);
630
- }
631
  }
632
  if (empty($panoscenes["scene-maxpitch"])) {
633
- unset($scene_info['maxPitch']);
634
  }
635
 
636
  if (empty($panoscenes["scene-minpitch"])) {
637
- unset($scene_info['minPitch']);
638
  }
639
 
640
  if (isset($panoscenes["chgscene"])) {
641
- if ($panoscenes["chgscene"] == "off") {
642
- unset($scene_info['maxYaw']);
643
- unset($scene_info['minYaw']);
644
- }
645
  }
646
  if (empty($panoscenes["scene-maxyaw"])) {
647
- unset($scene_info['maxYaw']);
648
  }
649
 
650
  if (empty($panoscenes["scene-minyaw"])) {
651
- unset($scene_info['minYaw']);
652
  }
653
 
654
  if (isset($panoscenes["czscene"])) {
655
- if ($panoscenes["czscene"] == "off") {
656
- unset($scene_info['hfov']);
657
- unset($scene_info['maxHfov']);
658
- unset($scene_info['minHfov']);
659
  }
660
  }
661
 
@@ -665,27 +661,27 @@ function wpvr_block_render( $attributes ) {
665
  );
666
  $scene_data[$panoscenes['scene-id']] = $scene_info;
667
  }
668
- }
669
-
670
- $pano_id_array = array();
671
- $pano_id_array = array('panoid'=>$panoid);
672
- $pano_response = array();
673
- $pano_response = array('autoLoad'=>$autoload,'showControls'=>$control,'compass'=>$compass,'orientationOnByDefault'=>$gyro_orientation,'mouseZoom'=>$mouseZoom,'draggable'=>$draggable,'disableKeyboardCtrl'=>$diskeyboard,'keyboardZoom'=>$keyboardzoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,'default'=>$default_data,'scenes'=>$scene_data);
674
- if (empty($autorotation)) {
675
- unset($pano_response['autoRotate']);
676
- unset($pano_response['autoRotateInactivityDelay']);
677
- unset($pano_response['autoRotateStopDelay']);
678
- }
679
- if (empty($autorotationinactivedelay)) {
680
- unset($pano_response['autoRotateInactivityDelay']);
681
- }
682
- if (empty($autorotationstopdelay)) {
683
- unset($pano_response['autoRotateStopDelay']);
684
- }
685
-
686
- $response = array();
687
- $response = array($pano_id_array,$pano_response);
688
- if (!empty($response)) {
689
  $response = json_encode($response);
690
  }
691
  if (empty($width)) {
@@ -696,27 +692,25 @@ function wpvr_block_render( $attributes ) {
696
  }
697
 
698
  $foreground_color = '#fff';
699
- $pulse_color = wpvr_hex2rgb($hotspoticoncolor);
700
- $rgb = wpvr_HTMLToRGB($hotspoticoncolor);
701
- $hsl = wpvr_RGBToHSL($rgb);
702
- if($hsl->lightness > 200) {
703
- $foreground_color = '#000000';
704
- }
705
- else {
706
- $foreground_color = '#fff';
707
- }
708
 
709
  $class = 'myclass';
710
  $html = 'test';
711
  $html = '';
712
  $html .= '<style>';
713
- if ($width == 'embed'){
714
  $html .= 'body{
715
  overflow: hidden;
716
  }';
717
-
718
- }
719
- $html .= '#'.$panoid.' div.pnlm-hotspot-base.fas,
720
  #'.$panoid.' div.pnlm-hotspot-base.fab,
721
  #'.$panoid.' div.pnlm-hotspot-base.fa,
722
  #'.$panoid.' div.pnlm-hotspot-base.far {
@@ -730,8 +724,8 @@ function wpvr_block_render( $attributes ) {
730
  line-height: 30px;
731
  animation: icon-pulse'.$panoid.' 1.5s infinite cubic-bezier(.25, 0, 0, 1);
732
  }';
733
- if ($hotspotblink == 'on') {
734
- $html .= '@-webkit-keyframes icon-pulse'.$panoid.' {
735
  0% {
736
  box-shadow: 0 0 0 0px rgba('.$pulse_color[0].', 1);
737
  }
@@ -747,159 +741,153 @@ function wpvr_block_render( $attributes ) {
747
  box-shadow: 0 0 0 10px rgba('.$pulse_color[0].', 0);
748
  }
749
  }';
750
- }
751
 
752
- $status = get_option( 'wpvr_edd_license_status' );
753
- if( $status !== false && $status == 'valid' ) {
754
- if (!$gyro) {
755
- $html .= '#'.$panoid.' div.pnlm-orientation-button {
756
  display: none;
757
  }';
758
- }
759
- }
760
- else {
761
- $html .= '#'.$panoid.' div.pnlm-orientation-button {
762
  display: none;
763
  }';
764
- }
765
 
766
- $html .= '</style>';
767
 
768
  if ($width == 'fullwidth') {
769
- if (wpvr_isMobileDevice()) {
770
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;" >';
771
- }
772
- else {
773
- $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'px; border-radius:'.$radius.'; direction:ltr;" >';
774
- }
775
- }
776
- else {
777
- $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'px; height: '.$height.'px; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
778
  }
779
 
780
  //===company logo===//
781
- if (isset($postdata['cpLogoSwitch'])) {
782
  $cpLogoImg = $postdata['cpLogoImg'];
783
  $cpLogoContent = $postdata['cpLogoContent'];
784
  if ($postdata['cpLogoSwitch'] == 'on') {
785
- $html .= '<div id="cp-logo-controls">';
786
  $html .= '<div class="cp-logo-ctrl" id="cp-logo">';
787
  if ($cpLogoImg) {
788
- $html .= '<img src="'.$cpLogoImg.'" alt="Company Logo">';
789
  }
790
 
791
  if ($cpLogoContent) {
792
- $html .= '<div class="cp-info">'.$cpLogoContent.'</div>';
793
  }
794
  $html .= '</div>';
795
- $html .= '</div>';
796
  }
797
- }
798
  //===company logo ends===//
799
 
800
  //===Custom Control===//
801
  if (isset($custom_control)) {
802
- if ( $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
 
803
 
804
- $html .= '<div id="zoom-in-out-controls'.$id.'" class="zoom-in-out-controls">';
 
 
805
 
806
- if ($custom_control['backToHomeSwitch'] == "on") {
807
- $html .= '<div class="ctrl" id="backToHome'.$id.'"><i class="'.$custom_control['backToHomeIcon'].'" style="color:'.$custom_control['backToHomeColor'].';"></i></div>';
808
- }
809
 
810
- if ($custom_control['panZoomInSwitch'] == "on") {
811
- $html .= '<div class="ctrl" id="zoom-in'.$id.'"><i class="'.$custom_control['panZoomInIcon'].'" style="color:'.$custom_control['panZoomInColor'].';"></i></div>';
812
- }
813
 
814
- if ($custom_control['panZoomOutSwitch'] == "on") {
815
- $html .= '<div class="ctrl" id="zoom-out'.$id.'"><i class="'.$custom_control['panZoomOutIcon'].'" style="color:'.$custom_control['panZoomOutColor'].';"></i></div>';
816
- }
817
 
818
- if ($custom_control['gyroscopeSwitch'] == "on") {
819
- $html .= '<div class="ctrl" id="gyroscope'.$id.'"><i class="'.$custom_control['gyroscopeIcon'].'" style="color:'.$custom_control['gyroscopeColor'].';"></i></div>';
820
  }
821
-
822
- $html .= '</div>';
823
- }
824
  //===zoom in out Control===//
825
 
826
- if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on") {
827
 
828
  //===Custom Control===//
829
- $html .= '<div class="controls" id="controls'.$id.'">';
830
 
831
- if ($custom_control['panupSwitch'] == "on") {
832
- $html .= '<div class="ctrl pan-up" id="pan-up'.$id.'"><i class="'.$custom_control['panupIcon'].'" style="color:'.$custom_control['panupColor'].';"></i></div>';
833
- }
834
 
835
- if ($custom_control['panDownSwitch'] == "on") {
836
- $html .= '<div class="ctrl pan-down" id="pan-down'.$id.'"><i class="'.$custom_control['panDownIcon'].'" style="color:'.$custom_control['panDownColor'].';"></i></div>';
837
- }
838
 
839
- if ($custom_control['panLeftSwitch'] == "on") {
840
- $html .= '<div class="ctrl pan-left" id="pan-left'.$id.'"><i class="'.$custom_control['panLeftIcon'].'" style="color:'.$custom_control['panLeftColor'].';"></i></div>';
841
- }
842
 
843
- if ($custom_control['panRightSwitch'] == "on") {
844
- $html .= '<div class="ctrl pan-right" id="pan-right'.$id.'"><i class="'.$custom_control['panRightIcon'].'" style="color:'.$custom_control['panRightColor'].';"></i></div>';
845
- }
846
 
847
- if ($custom_control['panFullscreenSwitch'] == "on") {
848
- $html .= '<div class="ctrl fullscreen" id="fullscreen'.$id.'"><i class="'.$custom_control['panFullscreenIcon'].'" style="color:'.$custom_control['panFullscreenColor'].';"></i></div>';
 
 
849
  }
850
- $html .= '</div>';
851
- }
852
  }
853
  //===Custom Control===//
854
 
855
- if ($vrgallery) {
856
- //===Carousal setup===//
857
- $html .= '<div id="vrgcontrols'.$id.'" class="vrgcontrols">';
858
 
859
- $html .= '<div class="vrgctrl'.$id.' vrbounce">';
860
- $html .= '</div>';
861
- $html .= '</div>';
862
 
863
- $html .= '<div id="sccontrols'.$id.'" class="scene-gallery vrowl-carousel owl-theme">';
864
- if (isset($panodata["scene-list"])) {
865
- foreach ($panodata["scene-list"] as $panoscenes) {
866
  $scene_key = $panoscenes['scene-id'];
867
  if ($vrgallery_title == 'on') {
868
- $scene_key_title = $panoscenes['scene-ititle'];
869
- // $scene_key_title = $panoscenes['scene-id'];
870
- }
871
- else {
872
- $scene_key_title = "";
873
  }
874
  $img_src_url = $panoscenes['scene-attachment-url'];
875
 
876
  $src_to_id = attachment_url_to_postid($img_src_url);
877
  $thumbnail_array = wp_get_attachment_image_src($src_to_id, 'thumbnail');
878
  if ($thumbnail_array) {
879
- $thumbnail = $thumbnail_array[0];
880
- }
881
- else {
882
- $thumbnail = $img_src_url;
883
  }
884
 
885
  $html .= '<ul style="width:150px;"><li title="Double click to view scene">'.$scene_key_title.'<img class="scctrl" id="'.$scene_key.'_gallery_'.$id.'" src="'.$thumbnail.'"></li></ul>';
886
- }
887
  }
888
- $html .= '</div>';
889
- //===Carousal setup end===//
 
 
 
 
 
 
 
 
 
 
 
890
  }
891
 
892
- if (isset($postdata['bg_music'])) {
893
- $bg_music = $postdata['bg_music'];
894
- $bg_music_url = $postdata['bg_music_url'];
895
- $autoplay_bg_music = $postdata['autoplay_bg_music'];
896
- $loop_bg_music = $postdata['loop_bg_music'];
897
- $bg_loop = '';
898
- if ($loop_bg_music == 'on') {
899
- $bg_loop = 'loop';
900
- }
901
-
902
- if ($bg_music == 'on') {
903
  $html .= '<div id="adcontrol'.$id.'" class="adcontrol" style="right:'.$audio_right.'">';
904
  $html .= '<audio id="vrAudio'.$id.'" onended="audionEnd'.$id.'()" '.$bg_loop.'>
905
  <source src="'.$bg_music_url.'" type="audio/mpeg">
@@ -908,29 +896,29 @@ function wpvr_block_render( $attributes ) {
908
  <button onclick="playPause'.$id.'()" class="ctrl audio_control" id="audio_control'.$id.'"><i id="vr-volume'.$id.'" class="fas fa-volume-up" style="color:#fff;"></i></button>
909
  ';
910
  $html .= '</div>';
911
- }
912
  }
 
913
 
914
 
915
- $html .= '<div class="wpvr-hotspot-tweak-contents-wrapper" style="display: none">';
916
- $html .= '<i class="fa fa-times cross"></i>';
917
- $html .= '<div class="wpvr-hotspot-tweak-contents-flex">';
918
- $html .= '<div class="wpvr-hotspot-tweak-contents">';
919
- ob_start();
920
- do_action('wpvr_hotspot_tweak_contents', $scene_data);
921
- $hotspot_content = ob_get_clean();
922
- $html .= $hotspot_content;
923
- $html .= '</div>';
924
- $html .= '</div>';
925
- $html .= '</div>';
926
 
927
- $html .= '<div class="custom-ifram-wrapper" style="display: none;">';
928
- $html .= '<i class="fa fa-times cross"></i>';
929
- $html .= '<div class="custom-ifram-flex">';
930
- $html .= '<div class="custom-ifram">';
931
- $html .= '</div>';
932
- $html .= '</div>';
933
- $html .= '</div>';
934
  $html .= '</div>';
935
 
936
  //script started
@@ -980,25 +968,25 @@ function wpvr_block_render( $attributes ) {
980
  }
981
  }
982
  $html .= 'jQuery(document).ready(function() {';
983
- $html .= 'var response = '.$response.';';
984
- $html .= 'var scenes = response[1];';
985
- $html .= 'if(scenes) {';
986
- $html .= 'var scenedata = scenes.scenes;';
987
- $html .= 'for(var i in scenedata) {';
988
- $html .= 'var scenehotspot = scenedata[i].hotSpots;';
989
- $html .= 'for(var i = 0; i < scenehotspot.length; i++) {';
990
- $html .= 'if(scenehotspot[i]["clickHandlerArgs"] != "") {';
991
- $html .= 'scenehotspot[i]["clickHandlerFunc"] = wpvrhotspot;';
992
- $html .= '}';
993
- $html .= 'if(scenehotspot[i]["createTooltipArgs"] != "") {';
994
- $html .= 'scenehotspot[i]["createTooltipFunc"] = wpvrtooltip;';
995
- $html .= '}';
996
- $html .= '}';
997
- $html .= '}';
998
- $html .= '}';
999
- $html .= 'var panoshow'.$id.' = pannellum.viewer(response[0]["panoid"], scenes);';
1000
-
1001
- $html .= 'panoshow'.$id.'.on("load", function (){
1002
  if (jQuery("#pano'.$id.'").children().children(".pnlm-panorama-info:visible").length > 0) {
1003
  jQuery("#controls'.$id.'").css("bottom", "55px");
1004
  }
@@ -1008,7 +996,7 @@ function wpvr_block_render( $attributes ) {
1008
  });';
1009
 
1010
 
1011
- $html .= '
1012
  if (scenes.autoRotate) {
1013
  panoshow'.$id.'.on("load", function (){
1014
  setTimeout(function(){ panoshow'.$id.'.startAutoRotate(scenes.autoRotate, 0); }, 3000);
@@ -1018,82 +1006,82 @@ function wpvr_block_render( $attributes ) {
1018
  });
1019
  }
1020
  ';
1021
- $html .= 'var touchtime = 0;';
1022
- if ($vrgallery) {
1023
- if (isset($panodata["scene-list"])) {
1024
  foreach ($panodata["scene-list"] as $panoscenes) {
1025
- $scene_key = $panoscenes['scene-id'];
1026
- $scene_key_gallery = $panoscenes['scene-id'].'_gallery_'.$id;
1027
- $img_src_url = $panoscenes['scene-attachment-url'];
1028
- $html .= 'document.getElementById("'.$scene_key_gallery.'").addEventListener("click", function(e) { ';
1029
  $html .= 'if (touchtime == 0) {';
1030
- $html .= 'touchtime = new Date().getTime();';
1031
  $html .= '} else {';
1032
- $html .= 'if (((new Date().getTime()) - touchtime) < 800) {';
1033
- $html .= 'panoshow'.$id.'.loadScene("'.$scene_key.'");';
1034
- $html .= 'touchtime = 0;';
1035
- $html .= '} else {';
1036
- $html .= 'touchtime = new Date().getTime();';
1037
- $html .= '}';
1038
  $html .= '}';
1039
- $html .= '});';
1040
  }
1041
- }
1042
  }
 
1043
 
1044
- //===Custom Control===//
1045
- if (isset($custom_control)) {
1046
- if ($custom_control['panupSwitch'] == "on") {
1047
  $html .= 'document.getElementById("pan-up'.$id.'").addEventListener("click", function(e) {';
1048
- $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() + 10);';
1049
  $html .= '});';
1050
- }
1051
 
1052
- if ($custom_control['panDownSwitch'] == "on") {
1053
  $html .= 'document.getElementById("pan-down'.$id.'").addEventListener("click", function(e) {';
1054
- $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() - 10);';
1055
  $html .= '});';
1056
- }
1057
 
1058
- if ($custom_control['panLeftSwitch'] == "on") {
1059
  $html .= 'document.getElementById("pan-left'.$id.'").addEventListener("click", function(e) {';
1060
- $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() - 10);';
1061
  $html .= '});';
1062
- }
1063
 
1064
- if ($custom_control['panRightSwitch'] == "on") {
1065
  $html .= 'document.getElementById("pan-right'.$id.'").addEventListener("click", function(e) {';
1066
- $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() + 10);';
1067
  $html .= '});';
1068
- }
1069
 
1070
- if ($custom_control['panZoomInSwitch'] == "on") {
1071
  $html .= 'document.getElementById("zoom-in'.$id.'").addEventListener("click", function(e) {';
1072
- $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() - 10);';
1073
  $html .= '});';
1074
- }
1075
 
1076
- if ($custom_control['panZoomOutSwitch'] == "on") {
1077
  $html .= 'document.getElementById("zoom-out'.$id.'").addEventListener("click", function(e) {';
1078
- $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() + 10);';
1079
  $html .= '});';
1080
- }
1081
 
1082
- if ($custom_control['panFullscreenSwitch'] == "on") {
1083
  $html .= 'document.getElementById("fullscreen'.$id.'").addEventListener("click", function(e) {';
1084
- $html .= 'panoshow'.$id.'.toggleFullscreen();';
1085
  $html .= '});';
1086
- }
1087
 
1088
- if ($custom_control['backToHomeSwitch'] == "on") {
1089
  $html .= 'document.getElementById("backToHome'.$id.'").addEventListener("click", function(e) {';
1090
- $html .= 'panoshow'.$id.'.loadScene("'.$default_scene.'");';
1091
  $html .= '});';
1092
- }
1093
 
1094
- if ($custom_control['gyroscopeSwitch'] == "on") {
1095
  $html .= 'document.getElementById("gyroscope'.$id.'").addEventListener("click", function(e) {';
1096
- $html .= '
1097
  if (panoshow'.$id.'.isOrientationActive()) {
1098
  panoshow'.$id.'.stopOrientation();
1099
  }
@@ -1103,41 +1091,67 @@ function wpvr_block_render( $attributes ) {
1103
 
1104
  ';
1105
  $html .= '});';
1106
- }
1107
-
1108
  }
 
1109
 
1110
- $angle_up = '<i class="fa fa-angle-up"></i>';
1111
- $angle_down = '<i class="fa fa-angle-down"></i>';
1112
- $sin_qout = "'";
1113
 
 
1114
  $html .= '
1115
- jQuery(document).ready(function($){
1116
- jQuery("#sccontrols'.$id.'").hide();
1117
- jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1118
- });
1119
- ';
1120
 
1121
  $html .= '
1122
- var slide'.$id.' = "down";
1123
- jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1124
-
1125
- if (slide'.$id.' == "up") {
1126
- jQuery(".vrgctrl'.$id.'").empty();
1127
- jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1128
- slide'.$id.' = "down";
1129
- }
1130
- else {
1131
- jQuery(".vrgctrl'.$id.'").empty();
1132
- jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1133
- slide'.$id.' = "up";
1134
- }
1135
- jQuery("#sccontrols'.$id.'").slideToggle();
1136
- });
1137
- ';
1138
 
1139
- if (!$autoload) {
1140
- $html .= '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1141
 
1142
  jQuery(document).ready(function(){
1143
  jQuery("#controls'.$id.'").hide();
@@ -1148,13 +1162,13 @@ function wpvr_block_render( $attributes ) {
1148
 
1149
  ';
1150
 
1151
- $html .= 'panoshow'.$id.'.on("load", function (){
1152
  jQuery("#controls'.$id.'").show();
1153
  jQuery("#zoom-in-out-controls'.$id.'").show();
1154
  jQuery("#adcontrol'.$id.'").show();
1155
  jQuery("#pano'.$id.'").find(".pnlm-panorama-info").show();
1156
  });';
1157
- }
1158
  $html .= '});';
1159
  $html .= '</script>';
1160
  //script end
@@ -1162,31 +1176,32 @@ function wpvr_block_render( $attributes ) {
1162
  }
1163
 
1164
 
1165
- function wpvr_hex2rgb( $colour ) {
1166
- if ( $colour[0] == '#' ) {
1167
- $colour = substr( $colour, 1 );
1168
- }
1169
- if ( strlen( $colour ) == 6 ) {
1170
- list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );
1171
- } elseif ( strlen( $colour ) == 3 ) {
1172
- list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );
1173
- } else {
1174
- return false;
1175
- }
1176
- $r = hexdec( $r );
1177
- $g = hexdec( $g );
1178
- $b = hexdec( $b );
1179
- return array( $r.', '.$g.', '.$b );
 
1180
  }
1181
 
1182
  function wpvr_HTMLToRGB($htmlCode)
1183
- {
1184
- if($htmlCode[0] == '#')
1185
- $htmlCode = substr($htmlCode, 1);
 
1186
 
1187
- if (strlen($htmlCode) == 3)
1188
- {
1189
- $htmlCode = $htmlCode[0] . $htmlCode[0] . $htmlCode[1] . $htmlCode[1] . $htmlCode[2] . $htmlCode[2];
1190
  }
1191
 
1192
  $r = hexdec($htmlCode[0] . $htmlCode[1]);
@@ -1194,9 +1209,10 @@ function wpvr_HTMLToRGB($htmlCode)
1194
  $b = hexdec($htmlCode[4] . $htmlCode[5]);
1195
 
1196
  return $b + ($g << 0x8) + ($r << 0x10);
1197
- }
1198
 
1199
- function wpvr_RGBToHSL($RGB) {
 
1200
  $r = 0xFF & ($RGB >> 0x10);
1201
  $g = 0xFF & ($RGB >> 0x8);
1202
  $b = 0xFF & $RGB;
@@ -1210,52 +1226,52 @@ function wpvr_RGBToHSL($RGB) {
1210
 
1211
  $l = ($maxC + $minC) / 2.0;
1212
 
1213
- if($maxC == $minC)
1214
- {
1215
- $s = 0;
1216
- $h = 0;
1217
- }
1218
- else
1219
- {
1220
- if($l < .5)
1221
- {
1222
- $s = ($maxC - $minC) / ($maxC + $minC);
1223
- }
1224
- else
1225
- {
1226
- $s = ($maxC - $minC) / (2.0 - $maxC - $minC);
1227
- }
1228
- if($r == $maxC)
1229
- $h = ($g - $b) / ($maxC - $minC);
1230
- if($g == $maxC)
1231
- $h = 2.0 + ($b - $r) / ($maxC - $minC);
1232
- if($b == $maxC)
1233
- $h = 4.0 + ($r - $g) / ($maxC - $minC);
1234
-
1235
- $h = $h / 6.0;
1236
  }
1237
 
1238
  $h = (int)round(255.0 * $h);
1239
  $s = (int)round(255.0 * $s);
1240
  $l = (int)round(255.0 * $l);
1241
 
1242
- return (object) Array('hue' => $h, 'saturation' => $s, 'lightness' => $l);
1243
- }
1244
 
1245
  add_action('rest_api_init', 'wpvr_rest_data_route');
1246
- function wpvr_rest_data_route() {
1247
- register_rest_route( 'wpvr/v1', '/panodata/', array(
 
1248
  'methods' => 'GET',
1249
  'callback' => 'wpvr_rest_data_set',
1250
  'permission_callback' => 'wpvr_rest_route_permission'
1251
- ) );
1252
  }
1253
 
1254
- function wpvr_rest_route_permission() {
1255
- return true;
 
1256
  }
1257
 
1258
- function wpvr_rest_data_set() {
 
1259
  $query = new WP_Query(array(
1260
  'post_type' => 'wpvr_item',
1261
  'posts_per_page' => -1,
@@ -1263,158 +1279,157 @@ function wpvr_rest_data_set() {
1263
 
1264
  $wpvr_list = array();
1265
  $list_none = array('value'=>'0','label'=>'None');
1266
- array_push($wpvr_list,$list_none);
1267
  while ($query->have_posts()) {
1268
  $query->the_post();
1269
  $title = get_the_title();
1270
  $post_id = get_the_ID();
1271
  $title = $title.' : '.$post_id;
1272
  $list_ob = array('value'=>$post_id,'label'=>$title);
1273
- array_push($wpvr_list,$list_ob);
1274
  }
1275
  return $wpvr_list;
1276
  }
1277
 
1278
- function wpvr_isMobileDevice() {
 
1279
  return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
1280
  }
1281
 
1282
- function wpvr_directory() {
 
1283
  $upload = wp_upload_dir();
1284
  $upload_dir = $upload['basedir'];
1285
  $upload_dir_temp = $upload_dir . '/wpvr/temp/';
1286
  if (! is_dir($upload_dir_temp)) {
1287
- wp_mkdir_p( $upload_dir_temp, 0700 );
1288
  }
1289
  }
1290
 
1291
- add_action('admin_init','wpvr_directory');
1292
- function wpvr_delete_temp_file() {
1293
- $file_save_url = wp_upload_dir();
1294
- $rootPath = realpath( $file_save_url['basedir'].'/wpvr/temp/');
1295
- $files = new RecursiveIteratorIterator(
1296
- new RecursiveDirectoryIterator($rootPath),
1297
- RecursiveIteratorIterator::LEAVES_ONLY
1298
- );
1299
- foreach ($files as $name => $file)
1300
- {
1301
- if (!$file->isDir())
1302
- {
1303
- $filePath = $file->getRealPath();
1304
- $filesToDelete[] = $filePath;
1305
- }
1306
- }
1307
-
1308
- foreach ($filesToDelete as $file)
1309
- {
1310
- unlink($file);
1311
- }
1312
- }
1313
 
1314
- function wpvr_add_role_cap() {
 
 
 
1315
 
 
 
1316
  $editor_active = get_option('wpvr_editor_active');
1317
  $author_active = get_option('wpvr_author_active');
1318
 
1319
- $admin = get_role( 'administrator' );
1320
- $admin->add_cap( 'publish_wpvr_tour' );
1321
- $admin->add_cap( 'edit_wpvr_tours' );
1322
- $admin->add_cap( 'read_wpvr_tour' );
1323
- $admin->add_cap( 'edit_wpvr_tour' );
1324
- $admin->add_cap( 'edit_wpvr_tours' );
1325
- $admin->add_cap( 'publish_wpvr_tours' );
1326
- $admin->add_cap( 'publish_wpvr_tour' );
1327
- $admin->add_cap( 'delete_wpvr_tour' );
1328
- $admin->add_cap( 'edit_other_wpvr_tours' );
1329
- $admin->add_cap( 'delete_other_wpvr_tours' );
1330
 
1331
  if ($editor_active == "true") {
1332
- $editor = get_role( 'editor' );
1333
- $editor->add_cap( 'publish_wpvr_tour' );
1334
- $editor->add_cap( 'edit_wpvr_tours' );
1335
- $editor->add_cap( 'read_wpvr_tour' );
1336
- $editor->add_cap( 'edit_wpvr_tour' );
1337
- $editor->add_cap( 'edit_wpvr_tours' );
1338
- $editor->add_cap( 'publish_wpvr_tours' );
1339
- $editor->add_cap( 'publish_wpvr_tour' );
1340
- $editor->add_cap( 'delete_wpvr_tour' );
1341
- $editor->add_cap( 'edit_other_wpvr_tours' );
1342
- $editor->add_cap( 'delete_other_wpvr_tours' );
1343
- }
1344
- else {
1345
- $editor = get_role( 'editor' );
1346
- $editor->remove_cap( 'publish_wpvr_tour' );
1347
- $editor->remove_cap( 'edit_wpvr_tours' );
1348
- $editor->remove_cap( 'read_wpvr_tour' );
1349
- $editor->remove_cap( 'edit_wpvr_tour' );
1350
- $editor->remove_cap( 'edit_wpvr_tours' );
1351
- $editor->remove_cap( 'publish_wpvr_tours' );
1352
- $editor->remove_cap( 'publish_wpvr_tour' );
1353
- $editor->remove_cap( 'delete_wpvr_tour' );
1354
- $editor->remove_cap( 'edit_other_wpvr_tours' );
1355
- $editor->remove_cap( 'delete_other_wpvr_tours' );
1356
  }
1357
 
1358
  if ($author_active == "true") {
1359
- $author = get_role( 'author' );
1360
- $author->add_cap( 'read_wpvr_tour' );
1361
- $author->add_cap( 'edit_wpvr_tour' );
1362
- $author->add_cap( 'edit_wpvr_tours' );
1363
- $author->add_cap( 'publish_wpvr_tours' );
1364
- $author->add_cap( 'publish_wpvr_tour' );
1365
- $author->add_cap( 'delete_wpvr_tour' );
1366
- }
1367
- else {
1368
- $author = get_role( 'author' );
1369
- $author->remove_cap( 'read_wpvr_tour' );
1370
- $author->remove_cap( 'edit_wpvr_tour' );
1371
- $author->remove_cap( 'edit_wpvr_tours' );
1372
- $author->remove_cap( 'publish_wpvr_tours' );
1373
- $author->remove_cap( 'publish_wpvr_tour' );
1374
- $author->remove_cap( 'delete_wpvr_tour' );
1375
  }
1376
  }
1377
 
1378
- add_action('admin_init','wpvr_add_role_cap',999);
1379
-
1380
- function wpvr_role_management_from_post_type( $args, $post_type ) {
1381
 
1382
- if ( 'wpvr_item' !== $post_type ) {
1383
- return $args;
1384
- }
 
 
1385
 
1386
- $editor_active = get_option('wpvr_editor_active');
1387
- $author_active = get_option('wpvr_author_active');
1388
- $user = wp_get_current_user();
1389
 
1390
- if ($editor_active == "true") {
1391
- if ( in_array( 'editor', (array) $user->roles ) ) {
1392
- $args['show_in_menu'] = true;
1393
- }
1394
- }
1395
 
1396
- if ($author_active == "true") {
1397
- if ( in_array( 'author', (array) $user->roles ) ) {
1398
- $args['show_in_menu'] = true;
1399
- }
1400
- }
1401
 
1402
- return $args;
1403
  }
1404
- add_filter( 'register_post_type_args', 'wpvr_role_management_from_post_type' , 10, 2 );
1405
 
1406
- function sample_admin_notice__success() {
1407
- $option = get_option( 'wpvr_warning' );
1408
- if (!$option) {
1409
- ?>
 
1410
  <div class="notice notice-warning" id="wpvr-warning" style="position: relative;">
1411
- <p><?php _e( 'Since you have updated the plugin, please clear the browser cache for smooth functioning. Follow these steps if you are using <a href="https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en" target="_blank">Google Chrome</a>, <a href="https://support.mozilla.org/en-US/kb/how-clear-firefox-cache" target="_blank">Mozilla Firefox</a>, <a href="https://clear-my-cache.com/en/apple-mac-os/safari.html" target="_blank">Safai</a> or <a href="https://support.microsoft.com/en-us/help/10607/microsoft-edge-view-delete-browser-history" target="_blank">Microsoft Edge</a>', 'wpvr' ); ?></p>
1412
  <button type="button" id="wpvr-dismissible" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>
1413
  </div>
1414
  <?php
1415
- }
1416
- }
1417
- add_action( 'admin_notices', 'sample_admin_notice__success' );
1418
 
1419
  //===Oxygen widget===//
1420
  add_action('plugins_loaded', function () {
@@ -1424,7 +1439,8 @@ add_action('plugins_loaded', function () {
1424
  require_once __DIR__ . '/oxygen/oxy-manager.php';
1425
  });
1426
 
1427
- add_action( 'init', 'wpvr_mobile_media_handle' );
1428
- function wpvr_mobile_media_handle() {
1429
- add_image_size( 'wpvr_mobile', 4096, 2048 ); //mobile
 
1430
  }
16
  * Plugin Name: WP VR
17
  * Plugin URI: https://rextheme.com/wpvr/
18
  * Description: WP VR - 360 Panorama and virtual tour creator for WordPress is a customized panaroma & virtual builder tool for WordPress Website.
19
+ * Version: 6.8.0
20
  * Author: Rextheme
21
  * Author URI: http://rextheme.com/
22
  * License: GPL-2.0+
25
  * Domain Path: /languages
26
  */
27
  // If this file is called directly, abort.
28
+ if (!defined('WPINC')) {
29
  die;
30
  }
31
+ require plugin_dir_path(__FILE__) . 'elementor/elementor.php';
32
  /**
33
  * Currently plugin version.
34
  * Start at version 1.0.0 and use SemVer - https://semver.org
35
  * Rename this for your plugin and update it as you release new versions.
36
  */
37
+ define('WPVR', '1.0.0');
38
+ define('WPVR_FILE', __FILE__);
39
+ define("WPVR_PLUGIN_DIR_URL", plugin_dir_url(__FILE__));
40
+ define("WPVR_PLUGIN_PUBLIC_DIR_URL", plugin_dir_url(__FILE__) .'public/');
41
+ define('WPVR_BASE', plugin_basename(WPVR_FILE));
42
 
43
  /**
44
  * The code that runs during plugin activation.
46
  */
47
  function activate_wpvr()
48
  {
49
+ require_once plugin_dir_path(__FILE__) . 'includes/class-wpvr-activator.php';
50
  Wpvr_Activator::activate();
51
  }
52
 
56
  */
57
  function deactivate_wpvr()
58
  {
59
+ require_once plugin_dir_path(__FILE__) . 'includes/class-wpvr-deactivator.php';
60
  Wpvr_Deactivator::deactivate();
61
  }
62
 
63
+ register_activation_hook(__FILE__, 'activate_wpvr');
64
+ register_deactivation_hook(__FILE__, 'deactivate_wpvr');
65
  /**
66
  * The core plugin class that is used to define internationalization,
67
  * admin-specific hooks, and public-facing site hooks.
68
  */
69
 
70
+ require plugin_dir_path(__FILE__) . 'includes/class-wpvr.php';
71
  /**
72
  * Begins execution of the plugin.
73
  *
87
  /**
88
  * array information checker
89
  */
90
+ function wpvr_in_array_r($needle, $haystack, $strict = false)
91
  {
92
+ foreach ($haystack as $item) {
93
+ if ((($strict ? $item === $needle : $item == $needle)) || is_array($item) && wpvr_in_array_r($needle, $item, $strict)) {
94
  return true;
95
  }
96
  }
102
  *
103
  * @return void
104
  */
105
+ function appsero_init_tracker_wpvr()
106
+ {
107
+ if (! class_exists('Appsero\Client')) {
108
  require_once __DIR__ . '/appsero/src/Client.php';
109
  }
110
 
111
+ $client = new Appsero\Client('cab9761e-b067-4824-9c71-042df5d58598', 'WP VR', __FILE__);
112
  $client->insights()->init();
113
  $client->updater();
114
  }
115
 
116
  appsero_init_tracker_wpvr();
117
 
118
+ function wpvr_block()
119
+ {
120
  wp_register_script(
121
  'wpvr-block',
122
+ plugins_url('build/index.build.js', __FILE__),
123
  array( 'wp-blocks', 'wp-element', 'wp-components', 'wp-editor' )
124
  );
125
  wp_enqueue_style(
126
+ 'gutyblocks/guty-block',
127
+ plugins_url('src/view.css', __FILE__),
128
  array()
129
+ );
130
 
131
  if (function_exists('register_block_type')) {
132
+ register_block_type('wpvr/wpvr-block', array(
133
  'attributes' => array(
134
  'id' => array(
135
  'type' => 'string',
155
  ),
156
  'editor_script' => 'wpvr-block',
157
  'render_callback' => 'wpvr_block_render',
158
+ ));
159
  }
160
  }
161
 
162
+ add_action('init', 'wpvr_block');
 
 
163
 
164
+ function wpvr_block_render($attributes)
165
+ {
166
  if (isset($attributes['id'])) {
167
  $id = $attributes['id'];
168
+ } else {
 
169
  $id = 0;
170
  }
171
  if (isset($attributes['width'])) {
174
  if (isset($attributes['height'])) {
175
  $height = $attributes['height'];
176
  }
177
+ if (isset($attributes['radius'])) {
178
+ $radius = $attributes['radius'].'px';
179
  }
180
 
181
+ $postdata = get_post_meta($id, 'panodata', true);
182
  $panoid = 'pano'.$id;
183
 
184
  if (isset($postdata['streetviewdata'])) {
185
+ if (empty($width)) {
186
+ $width = '600px';
187
+ }
188
+ if (empty($height)) {
189
+ $height = '400px';
190
+ }
191
+ $streetviewurl = $postdata['streetviewurl'];
192
+ $html = '';
193
+ $html .= '<div class="vr-streetview" style="text-align: center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
194
  $html .= '<iframe src="'.$streetviewurl.'" frameborder="0" style="border:0; width:100px; height:100%;" allowfullscreen=""></iframe>';
195
+ $html .= '</div>';
196
 
197
 
198
 
199
+ return $html;
200
  }
201
 
202
  if (isset($postdata['vidid'])) {
211
  $videourl = $postdata['vidurl'];
212
  $autoplay = 'off';
213
  if (isset($postdata['autoplay'])) {
214
+ $autoplay = $postdata['autoplay'];
215
  }
216
  $loop = 'off';
217
  if (isset($postdata['loop'])) {
218
+ $loop = $postdata['loop'];
219
  }
220
 
221
  if (strpos($videourl, 'youtube') > 0) {
222
+ $explodeid = '';
223
+ $explodeid = explode("=", $videourl);
224
+ $foundid = '';
225
+
226
+ if ($autoplay == 'on') {
227
+ $autoplay = '&autoplay=1';
228
+ $muted = '&mute=1';
229
+ } else {
230
+ $autoplay = '';
231
+ $muted = '';
232
+ }
233
+
234
+ if ($loop == 'on') {
235
+ $loop = '&loop=1';
236
+ } else {
237
+ $loop = '';
238
+ }
239
+
240
+ $foundid = $explodeid[1].'?'.$autoplay.$loop;
241
+ $html = '';
242
+ $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
243
+ $html .= '
 
 
244
  <iframe src="https://www.youtube.com/embed/'.$explodeid[1].'?rel=0&modestbranding=1'.$loop.'&autohide=1'.$muted.'&showinfo=0&controls=1'.$autoplay.'" width="560" height="315" frameborder="0" allowfullscreen></iframe>
245
  ';
246
+ $html .= '</div>';
247
  } elseif (strpos($videourl, 'vimeo') > 0) {
248
+ $explodeid = '';
249
+ $explodeid = explode("/", $videourl);
250
+ $foundid = '';
251
+
252
+ if ($autoplay == 'on') {
253
+ $autoplay = '&autoplay=1&muted=1';
254
+ } else {
255
+ $autoplay = '';
256
+ }
257
+
258
+ if ($loop == 'on') {
259
+ $loop = '&loop=1';
260
+ } else {
261
+ $loop = '';
262
+ }
263
 
264
+ $foundid = $explodeid[3].'?'.$autoplay.$loop;
265
+ $html = '';
266
+ $html .= '<div style="text-align:center; max-width:100%; width:'.$width.'px; height:'.$height.'px; margin: 0 auto;">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  $html .= '<iframe src="https://player.vimeo.com/video/'.$foundid.'" width="'.$width.'" height="'.$height.'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
268
+ $html .='</div>';
269
  } else {
270
  $html = '';
271
  $html .= '<div id="pano'.$id.'" class="pano-wrap" style="max-width:100%; width:'.$width.'px; height: '.$height.'px; margin: 0 auto;">';
272
+ $html .= '<div style="width:100%; height:100%; ">'.$postdata['panoviddata'].'</div>';
273
+ $html .= '<script>';
274
+ $html .= 'videojs('.$postdata['vidid'].', {';
275
+ $html .= 'plugins: {';
276
+ $html .= 'pannellum: {}';
277
+ $html .= '}';
278
+ $html .= '});';
279
+ $html .= '</script>';
280
  $html .= '</div>';
281
  }
282
  return $html;
288
  }
289
 
290
  if ($control) {
291
+ if (isset($postdata['customcontrol'])) {
292
+ $custom_control = $postdata['customcontrol'];
293
+ if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
294
+ $control = false;
295
+ }
296
  }
 
297
  }
298
 
299
  $vrgallery = false;
300
  if (isset($postdata['vrgallery'])) {
301
+ $vrgallery = $postdata['vrgallery'];
302
  }
303
 
304
  $vrgallery_title = false;
305
  if (isset($postdata['vrgallery_title'])) {
306
+ $vrgallery_title = $postdata['vrgallery_title'];
307
+ }
308
+
309
+ $vrgallery_display = false;
310
+ if (isset($postdata['vrgallery_display'])) {
311
+ $vrgallery_display = $postdata['vrgallery_display'];
312
  }
313
 
314
  $gyro = false;
315
  $gyro_orientation = false;
316
  if (isset($postdata['gyro'])) {
317
+ $gyro = $postdata['gyro'];
318
+ if (isset($postdata['deviceorientationcontrol'])) {
319
+ $gyro_orientation = $postdata['deviceorientationcontrol'];
320
+ }
321
  }
322
 
323
  $compass = false;
324
  $audio_right = "5px";
325
  if (isset($postdata['compass'])) {
326
+ $compass = $postdata['compass'];
327
+ if ($compass) {
328
+ $audio_right = "60px";
329
+ }
330
  }
331
 
332
  $mouseZoom = true;
333
  if (isset($postdata['mouseZoom'])) {
334
+ $mouseZoom = $postdata['mouseZoom'];
335
  }
336
 
337
  $draggable = true;
338
  if (isset($postdata['draggable'])) {
339
+ $draggable = $postdata['draggable'];
340
  }
341
 
342
  $diskeyboard = false;
343
  if (isset($postdata['diskeyboard'])) {
344
+ $diskeyboard = $postdata['diskeyboard'];
345
  }
346
 
347
  $keyboardzoom = true;
348
+ if (isset($postdata['keyboardzoom'])) {
349
+ $keyboardzoom = $postdata['keyboardzoom'];
350
+ }
351
 
352
  $autoload = false;
353
 
362
 
363
  $preview = '';
364
  if (isset($postdata['preview'])) {
365
+ $preview = $postdata['preview'];
366
  }
367
 
368
  $autorotation = '';
369
  if (isset($postdata["autoRotate"])) {
370
+ $autorotation = $postdata["autoRotate"];
371
  }
372
  $autorotationinactivedelay = '';
373
  if (isset($postdata["autoRotateInactivityDelay"])) {
374
+ $autorotationinactivedelay = $postdata["autoRotateInactivityDelay"];
375
  }
376
  $autorotationstopdelay = '';
377
  if (isset($postdata["autoRotateStopDelay"])) {
378
+ $autorotationstopdelay = $postdata["autoRotateStopDelay"];
379
  }
380
 
381
  $scene_fade_duration = '';
389
  }
390
  $hotspoticoncolor = '#00b4ff';
391
  $hotspotblink = 'on';
392
+ $default_data = array();
393
+ $default_data = array('firstScene'=>$default_scene, 'sceneFadeDuration'=>$scene_fade_duration);
394
+ $scene_data = array();
 
 
 
 
395
 
396
+ if (!empty($panodata['scene-list'])) {
397
+ foreach ($panodata['scene-list'] as $panoscenes) {
398
  $scene_ititle = '';
399
  if (isset($panoscenes["scene-ititle"])) {
400
+ $scene_ititle = sanitize_text_field($panoscenes["scene-ititle"]);
401
  }
402
 
403
  $scene_author = '';
404
  if (isset($panoscenes["scene-author"])) {
405
+ $scene_author = sanitize_text_field($panoscenes["scene-author"]);
406
  }
407
 
408
  $scene_author_url = '';
409
  if (isset($panoscenes["scene-author-url"])) {
410
+ $scene_author_url = sanitize_text_field($panoscenes["scene-author-url"]);
411
  }
412
 
413
  $scene_vaov = 180;
414
  if (isset($panoscenes["scene-vaov"])) {
415
+ $scene_vaov = (float)$panoscenes["scene-vaov"];
416
  }
417
 
418
  $scene_haov = 360;
419
  if (isset($panoscenes["scene-haov"])) {
420
+ $scene_haov = (float)$panoscenes["scene-haov"];
421
  }
422
 
423
 
424
  $scene_vertical_offset = 0;
425
  if (isset($panoscenes["scene-vertical-offset"])) {
426
+ $scene_vertical_offset = (float)$panoscenes["scene-vertical-offset"];
427
  }
428
 
429
  $default_scene_pitch = null;
430
  if (isset($panoscenes["scene-pitch"])) {
431
+ $default_scene_pitch = (float)$panoscenes["scene-pitch"];
432
  }
433
 
434
  $default_scene_yaw = null;
435
  if (isset($panoscenes["scene-yaw"])) {
436
+ $default_scene_yaw = (float)$panoscenes["scene-yaw"];
437
  }
438
 
439
  $scene_max_pitch = '';
440
  if (isset($panoscenes["scene-maxpitch"])) {
441
+ $scene_max_pitch = (float)$panoscenes["scene-maxpitch"];
442
  }
443
 
444
 
445
  $scene_min_pitch = '';
446
  if (isset($panoscenes["scene-minpitch"])) {
447
+ $scene_min_pitch = (float)$panoscenes["scene-minpitch"];
448
  }
449
 
450
 
451
  $scene_max_yaw = '';
452
  if (isset($panoscenes["scene-maxyaw"])) {
453
+ $scene_max_yaw = (float)$panoscenes["scene-maxyaw"];
454
  }
455
 
456
 
457
  $scene_min_yaw = '';
458
  if (isset($panoscenes["scene-minyaw"])) {
459
+ $scene_min_yaw = (float)$panoscenes["scene-minyaw"];
460
  }
461
 
462
  $default_zoom = 100;
463
  if (isset($panoscenes["scene-zoom"])) {
464
+ $default_zoom = $panoscenes["scene-zoom"];
465
  }
466
 
467
  if (!empty($default_zoom)) {
468
+ $default_zoom = (int)$default_zoom;
469
+ } else {
470
+ $default_zoom = 100;
 
471
  }
472
 
473
  $max_zoom = 120;
474
  if (isset($panoscenes["scene-maxzoom"])) {
475
+ $max_zoom = $panoscenes["scene-maxzoom"];
476
  }
477
 
478
  if (!empty($max_zoom)) {
479
+ $max_zoom = (int)$max_zoom;
480
+ } else {
481
+ $max_zoom = 120;
 
482
  }
483
 
484
  $min_zoom = 50;
485
  if (isset($panoscenes["scene-minzoom"])) {
486
+ $min_zoom = $panoscenes["scene-minzoom"];
487
  }
488
 
489
  if (!empty($min_zoom)) {
490
+ $min_zoom = (int)$min_zoom;
491
+ } else {
492
+ $min_zoom = 50;
 
493
  }
494
 
495
  $hotspot_datas = array();
500
  $hotspots = array();
501
 
502
  foreach ($hotspot_datas as $hotspot_data) {
503
+ $status = get_option('wpvr_edd_license_status');
504
+ if ($status !== false && $status == 'valid') {
505
  if (isset($hotspot_data["hotspot-customclass-pro"]) && $hotspot_data["hotspot-customclass-pro"] != 'none') {
506
+ $hotspot_data["hotspot-customclass"] = $hotspot_data["hotspot-customclass-pro"];
507
+ $hotspoticoncolor = $hotspot_data["hotspot-customclass-color-icon-value"];
508
  }
509
  if (isset($hotspot_data['hotspot-blink'])) {
510
+ $hotspotblink = $hotspot_data['hotspot-blink'];
511
  }
512
  }
513
+ $hotspot_scene_pitch = '';
514
+ if (isset($hotspot_data["hotspot-scene-pitch"])) {
515
+ $hotspot_scene_pitch = $hotspot_data["hotspot-scene-pitch"];
516
+ }
517
+ $hotspot_scene_yaw = '';
518
+ if (isset($hotspot_data["hotspot-scene-yaw"])) {
519
+ $hotspot_scene_yaw = $hotspot_data["hotspot-scene-yaw"];
520
+ }
521
 
522
  $hotspot_type = $hotspot_data["hotspot-type"] !== 'scene' ? 'info' : $hotspot_data["hotspot-type"];
523
  $hotspot_content = '';
526
  do_action('wpvr_hotspot_content', $hotspot_data);
527
  $hotspot_content = ob_get_clean();
528
 
529
+ if (!$hotspot_content) {
530
+ $hotspot_content = $hotspot_data["hotspot-content"];
531
+ }
532
 
533
+ $hotspot_info = array(
534
  'text'=>$hotspot_data['hotspot-title'],
535
  'pitch'=>$hotspot_data['hotspot-pitch'],
536
  'yaw'=>$hotspot_data['hotspot-yaw'],
546
 
547
  $hotspot_info['URL'] = ($hotspot_data['hotspot-type'] === 'fluent_form' || $hotspot_data['hotspot-type'] === 'wc_product') ? '' : $hotspot_info['URL'];
548
 
549
+ if ($hotspot_data["hotspot-customclass"] == 'none' || $hotspot_data["hotspot-customclass"] == '') {
550
+ unset($hotspot_info["cssClass"]);
551
+ }
552
+ if (empty($hotspot_data["hotspot-scene"])) {
553
+ unset($hotspot_info['targetPitch']);
554
+ unset($hotspot_info['targetYaw']);
555
+ }
556
+ array_push($hotspots, $hotspot_info);
557
  }
558
 
559
  $device_scene = $panoscenes['scene-attachment-url'];
561
  $file_accessible = ini_get('allow_url_fopen');
562
 
563
  if ($mobile_media_resize == "true") {
564
+ if ($file_accessible == "1") {
565
+ $image_info = getimagesize($device_scene);
566
+ if ($image_info[0] > 4096) {
567
+ $src_to_id_for_mobile = '';
568
+ $src_to_id_for_desktop = '';
569
+ if (wpvr_isMobileDevice()) {
570
+ $src_to_id_for_mobile = attachment_url_to_postid($panoscenes['scene-attachment-url']);
571
+ if ($src_to_id_for_mobile) {
572
+ $mobile_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'wpvr_mobile');
573
+ if ($mobile_scene[3]) {
574
+ $device_scene = $mobile_scene[0];
575
+ }
576
+ }
577
+ } else {
578
+ $src_to_id_for_desktop = attachment_url_to_postid($panoscenes['scene-attachment-url']);
579
+ if ($src_to_id_for_desktop) {
580
+ $desktop_scene = wp_get_attachment_image_src($src_to_id_for_mobile, 'full');
581
+ if ($desktop_scene[0]) {
582
+ $device_scene = $desktop_scene[0];
583
+ }
584
+ }
585
+ }
586
+ }
587
  }
 
588
  }
589
 
590
  $scene_info = array();
591
  $scene_info = array('type'=>$panoscenes['scene-type'],'panorama'=>$device_scene,"pitch"=>$default_scene_pitch,"maxPitch"=>$scene_max_pitch,"minPitch"=>$scene_min_pitch,"maxYaw"=>$scene_max_yaw,"minYaw"=>$scene_min_yaw,"yaw"=>$default_scene_yaw,"hfov"=>$default_zoom,"maxHfov"=>$max_zoom,"minHfov"=>$min_zoom,"title"=>$scene_ititle,"author"=>$scene_author, "authorURL"=>$scene_author_url, "vaov"=>$scene_vaov, "haov"=>$scene_haov, "vOffset"=>$scene_vertical_offset, 'hotSpots'=>$hotspots);
592
 
593
  if (isset($panoscenes["ptyscene"])) {
594
+ if ($panoscenes["ptyscene"] == "off") {
595
+ unset($scene_info['pitch']);
596
+ unset($scene_info['yaw']);
597
+ }
598
  }
599
 
600
  if (empty($panoscenes["scene-ititle"])) {
601
+ unset($scene_info['title']);
602
  }
603
  if (empty($panoscenes["scene-author"])) {
604
+ unset($scene_info['author']);
605
  }
606
  if (empty($panoscenes["scene-author-url"])) {
607
+ unset($scene_info['authorURL']);
608
  }
609
 
610
  if (empty($scene_vaov)) {
611
+ unset($scene_info['vaov']);
612
  }
613
 
614
  if (empty($scene_haov)) {
615
+ unset($scene_info['haov']);
616
  }
617
 
618
  if (empty($scene_vertical_offset)) {
619
+ unset($scene_info['vOffset']);
620
  }
621
 
622
  if (isset($panoscenes["cvgscene"])) {
623
+ if ($panoscenes["cvgscene"] == "off") {
624
+ unset($scene_info['maxPitch']);
625
+ unset($scene_info['minPitch']);
626
+ }
627
  }
628
  if (empty($panoscenes["scene-maxpitch"])) {
629
+ unset($scene_info['maxPitch']);
630
  }
631
 
632
  if (empty($panoscenes["scene-minpitch"])) {
633
+ unset($scene_info['minPitch']);
634
  }
635
 
636
  if (isset($panoscenes["chgscene"])) {
637
+ if ($panoscenes["chgscene"] == "off") {
638
+ unset($scene_info['maxYaw']);
639
+ unset($scene_info['minYaw']);
640
+ }
641
  }
642
  if (empty($panoscenes["scene-maxyaw"])) {
643
+ unset($scene_info['maxYaw']);
644
  }
645
 
646
  if (empty($panoscenes["scene-minyaw"])) {
647
+ unset($scene_info['minYaw']);
648
  }
649
 
650
  if (isset($panoscenes["czscene"])) {
651
+ if ($panoscenes["czscene"] == "off") {
652
+ unset($scene_info['hfov']);
653
+ unset($scene_info['maxHfov']);
654
+ unset($scene_info['minHfov']);
655
  }
656
  }
657
 
661
  );
662
  $scene_data[$panoscenes['scene-id']] = $scene_info;
663
  }
664
+ }
665
+
666
+ $pano_id_array = array();
667
+ $pano_id_array = array('panoid'=>$panoid);
668
+ $pano_response = array();
669
+ $pano_response = array('autoLoad'=>$autoload,'showControls'=>$control,'compass'=>$compass,'orientationOnByDefault'=>$gyro_orientation,'mouseZoom'=>$mouseZoom,'draggable'=>$draggable,'disableKeyboardCtrl'=>$diskeyboard,'keyboardZoom'=>$keyboardzoom,"preview"=>$preview,"autoRotate"=>$autorotation,"autoRotateInactivityDelay"=>$autorotationinactivedelay,"autoRotateStopDelay"=>$autorotationstopdelay,'default'=>$default_data,'scenes'=>$scene_data);
670
+ if (empty($autorotation)) {
671
+ unset($pano_response['autoRotate']);
672
+ unset($pano_response['autoRotateInactivityDelay']);
673
+ unset($pano_response['autoRotateStopDelay']);
674
+ }
675
+ if (empty($autorotationinactivedelay)) {
676
+ unset($pano_response['autoRotateInactivityDelay']);
677
+ }
678
+ if (empty($autorotationstopdelay)) {
679
+ unset($pano_response['autoRotateStopDelay']);
680
+ }
681
+
682
+ $response = array();
683
+ $response = array($pano_id_array,$pano_response);
684
+ if (!empty($response)) {
685
  $response = json_encode($response);
686
  }
687
  if (empty($width)) {
692
  }
693
 
694
  $foreground_color = '#fff';
695
+ $pulse_color = wpvr_hex2rgb($hotspoticoncolor);
696
+ $rgb = wpvr_HTMLToRGB($hotspoticoncolor);
697
+ $hsl = wpvr_RGBToHSL($rgb);
698
+ if ($hsl->lightness > 200) {
699
+ $foreground_color = '#000000';
700
+ } else {
701
+ $foreground_color = '#fff';
702
+ }
 
703
 
704
  $class = 'myclass';
705
  $html = 'test';
706
  $html = '';
707
  $html .= '<style>';
708
+ if ($width == 'embed') {
709
  $html .= 'body{
710
  overflow: hidden;
711
  }';
712
+ }
713
+ $html .= '#'.$panoid.' div.pnlm-hotspot-base.fas,
 
714
  #'.$panoid.' div.pnlm-hotspot-base.fab,
715
  #'.$panoid.' div.pnlm-hotspot-base.fa,
716
  #'.$panoid.' div.pnlm-hotspot-base.far {
724
  line-height: 30px;
725
  animation: icon-pulse'.$panoid.' 1.5s infinite cubic-bezier(.25, 0, 0, 1);
726
  }';
727
+ if ($hotspotblink == 'on') {
728
+ $html .= '@-webkit-keyframes icon-pulse'.$panoid.' {
729
  0% {
730
  box-shadow: 0 0 0 0px rgba('.$pulse_color[0].', 1);
731
  }
741
  box-shadow: 0 0 0 10px rgba('.$pulse_color[0].', 0);
742
  }
743
  }';
744
+ }
745
 
746
+ $status = get_option('wpvr_edd_license_status');
747
+ if ($status !== false && $status == 'valid') {
748
+ if (!$gyro) {
749
+ $html .= '#'.$panoid.' div.pnlm-orientation-button {
750
  display: none;
751
  }';
752
+ }
753
+ } else {
754
+ $html .= '#'.$panoid.' div.pnlm-orientation-button {
 
755
  display: none;
756
  }';
757
+ }
758
 
759
+ $html .= '</style>';
760
 
761
  if ($width == 'fullwidth') {
762
+ if (wpvr_isMobileDevice()) {
763
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style="text-align:center; border-radius:'.$radius.'; direction:ltr;" >';
764
+ } else {
765
+ $html .= '<div id="pano'.$id.'" class="pano-wrap vrfullwidth" style=" text-align:center; height: '.$height.'px; border-radius:'.$radius.'; direction:ltr;" >';
766
+ }
767
+ } else {
768
+ $html .= '<div id="pano'.$id.'" class="pano-wrap" style=" text-align:center; max-width:100%; width: '.$width.'px; height: '.$height.'px; margin: 0 auto; border-radius:'.$radius.'; direction:ltr;">';
 
 
769
  }
770
 
771
  //===company logo===//
772
+ if (isset($postdata['cpLogoSwitch'])) {
773
  $cpLogoImg = $postdata['cpLogoImg'];
774
  $cpLogoContent = $postdata['cpLogoContent'];
775
  if ($postdata['cpLogoSwitch'] == 'on') {
776
+ $html .= '<div id="cp-logo-controls">';
777
  $html .= '<div class="cp-logo-ctrl" id="cp-logo">';
778
  if ($cpLogoImg) {
779
+ $html .= '<img src="'.$cpLogoImg.'" alt="Company Logo">';
780
  }
781
 
782
  if ($cpLogoContent) {
783
+ $html .= '<div class="cp-info">'.$cpLogoContent.'</div>';
784
  }
785
  $html .= '</div>';
786
+ $html .= '</div>';
787
  }
788
+ }
789
  //===company logo ends===//
790
 
791
  //===Custom Control===//
792
  if (isset($custom_control)) {
793
+ if ($custom_control['panZoomInSwitch'] == "on" || $custom_control['panZoomOutSwitch'] == "on" || $custom_control['gyroscopeSwitch'] == "on" || $custom_control['backToHomeSwitch'] == "on") {
794
+ $html .= '<div id="zoom-in-out-controls'.$id.'" class="zoom-in-out-controls">';
795
 
796
+ if ($custom_control['backToHomeSwitch'] == "on") {
797
+ $html .= '<div class="ctrl" id="backToHome'.$id.'"><i class="'.$custom_control['backToHomeIcon'].'" style="color:'.$custom_control['backToHomeColor'].';"></i></div>';
798
+ }
799
 
800
+ if ($custom_control['panZoomInSwitch'] == "on") {
801
+ $html .= '<div class="ctrl" id="zoom-in'.$id.'"><i class="'.$custom_control['panZoomInIcon'].'" style="color:'.$custom_control['panZoomInColor'].';"></i></div>';
802
+ }
803
 
804
+ if ($custom_control['panZoomOutSwitch'] == "on") {
805
+ $html .= '<div class="ctrl" id="zoom-out'.$id.'"><i class="'.$custom_control['panZoomOutIcon'].'" style="color:'.$custom_control['panZoomOutColor'].';"></i></div>';
806
+ }
807
 
808
+ if ($custom_control['gyroscopeSwitch'] == "on") {
809
+ $html .= '<div class="ctrl" id="gyroscope'.$id.'"><i class="'.$custom_control['gyroscopeIcon'].'" style="color:'.$custom_control['gyroscopeColor'].';"></i></div>';
810
+ }
811
 
812
+ $html .= '</div>';
 
813
  }
 
 
 
814
  //===zoom in out Control===//
815
 
816
+ if ($custom_control['panupSwitch'] == "on" || $custom_control['panDownSwitch'] == "on" || $custom_control['panLeftSwitch'] == "on" || $custom_control['panRightSwitch'] == "on" || $custom_control['panFullscreenSwitch'] == "on") {
817
 
818
  //===Custom Control===//
819
+ $html .= '<div class="controls" id="controls'.$id.'">';
820
 
821
+ if ($custom_control['panupSwitch'] == "on") {
822
+ $html .= '<div class="ctrl pan-up" id="pan-up'.$id.'"><i class="'.$custom_control['panupIcon'].'" style="color:'.$custom_control['panupColor'].';"></i></div>';
823
+ }
824
 
825
+ if ($custom_control['panDownSwitch'] == "on") {
826
+ $html .= '<div class="ctrl pan-down" id="pan-down'.$id.'"><i class="'.$custom_control['panDownIcon'].'" style="color:'.$custom_control['panDownColor'].';"></i></div>';
827
+ }
828
 
829
+ if ($custom_control['panLeftSwitch'] == "on") {
830
+ $html .= '<div class="ctrl pan-left" id="pan-left'.$id.'"><i class="'.$custom_control['panLeftIcon'].'" style="color:'.$custom_control['panLeftColor'].';"></i></div>';
831
+ }
832
 
833
+ if ($custom_control['panRightSwitch'] == "on") {
834
+ $html .= '<div class="ctrl pan-right" id="pan-right'.$id.'"><i class="'.$custom_control['panRightIcon'].'" style="color:'.$custom_control['panRightColor'].';"></i></div>';
835
+ }
836
 
837
+ if ($custom_control['panFullscreenSwitch'] == "on") {
838
+ $html .= '<div class="ctrl fullscreen" id="fullscreen'.$id.'"><i class="'.$custom_control['panFullscreenIcon'].'" style="color:'.$custom_control['panFullscreenColor'].';"></i></div>';
839
+ }
840
+ $html .= '</div>';
841
  }
 
 
842
  }
843
  //===Custom Control===//
844
 
845
+ if ($vrgallery) {
846
+ //===Carousal setup===//
847
+ $html .= '<div id="vrgcontrols'.$id.'" class="vrgcontrols">';
848
 
849
+ $html .= '<div class="vrgctrl'.$id.' vrbounce">';
850
+ $html .= '</div>';
851
+ $html .= '</div>';
852
 
853
+ $html .= '<div id="sccontrols'.$id.'" class="scene-gallery vrowl-carousel owl-theme">';
854
+ if (isset($panodata["scene-list"])) {
855
+ foreach ($panodata["scene-list"] as $panoscenes) {
856
  $scene_key = $panoscenes['scene-id'];
857
  if ($vrgallery_title == 'on') {
858
+ $scene_key_title = $panoscenes['scene-ititle'];
859
+ // $scene_key_title = $panoscenes['scene-id'];
860
+ } else {
861
+ $scene_key_title = "";
 
862
  }
863
  $img_src_url = $panoscenes['scene-attachment-url'];
864
 
865
  $src_to_id = attachment_url_to_postid($img_src_url);
866
  $thumbnail_array = wp_get_attachment_image_src($src_to_id, 'thumbnail');
867
  if ($thumbnail_array) {
868
+ $thumbnail = $thumbnail_array[0];
869
+ } else {
870
+ $thumbnail = $img_src_url;
 
871
  }
872
 
873
  $html .= '<ul style="width:150px;"><li title="Double click to view scene">'.$scene_key_title.'<img class="scctrl" id="'.$scene_key.'_gallery_'.$id.'" src="'.$thumbnail.'"></li></ul>';
 
874
  }
875
+ }
876
+ $html .= '</div>';
877
+ //===Carousal setup end===//
878
+ }
879
+
880
+ if (isset($postdata['bg_music'])) {
881
+ $bg_music = $postdata['bg_music'];
882
+ $bg_music_url = $postdata['bg_music_url'];
883
+ $autoplay_bg_music = $postdata['autoplay_bg_music'];
884
+ $loop_bg_music = $postdata['loop_bg_music'];
885
+ $bg_loop = '';
886
+ if ($loop_bg_music == 'on') {
887
+ $bg_loop = 'loop';
888
  }
889
 
890
+ if ($bg_music == 'on') {
 
 
 
 
 
 
 
 
 
 
891
  $html .= '<div id="adcontrol'.$id.'" class="adcontrol" style="right:'.$audio_right.'">';
892
  $html .= '<audio id="vrAudio'.$id.'" onended="audionEnd'.$id.'()" '.$bg_loop.'>
893
  <source src="'.$bg_music_url.'" type="audio/mpeg">
896
  <button onclick="playPause'.$id.'()" class="ctrl audio_control" id="audio_control'.$id.'"><i id="vr-volume'.$id.'" class="fas fa-volume-up" style="color:#fff;"></i></button>
897
  ';
898
  $html .= '</div>';
 
899
  }
900
+ }
901
 
902
 
903
+ $html .= '<div class="wpvr-hotspot-tweak-contents-wrapper" style="display: none">';
904
+ $html .= '<i class="fa fa-times cross"></i>';
905
+ $html .= '<div class="wpvr-hotspot-tweak-contents-flex">';
906
+ $html .= '<div class="wpvr-hotspot-tweak-contents">';
907
+ ob_start();
908
+ do_action('wpvr_hotspot_tweak_contents', $scene_data);
909
+ $hotspot_content = ob_get_clean();
910
+ $html .= $hotspot_content;
911
+ $html .= '</div>';
912
+ $html .= '</div>';
913
+ $html .= '</div>';
914
 
915
+ $html .= '<div class="custom-ifram-wrapper" style="display: none;">';
916
+ $html .= '<i class="fa fa-times cross"></i>';
917
+ $html .= '<div class="custom-ifram-flex">';
918
+ $html .= '<div class="custom-ifram">';
919
+ $html .= '</div>';
920
+ $html .= '</div>';
921
+ $html .= '</div>';
922
  $html .= '</div>';
923
 
924
  //script started
968
  }
969
  }
970
  $html .= 'jQuery(document).ready(function() {';
971
+ $html .= 'var response = '.$response.';';
972
+ $html .= 'var scenes = response[1];';
973
+ $html .= 'if(scenes) {';
974
+ $html .= 'var scenedata = scenes.scenes;';
975
+ $html .= 'for(var i in scenedata) {';
976
+ $html .= 'var scenehotspot = scenedata[i].hotSpots;';
977
+ $html .= 'for(var i = 0; i < scenehotspot.length; i++) {';
978
+ $html .= 'if(scenehotspot[i]["clickHandlerArgs"] != "") {';
979
+ $html .= 'scenehotspot[i]["clickHandlerFunc"] = wpvrhotspot;';
980
+ $html .= '}';
981
+ $html .= 'if(scenehotspot[i]["createTooltipArgs"] != "") {';
982
+ $html .= 'scenehotspot[i]["createTooltipFunc"] = wpvrtooltip;';
983
+ $html .= '}';
984
+ $html .= '}';
985
+ $html .= '}';
986
+ $html .= '}';
987
+ $html .= 'var panoshow'.$id.' = pannellum.viewer(response[0]["panoid"], scenes);';
988
+
989
+ $html .= 'panoshow'.$id.'.on("load", function (){
990
  if (jQuery("#pano'.$id.'").children().children(".pnlm-panorama-info:visible").length > 0) {
991
  jQuery("#controls'.$id.'").css("bottom", "55px");
992
  }
996
  });';
997
 
998
 
999
+ $html .= '
1000
  if (scenes.autoRotate) {
1001
  panoshow'.$id.'.on("load", function (){
1002
  setTimeout(function(){ panoshow'.$id.'.startAutoRotate(scenes.autoRotate, 0); }, 3000);
1006
  });
1007
  }
1008
  ';
1009
+ $html .= 'var touchtime = 0;';
1010
+ if ($vrgallery) {
1011
+ if (isset($panodata["scene-list"])) {
1012
  foreach ($panodata["scene-list"] as $panoscenes) {
1013
+ $scene_key = $panoscenes['scene-id'];
1014
+ $scene_key_gallery = $panoscenes['scene-id'].'_gallery_'.$id;
1015
+ $img_src_url = $panoscenes['scene-attachment-url'];
1016
+ $html .= 'document.getElementById("'.$scene_key_gallery.'").addEventListener("click", function(e) { ';
1017
  $html .= 'if (touchtime == 0) {';
1018
+ $html .= 'touchtime = new Date().getTime();';
1019
  $html .= '} else {';
1020
+ $html .= 'if (((new Date().getTime()) - touchtime) < 800) {';
1021
+ $html .= 'panoshow'.$id.'.loadScene("'.$scene_key.'");';
1022
+ $html .= 'touchtime = 0;';
1023
+ $html .= '} else {';
1024
+ $html .= 'touchtime = new Date().getTime();';
1025
+ $html .= '}';
1026
  $html .= '}';
1027
+ $html .= '});';
1028
  }
 
1029
  }
1030
+ }
1031
 
1032
+ //===Custom Control===//
1033
+ if (isset($custom_control)) {
1034
+ if ($custom_control['panupSwitch'] == "on") {
1035
  $html .= 'document.getElementById("pan-up'.$id.'").addEventListener("click", function(e) {';
1036
+ $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() + 10);';
1037
  $html .= '});';
1038
+ }
1039
 
1040
+ if ($custom_control['panDownSwitch'] == "on") {
1041
  $html .= 'document.getElementById("pan-down'.$id.'").addEventListener("click", function(e) {';
1042
+ $html .= 'panoshow'.$id.'.setPitch(panoshow'.$id.'.getPitch() - 10);';
1043
  $html .= '});';
1044
+ }
1045
 
1046
+ if ($custom_control['panLeftSwitch'] == "on") {
1047
  $html .= 'document.getElementById("pan-left'.$id.'").addEventListener("click", function(e) {';
1048
+ $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() - 10);';
1049
  $html .= '});';
1050
+ }
1051
 
1052
+ if ($custom_control['panRightSwitch'] == "on") {
1053
  $html .= 'document.getElementById("pan-right'.$id.'").addEventListener("click", function(e) {';
1054
+ $html .= 'panoshow'.$id.'.setYaw(panoshow'.$id.'.getYaw() + 10);';
1055
  $html .= '});';
1056
+ }
1057
 
1058
+ if ($custom_control['panZoomInSwitch'] == "on") {
1059
  $html .= 'document.getElementById("zoom-in'.$id.'").addEventListener("click", function(e) {';
1060
+ $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() - 10);';
1061
  $html .= '});';
1062
+ }
1063
 
1064
+ if ($custom_control['panZoomOutSwitch'] == "on") {
1065
  $html .= 'document.getElementById("zoom-out'.$id.'").addEventListener("click", function(e) {';
1066
+ $html .= 'panoshow'.$id.'.setHfov(panoshow'.$id.'.getHfov() + 10);';
1067
  $html .= '});';
1068
+ }
1069
 
1070
+ if ($custom_control['panFullscreenSwitch'] == "on") {
1071
  $html .= 'document.getElementById("fullscreen'.$id.'").addEventListener("click", function(e) {';
1072
+ $html .= 'panoshow'.$id.'.toggleFullscreen();';
1073
  $html .= '});';
1074
+ }
1075
 
1076
+ if ($custom_control['backToHomeSwitch'] == "on") {
1077
  $html .= 'document.getElementById("backToHome'.$id.'").addEventListener("click", function(e) {';
1078
+ $html .= 'panoshow'.$id.'.loadScene("'.$default_scene.'");';
1079
  $html .= '});';
1080
+ }
1081
 
1082
+ if ($custom_control['gyroscopeSwitch'] == "on") {
1083
  $html .= 'document.getElementById("gyroscope'.$id.'").addEventListener("click", function(e) {';
1084
+ $html .= '
1085
  if (panoshow'.$id.'.isOrientationActive()) {
1086
  panoshow'.$id.'.stopOrientation();
1087
  }
1091
 
1092
  ';
1093
  $html .= '});';
 
 
1094
  }
1095
+ }
1096
 
1097
+ $angle_up = '<i class="fa fa-angle-up"></i>';
1098
+ $angle_down = '<i class="fa fa-angle-down"></i>';
1099
+ $sin_qout = "'";
1100
 
1101
+ if ($vrgallery_display) {
1102
  $html .= '
1103
+ jQuery(document).ready(function($){
1104
+ jQuery("#sccontrols'.$id.'").show();
1105
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1106
+ });
1107
+ ';
1108
 
1109
  $html .= '
1110
+ var slide'.$id.' = "down";
1111
+ jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
 
1113
+ if (slide'.$id.' == "up") {
1114
+ jQuery(".vrgctrl'.$id.'").empty();
1115
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1116
+ slide'.$id.' = "down";
1117
+ }
1118
+ else {
1119
+ jQuery(".vrgctrl'.$id.'").empty();
1120
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1121
+ slide'.$id.' = "up";
1122
+ }
1123
+ jQuery("#sccontrols'.$id.'").slideToggle();
1124
+ });
1125
+ ';
1126
+ } else {
1127
+ $html .= '
1128
+ jQuery(document).ready(function($){
1129
+ jQuery("#sccontrols'.$id.'").hide();
1130
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1131
+ });
1132
+ ';
1133
+
1134
+ $html .= '
1135
+ var slide'.$id.' = "down";
1136
+ jQuery(document).on("click","#vrgcontrols'.$id.'",function() {
1137
+
1138
+ if (slide'.$id.' == "up") {
1139
+ jQuery(".vrgctrl'.$id.'").empty();
1140
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_up.$sin_qout.');
1141
+ slide'.$id.' = "down";
1142
+ }
1143
+ else {
1144
+ jQuery(".vrgctrl'.$id.'").empty();
1145
+ jQuery(".vrgctrl'.$id.'").html('.$sin_qout.$angle_down.$sin_qout.');
1146
+ slide'.$id.' = "up";
1147
+ }
1148
+ jQuery("#sccontrols'.$id.'").slideToggle();
1149
+ });
1150
+ ';
1151
+ }
1152
+
1153
+ if (!$autoload) {
1154
+ $html .= '
1155
 
1156
  jQuery(document).ready(function(){
1157
  jQuery("#controls'.$id.'").hide();
1162
 
1163
  ';
1164
 
1165
+ $html .= 'panoshow'.$id.'.on("load", function (){
1166
  jQuery("#controls'.$id.'").show();
1167
  jQuery("#zoom-in-out-controls'.$id.'").show();
1168
  jQuery("#adcontrol'.$id.'").show();
1169
  jQuery("#pano'.$id.'").find(".pnlm-panorama-info").show();
1170
  });';
1171
+ }
1172
  $html .= '});';
1173
  $html .= '</script>';
1174
  //script end
1176
  }
1177
 
1178
 
1179
+ function wpvr_hex2rgb($colour)
1180
+ {
1181
+ if ($colour[0] == '#') {
1182
+ $colour = substr($colour, 1);
1183
+ }
1184
+ if (strlen($colour) == 6) {
1185
+ list($r, $g, $b) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );
1186
+ } elseif (strlen($colour) == 3) {
1187
+ list($r, $g, $b) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );
1188
+ } else {
1189
+ return false;
1190
+ }
1191
+ $r = hexdec($r);
1192
+ $g = hexdec($g);
1193
+ $b = hexdec($b);
1194
+ return array( $r.', '.$g.', '.$b );
1195
  }
1196
 
1197
  function wpvr_HTMLToRGB($htmlCode)
1198
+ {
1199
+ if ($htmlCode[0] == '#') {
1200
+ $htmlCode = substr($htmlCode, 1);
1201
+ }
1202
 
1203
+ if (strlen($htmlCode) == 3) {
1204
+ $htmlCode = $htmlCode[0] . $htmlCode[0] . $htmlCode[1] . $htmlCode[1] . $htmlCode[2] . $htmlCode[2];
 
1205
  }
1206
 
1207
  $r = hexdec($htmlCode[0] . $htmlCode[1]);
1209
  $b = hexdec($htmlCode[4] . $htmlCode[5]);
1210
 
1211
  return $b + ($g << 0x8) + ($r << 0x10);
1212
+ }
1213
 
1214
+ function wpvr_RGBToHSL($RGB)
1215
+ {
1216
  $r = 0xFF & ($RGB >> 0x10);
1217
  $g = 0xFF & ($RGB >> 0x8);
1218
  $b = 0xFF & $RGB;
1226
 
1227
  $l = ($maxC + $minC) / 2.0;
1228
 
1229
+ if ($maxC == $minC) {
1230
+ $s = 0;
1231
+ $h = 0;
1232
+ } else {
1233
+ if ($l < .5) {
1234
+ $s = ($maxC - $minC) / ($maxC + $minC);
1235
+ } else {
1236
+ $s = ($maxC - $minC) / (2.0 - $maxC - $minC);
1237
+ }
1238
+ if ($r == $maxC) {
1239
+ $h = ($g - $b) / ($maxC - $minC);
1240
+ }
1241
+ if ($g == $maxC) {
1242
+ $h = 2.0 + ($b - $r) / ($maxC - $minC);
1243
+ }
1244
+ if ($b == $maxC) {
1245
+ $h = 4.0 + ($r - $g) / ($maxC - $minC);
1246
+ }
1247
+
1248
+ $h = $h / 6.0;
 
 
 
1249
  }
1250
 
1251
  $h = (int)round(255.0 * $h);
1252
  $s = (int)round(255.0 * $s);
1253
  $l = (int)round(255.0 * $l);
1254
 
1255
+ return (object) array('hue' => $h, 'saturation' => $s, 'lightness' => $l);
1256
+ }
1257
 
1258
  add_action('rest_api_init', 'wpvr_rest_data_route');
1259
+ function wpvr_rest_data_route()
1260
+ {
1261
+ register_rest_route('wpvr/v1', '/panodata/', array(
1262
  'methods' => 'GET',
1263
  'callback' => 'wpvr_rest_data_set',
1264
  'permission_callback' => 'wpvr_rest_route_permission'
1265
+ ));
1266
  }
1267
 
1268
+ function wpvr_rest_route_permission()
1269
+ {
1270
+ return true;
1271
  }
1272
 
1273
+ function wpvr_rest_data_set()
1274
+ {
1275
  $query = new WP_Query(array(
1276
  'post_type' => 'wpvr_item',
1277
  'posts_per_page' => -1,
1279
 
1280
  $wpvr_list = array();
1281
  $list_none = array('value'=>'0','label'=>'None');
1282
+ array_push($wpvr_list, $list_none);
1283
  while ($query->have_posts()) {
1284
  $query->the_post();
1285
  $title = get_the_title();
1286
  $post_id = get_the_ID();
1287
  $title = $title.' : '.$post_id;
1288
  $list_ob = array('value'=>$post_id,'label'=>$title);
1289
+ array_push($wpvr_list, $list_ob);
1290
  }
1291
  return $wpvr_list;
1292
  }
1293
 
1294
+ function wpvr_isMobileDevice()
1295
+ {
1296
  return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
1297
  }
1298
 
1299
+ function wpvr_directory()
1300
+ {
1301
  $upload = wp_upload_dir();
1302
  $upload_dir = $upload['basedir'];
1303
  $upload_dir_temp = $upload_dir . '/wpvr/temp/';
1304
  if (! is_dir($upload_dir_temp)) {
1305
+ wp_mkdir_p($upload_dir_temp, 0700);
1306
  }
1307
  }
1308
 
1309
+ add_action('admin_init', 'wpvr_directory');
1310
+ function wpvr_delete_temp_file()
1311
+ {
1312
+ $file_save_url = wp_upload_dir();
1313
+ $rootPath = realpath($file_save_url['basedir'].'/wpvr/temp/');
1314
+ $files = new RecursiveIteratorIterator(
1315
+ new RecursiveDirectoryIterator($rootPath),
1316
+ RecursiveIteratorIterator::LEAVES_ONLY
1317
+ );
1318
+ foreach ($files as $name => $file) {
1319
+ if (!$file->isDir()) {
1320
+ $filePath = $file->getRealPath();
1321
+ $filesToDelete[] = $filePath;
1322
+ }
1323
+ }
 
 
 
 
 
 
 
1324
 
1325
+ foreach ($filesToDelete as $file) {
1326
+ unlink($file);
1327
+ }
1328
+ }
1329
 
1330
+ function wpvr_add_role_cap()
1331
+ {
1332
  $editor_active = get_option('wpvr_editor_active');
1333
  $author_active = get_option('wpvr_author_active');
1334
 
1335
+ $admin = get_role('administrator');
1336
+ $admin->add_cap('publish_wpvr_tour');
1337
+ $admin->add_cap('edit_wpvr_tours');
1338
+ $admin->add_cap('read_wpvr_tour');
1339
+ $admin->add_cap('edit_wpvr_tour');
1340
+ $admin->add_cap('edit_wpvr_tours');
1341
+ $admin->add_cap('publish_wpvr_tours');
1342
+ $admin->add_cap('publish_wpvr_tour');
1343
+ $admin->add_cap('delete_wpvr_tour');
1344
+ $admin->add_cap('edit_other_wpvr_tours');
1345
+ $admin->add_cap('delete_other_wpvr_tours');
1346
 
1347
  if ($editor_active == "true") {
1348
+ $editor = get_role('editor');
1349
+ $editor->add_cap('publish_wpvr_tour');
1350
+ $editor->add_cap('edit_wpvr_tours');
1351
+ $editor->add_cap('read_wpvr_tour');
1352
+ $editor->add_cap('edit_wpvr_tour');
1353
+ $editor->add_cap('edit_wpvr_tours');
1354
+ $editor->add_cap('publish_wpvr_tours');
1355
+ $editor->add_cap('publish_wpvr_tour');
1356
+ $editor->add_cap('delete_wpvr_tour');
1357
+ $editor->add_cap('edit_other_wpvr_tours');
1358
+ $editor->add_cap('delete_other_wpvr_tours');
1359
+ } else {
1360
+ $editor = get_role('editor');
1361
+ $editor->remove_cap('publish_wpvr_tour');
1362
+ $editor->remove_cap('edit_wpvr_tours');
1363
+ $editor->remove_cap('read_wpvr_tour');
1364
+ $editor->remove_cap('edit_wpvr_tour');
1365
+ $editor->remove_cap('edit_wpvr_tours');
1366
+ $editor->remove_cap('publish_wpvr_tours');
1367
+ $editor->remove_cap('publish_wpvr_tour');
1368
+ $editor->remove_cap('delete_wpvr_tour');
1369
+ $editor->remove_cap('edit_other_wpvr_tours');
1370
+ $editor->remove_cap('delete_other_wpvr_tours');
 
1371
  }
1372
 
1373
  if ($author_active == "true") {
1374
+ $author = get_role('author');
1375
+ $author->add_cap('read_wpvr_tour');
1376
+ $author->add_cap('edit_wpvr_tour');
1377
+ $author->add_cap('edit_wpvr_tours');
1378
+ $author->add_cap('publish_wpvr_tours');
1379
+ $author->add_cap('publish_wpvr_tour');
1380
+ $author->add_cap('delete_wpvr_tour');
1381
+ } else {
1382
+ $author = get_role('author');
1383
+ $author->remove_cap('read_wpvr_tour');
1384
+ $author->remove_cap('edit_wpvr_tour');
1385
+ $author->remove_cap('edit_wpvr_tours');
1386
+ $author->remove_cap('publish_wpvr_tours');
1387
+ $author->remove_cap('publish_wpvr_tour');
1388
+ $author->remove_cap('delete_wpvr_tour');
 
1389
  }
1390
  }
1391
 
1392
+ add_action('admin_init', 'wpvr_add_role_cap', 999);
 
 
1393
 
1394
+ function wpvr_role_management_from_post_type($args, $post_type)
1395
+ {
1396
+ if ('wpvr_item' !== $post_type) {
1397
+ return $args;
1398
+ }
1399
 
1400
+ $editor_active = get_option('wpvr_editor_active');
1401
+ $author_active = get_option('wpvr_author_active');
1402
+ $user = wp_get_current_user();
1403
 
1404
+ if ($editor_active == "true") {
1405
+ if (in_array('editor', (array) $user->roles)) {
1406
+ $args['show_in_menu'] = true;
1407
+ }
1408
+ }
1409
 
1410
+ if ($author_active == "true") {
1411
+ if (in_array('author', (array) $user->roles)) {
1412
+ $args['show_in_menu'] = true;
1413
+ }
1414
+ }
1415
 
1416
+ return $args;
1417
  }
1418
+ add_filter('register_post_type_args', 'wpvr_role_management_from_post_type', 10, 2);
1419
 
1420
+ function sample_admin_notice__success()
1421
+ {
1422
+ $option = get_option('wpvr_warning');
1423
+ if (!$option) {
1424
+ ?>
1425
  <div class="notice notice-warning" id="wpvr-warning" style="position: relative;">
1426
+ <p><?php _e('Since you have updated the plugin, please clear the browser cache for smooth functioning. Follow these steps if you are using <a href="https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en" target="_blank">Google Chrome</a>, <a href="https://support.mozilla.org/en-US/kb/how-clear-firefox-cache" target="_blank">Mozilla Firefox</a>, <a href="https://clear-my-cache.com/en/apple-mac-os/safari.html" target="_blank">Safai</a> or <a href="https://support.microsoft.com/en-us/help/10607/microsoft-edge-view-delete-browser-history" target="_blank">Microsoft Edge</a>', 'wpvr'); ?></p>
1427
  <button type="button" id="wpvr-dismissible" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>
1428
  </div>
1429
  <?php
1430
+ }
1431
+ }
1432
+ add_action('admin_notices', 'sample_admin_notice__success');
1433
 
1434
  //===Oxygen widget===//
1435
  add_action('plugins_loaded', function () {
1439
  require_once __DIR__ . '/oxygen/oxy-manager.php';
1440
  });
1441
 
1442
+ add_action('init', 'wpvr_mobile_media_handle');
1443
+ function wpvr_mobile_media_handle()
1444
+ {
1445
+ add_image_size('wpvr_mobile', 4096, 2048); //mobile
1446
  }