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

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

194 lines 6.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3 /**
4 * The admin-specific functionality of the plugin.
5 *
6 * @link http://rextheme.com/
7 * @since 8.0.0
8 *
9 * @package Wpvr
10 * @subpackage Wpvr/admin/classes
11 */
12
13 class WPVR_Admin_Page {
14
15 /**
16 * Instance of WPVR_Admin_Page class
17 *
18 * @var object
19 * @since 8.0.0
20 */
21 static $instance;
22
23
24 private function __construct()
25 {
26 // Register WPVR menu
27 add_action('admin_menu', array($this, 'wpvr_add_admin_pages'));
28 // Display confirmation alert
29 add_action('admin_footer', array($this, 'vpvr_confirmation_alert_display'));
30 }
31
32
33 /**
34 * Declared to overwrite magic method __clone()
35 * In order to prevent object cloning
36 *
37 * @return void
38 * @since 8.0.0
39 */
40 private function __clone()
41 {
42 // Do nothing
43 }
44
45
46 /**
47 * Create instance of this class
48 *
49 * @return object
50 * @since 8.0.0
51 */
52 public static function getInstance()
53 {
54 if(!(self::$instance instanceof self)) {
55 self::$instance = new self();
56 }
57 return self::$instance;
58 }
59
60
61 /**
62 * Admin page setup is specified in this area.
63 *
64 * @since 8.0.0
65 */
66 function wpvr_add_admin_pages() {
67 add_menu_page( 'WP VR', 'WP VR', 'manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'),$this->get_menu_icon(), 25);
68
69 add_submenu_page( 'wpvr', 'WP VR', __('Get Started','wpvr'),'manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'));
70 remove_submenu_page('wpvr', 'wpvr');
71
72 add_submenu_page( 'wpvr', 'WP VR', __('Tours','wpvr'),'manage_options', 'edit.php?post_type=wpvr_item', NULL);
73
74 add_submenu_page( 'wpvr', 'WP VR', __('Add New Tour','wpvr'),'manage_options', 'post-new.php?post_type=wpvr_item', NULL);
75
76 /*
77 * Add Analytics page
78 * @since 8.5.16
79 */
80 do_action('wpvr_pro_analytics_page');
81 do_action('wpvr_pro_before_guided_tour');
82 add_submenu_page( 'wpvr', 'WP VR', __('Settings','wpvr'),'manage_options', 'wpvr-setting', array($this,'wpvr_setting_page'));
83
84 // add_submenu_page( 'wpvr', 'WP VR', __('Guided Tour','wpvr'),'manage_options', 'wpvr-setup-wizard', array($this,'wpvr_setup_wizard'));
85
86 if (!is_plugin_active('wpvr-pro/wpvr-pro.php')) {
87 add_submenu_page( 'wpvr', 'WP VR', __('Free vs Pro','wpvr'),'manage_options', 'wpvr', array( $this, 'wpvr_admin_doc'));
88 }
89
90 add_submenu_page( 'wpvr', 'WP VR', __('Setup Wizard','wpvr'),'manage_options', 'rex-wpvr-setup-wizard', array( $this, 'wpvr_new_setup_wizard'));
91 do_action('wpvr_pro_license_page');
92
93
94
95 if(!is_plugin_active('wpvr-pro/wpvr-pro.php')){
96 add_submenu_page(
97 'wpvr',
98 '',
99 '<span id="wpvr-gopro-submenu" class="dashicons dashicons-star-filled" style="font-size: 17px; color:#1fb3fb;"></span> ' . __( 'Go Pro', 'wpvr' ),
100 'manage_options',
101 esc_url( 'https://rextheme.com/wpvr/wpvr-pricing/' )
102 );
103 }
104 }
105
106
107 /**
108 * Gets the SVG icon for menu
109 *
110 * @desc Gets the SVG icon for menu
111 * @return string
112 * @since 8.5.26
113 */
114
115 private function get_menu_icon() {
116 return 'data:image/svg+xml;base64,' . base64_encode( //phpcs:ignore
117 '<?xml version="1.0" encoding="utf-8"?>
118 <!-- Generator: Adobe Illustrator 27.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
119 <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
120 <mask id="mask0_332_2" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
121 <rect width="20" height="20" fill="#D9D9D9"/>
122 </mask>
123 <g mask="url(#mask0_332_2)">
124 <path d="M16.8474 7.35132V10.2309C17.4323 10.2309 17.9047 9.58607 17.9047 8.79095C17.9047 7.99583 17.4312 7.35132 16.8474 7.35132Z" fill="#A8AAAD"/>
125 <path d="M3.13659 7.33405V10.2129C2.55167 10.2129 2.07935 9.56807 2.07935 8.77331C2.07935 7.97855 2.5524 7.33441 3.13659 7.33405Z" fill="#A8AAAD"/>
126 <path fill-rule="evenodd" clip-rule="evenodd" d="M3.1 11.2222C3.1 12.197 3.7995 12.9903 4.65868 12.9903H15.3413C16.2013 12.9903 16.9 12.197 16.9 11.2222V10.6211C18.8101 11.0309 20 11.6091 20 12.25C20 13.4927 15.5221 14.5 10 14.5C4.47792 14.5 0 13.4927 0 12.25C0 11.6094 1.19009 11.0313 3.1 10.6216V11.2222Z" fill="#A8AAAD"/>
127 <path fill-rule="evenodd" clip-rule="evenodd" d="M15.1442 5.86572H4.87146C4.17138 5.86572 3.604 6.45686 3.604 7.18581V11.0243C3.604 11.7537 4.17138 12.3444 4.87146 12.3444H4.97492V12.3404C6.48877 12.0918 8.19785 11.9518 10.0075 11.9518C11.8171 11.9518 13.5269 12.0918 15.0407 12.3404V12.3444H15.1438C15.8439 12.3444 16.4116 11.7537 16.4116 11.0243V7.18581C16.412 6.45686 15.8443 5.86572 15.1442 5.86572ZM5.06396 7.9718H5.54433L5.93806 9.7792L6.39284 7.9718H6.89258L7.3214 9.76933L7.71879 7.9718H8.20208L7.57767 10.2994H7.04942L6.62973 8.6408L6.19104 10.2979L5.6657 10.3012L5.06396 7.9718ZM8.94197 9.40558H9.31632C9.89284 9.40558 10.1235 9.04549 10.1235 8.69198C10.1235 8.28875 9.85445 7.9718 9.31632 7.9718H8.49341V10.2994H8.94197V9.40558ZM9.66289 8.69198C9.66289 8.8989 9.55029 9.02904 9.29731 9.02904H8.94197V8.352H9.29731C9.55066 8.352 9.66289 8.47885 9.66289 8.69198ZM12.7335 7.9718H13.2087L12.3891 10.2994H11.8477L11.0266 7.9718H11.507L12.1219 9.8227L12.7335 7.9718ZM15.1251 8.6854C15.1251 8.29533 14.856 7.9718 14.3182 7.9718H13.4792V10.2994H13.9274V9.39242H14.1387L14.6319 10.2994H15.1507L14.6158 9.35586C14.9748 9.2557 15.1251 8.96909 15.1251 8.6854ZM13.9274 8.35858H14.3022C14.5526 8.35858 14.6641 8.48653 14.6641 8.69637C14.6641 8.90621 14.5519 9.04293 14.3022 9.04293H13.9274V8.35858Z" fill="#A8AAAD"/>
128 </g>
129 </svg>
130
131 '
132 );
133 }
134
135
136 /**
137 * Provide setup wizard area view for the plugin
138 *
139 * @since 8.0.0
140 */
141 function wpvr_setup_wizard(){
142 require_once plugin_dir_path(__FILE__) . '../partials/wpvr_setup_wizard.php';
143 }
144 /**
145 * Provide setup wizard area view for the plugin
146 *
147 * @since 8.0.0
148 */
149 function wpvr_setting_page(){
150 require_once plugin_dir_path(__FILE__) . '../partials/wpvr_setting.php';
151 }
152
153 /**
154 * Provide a admin area view for the plugin
155 *
156 * @since 8.0.0
157 */
158 function wpvr_admin_doc() {
159 require_once plugin_dir_path(__FILE__) . '../partials/wpvr_documentation.php';
160 }
161
162
163 /**
164 * Provide license key submission or plugin activition page
165 *
166 * @since 8.0.0
167 */
168 function wpvr_pro_admin_doc() {
169 require_once plugin_dir_path(__FILE__) . '../partials/wpvr_license.php';
170 }
171
172
173 /**
174 * Provide cofiramtion alert for events
175 *
176 * @since 8.0.0
177 */
178 function vpvr_confirmation_alert_display() {
179 require_once plugin_dir_path(__FILE__) . '../partials/wpvr_confirmation_alert.php';
180 }
181
182 function wpvr_new_setup_wizard() {
183 add_action('admin_menu', function () {
184 add_dashboard_page('WPVR Setup', 'WPVR Setup', 'manage_options', 'wpvr-setup-wizard', function () {
185 return '';
186 });
187 });
188 add_action('current_screen', function () {
189 ( new WPVR_Setup_Wizard() )->setup_wizard();
190 }, 999);
191 }
192
193 }
194