| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
die('-1'); |
| 4 |
} |
| 5 |
|
| 6 |
class QuadMenu_Panel { |
| 7 |
|
| 8 |
static $status = array(); |
| 9 |
|
| 10 |
function __construct() { |
| 11 |
|
| 12 |
add_filter('quadmenu_global_js_data', array($this, 'js_data')); |
| 13 |
|
| 14 |
add_action('admin_enqueue_scripts', array($this, 'enqueue'), 5); |
| 15 |
|
| 16 |
add_filter('admin_body_class', array($this, 'body'), 99); |
| 17 |
|
| 18 |
add_action('admin_menu', array($this, 'panel'), 5); |
| 19 |
|
| 20 |
add_action('admin_menu', array($this, 'menus'), 9); |
| 21 |
|
| 22 |
add_action('admin_menu', array($this, 'pro'), 99); |
| 23 |
} |
| 24 |
|
| 25 |
function enqueue() { |
| 26 |
|
| 27 |
$screen = get_current_screen(); |
| 28 |
|
| 29 |
if (strpos($screen->base, sanitize_title(QUADMENU_NAME)) === false && $screen->base != 'toplevel_page_quadmenu_welcome') |
| 30 |
return; |
| 31 |
|
| 32 |
wp_enqueue_style('quadmenu-admin'); |
| 33 |
|
| 34 |
wp_enqueue_script('quadmenu-admin'); |
| 35 |
|
| 36 |
wp_localize_script('quadmenu-admin', 'quadmenu', apply_filters('quadmenu_global_js_data', array())); |
| 37 |
} |
| 38 |
|
| 39 |
function js_data($data) { |
| 40 |
|
| 41 |
$data['nonce'] = wp_create_nonce('quadmenu'); |
| 42 |
|
| 43 |
return $data; |
| 44 |
} |
| 45 |
|
| 46 |
function panel() { |
| 47 |
add_menu_page(QUADMENU_NAME, QUADMENU_NAME, 'edit_posts', 'quadmenu_welcome', array($this, 'welcome'), QUADMENU_URL_ASSETS . 'backend/images/icon.png', 60); |
| 48 |
add_submenu_page('quadmenu_welcome', esc_html__('Welcome', 'quadmenu'), esc_html__('Welcome', 'quadmenu'), 'edit_posts', 'quadmenu_welcome', array($this, 'welcome')); |
| 49 |
} |
| 50 |
|
| 51 |
function pro() { |
| 52 |
add_submenu_page('quadmenu_welcome', __('Premium', 'quadmenu'), sprintf('<i class="dashicons dashicons-awards"></i> %s', __('Premium', 'quadmenu')), 'edit_posts', 'quadmenu_pro', array($this, 'purchase')); |
| 53 |
} |
| 54 |
|
| 55 |
function menus() { |
| 56 |
add_submenu_page('quadmenu_welcome', esc_html__('Menus', 'quadmenu'), esc_html__('Menus', 'quadmenu'), 'manage_options', 'nav-menus.php'); |
| 57 |
} |
| 58 |
|
| 59 |
static function body($classes) { |
| 60 |
|
| 61 |
$screen = get_current_screen(); |
| 62 |
|
| 63 |
//if (strpos($screen->base, sanitize_title(QUADMENU_NAME)) === false && $screen->base != 'toplevel_page_quadmenu_welcome') |
| 64 |
//return $classes; |
| 65 |
|
| 66 |
$classes .= ' admin-color-quadmenu'; |
| 67 |
|
| 68 |
return $classes; |
| 69 |
} |
| 70 |
|
| 71 |
function welcome() { |
| 72 |
$this->header(); |
| 73 |
?> |
| 74 |
<div class="about-wrap quadmenu-admin-wrap"> |
| 75 |
<div class="has-2-columns is-wider-left" style="max-width: 100%"> |
| 76 |
<div class="column"> |
| 77 |
<div class="quadmenu-welcome-header"> |
| 78 |
<h1><?php echo QUADMENU_NAME ?> <div class="quadmenu-welcome-version"> v<?php echo QUADMENU_VERSION ?></div></h1> |
| 79 |
<div class="about-text"> |
| 80 |
<?php esc_html_e('Thank you for using our plugin, we\'re very grateful for your welcome. We have worked very much and very hard to release this great product and we will do our absolute best to support it and fix all the issues.', 'quadmenu'); ?> |
| 81 |
</div> |
| 82 |
</div> |
| 83 |
<hr/> |
| 84 |
<div class="feature-section" style="padding: 10px 0;"> |
| 85 |
<h3><?php esc_html_e('Easy and fast start', 'quadmenu'); ?></h3> |
| 86 |
<p> |
| 87 |
<?php esc_html_e('The QuadMenu Plugin has a simple and intuitive interface, integrated into the WP dashboard, allowing you to create and customize an unlimited amount of mega menus, without any programming skills.', 'quadmenu'); ?> |
| 88 |
</p> |
| 89 |
<p> |
| 90 |
<?php printf(__('Go to the <a href="%s">Options</a> panel and activate the plugin in your theme locations.', 'quadmenu'), QuadMenu::taburl(0)); ?> |
| 91 |
</p> |
| 92 |
</div> |
| 93 |
</div> |
| 94 |
<div class="column"> |
| 95 |
<img src="<?php echo QUADMENU_URL_ASSETS; ?>backend/images/screenshot.png"> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<hr/> |
| 99 |
<div class="quadmenu-admin-box-text quadmenu-admin-box-three"> |
| 100 |
<h3><?php esc_html_e('Support', 'quadmenu'); ?></h3> |
| 101 |
<p> |
| 102 |
<?php printf(__('We offer personalized support to all <a href="%s" target="_blank">QuadMenu PRO</a> users. To get support first you need to create an account and open a ticket in your account.', 'quadmenu'), QUADMENU_DEMO); ?> |
| 103 |
</p> |
| 104 |
<a class="button button-primary" href="<?php echo QUADMENU_SUPPORT ?>" target="_blank"><?php esc_html_e('Submit ticket', 'quadmenu'); ?></a> |
| 105 |
<a class="button button-secondary" href="<?php echo QUADMENU_GROUP ?>" target="_blank"><?php esc_html_e('Join Community', 'quadmenu'); ?></a> |
| 106 |
</div> |
| 107 |
<div class="quadmenu-admin-box-text quadmenu-admin-box-three"> |
| 108 |
<h3><?php esc_html_e('Documentation', 'quadmenu'); ?></h3> |
| 109 |
<p> |
| 110 |
<?php esc_html_e('Our online documentation will give you important information about the plugin. This is an exceptional resource to start discovering the plugin’s true potential.', 'quadmenu'); ?> |
| 111 |
</p> |
| 112 |
<a class="button button-primary" href="<?php echo QUADMENU_DOCUMENTATION ?>" target="_blank"><?php esc_html_e('Open documentation', 'quadmenu'); ?></a> |
| 113 |
</div> |
| 114 |
<div class="quadmenu-admin-box-text quadmenu-admin-box-three quadmenu-admin-box-last"> |
| 115 |
<h3><?php esc_html_e('Demo', 'quadmenu'); ?></h3> |
| 116 |
<p> |
| 117 |
<?php esc_html_e('Thank you for choosing our mega menu plugin! Here you can see our demo content and some layout examples to explore the QuadMenu features.', 'quadmenu'); ?> |
| 118 |
</p> |
| 119 |
<a class="button button-primary" href="<?php echo QUADMENU_DEMO; ?>" target="_blank"><?php esc_html_e('View demo', 'quadmenu'); ?></a> |
| 120 |
</div> |
| 121 |
</div> |
| 122 |
|
| 123 |
<?php |
| 124 |
} |
| 125 |
|
| 126 |
function purchase() { |
| 127 |
$this->header(); |
| 128 |
?> |
| 129 |
<div class="about-wrap quadmenu-admin-wrap"> |
| 130 |
<div class="has-2-columns is-wider-left" style="max-width: 100%"> |
| 131 |
<div class="column"> |
| 132 |
<div class="quadmenu-welcome-header"> |
| 133 |
<h1><?php printf('<i class="dashicons dashicons-awards"></i> %s', __('Premium', 'quadmenu')); ?></h1> |
| 134 |
<div class="about-text"> |
| 135 |
<?php esc_html_e('Unlock the power of our premium mega menu plugin which offers you a variety of unique elements that allow you to highlight your website over the competitors and provide an standout navigability for your users.', 'quadmenu'); ?> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
<hr/> |
| 139 |
<div class="feature-section" style="padding: 10px 0;"> |
| 140 |
<h3><?php esc_html_e('Customizer', 'quadmenu'); ?></h3> |
| 141 |
<p> |
| 142 |
<?php esc_html_e('With the premium version, you\'ll receive a full integration with the live theme customizer dashboard. ', 'quadmenu'); ?> |
| 143 |
</p> |
| 144 |
<p> |
| 145 |
<?php esc_html_e('This is a very powerfull feature if you will include this plugin in your themes project, as this allows you and your end users to tweak all menu color scheme or layout settings and see the effect of that changes in real time.', 'quadmenu'); ?> |
| 146 |
</p> |
| 147 |
</div> |
| 148 |
</div> |
| 149 |
<div class="column"> |
| 150 |
<img src="<?php echo QUADMENU_URL_ASSETS; ?>backend/images/screenshot.png"> |
| 151 |
</div> |
| 152 |
</div> |
| 153 |
<hr/> |
| 154 |
<div class="has-2-columns is-wider-right" style="max-width: 100%"> |
| 155 |
<div class="column"> |
| 156 |
<img style="box-shadow: 0px 0px 20px 2px rgb(0,0,0,0.05);" src="<?php echo QUADMENU_URL_ASSETS; ?>backend/images/tabs.jpg"> |
| 157 |
</div> |
| 158 |
<div class="column"> |
| 159 |
<div class="feature-section" style="padding: 10px 0;"> |
| 160 |
<h3><?php esc_html_e('Tabs', 'quadmenu'); ?></h3> |
| 161 |
<p> |
| 162 |
<?php printf(__('With the tabs, you can <a href="%s">create a tab mega menu</a> where you can include widgets or any kind of content available in your menu dashboard.', 'quadmenu'), 'https://quadmenu.com/documentation/content/tabs/?utm_source=quadmenu_admin'); ?> |
| 163 |
</p> |
| 164 |
<p> |
| 165 |
<?php esc_html_e('This element is allows you to set a custom background for the whole dropdown and handle the title, icons, badges and subtitles on each tab.', 'quadmenu'); ?> |
| 166 |
</p> |
| 167 |
</div> |
| 168 |
</div> |
| 169 |
</div> |
| 170 |
<hr/> |
| 171 |
<div class="has-2-columns is-wider-left" style="max-width: 100%"> |
| 172 |
<div class="column"> |
| 173 |
<div class="feature-section" style="padding: 10px 0;"> |
| 174 |
<h3><?php esc_html_e('Carousel', 'quadmenu'); ?></h3> |
| 175 |
<p> |
| 176 |
<?php printf(__('Our carousel element allows you to create a <a href="%s">carousel mega menu</a> where you can include widgets or any kind of content available in your menu dashboard.', 'quadmenu'), 'https://quadmenu.com/documentation/content/carousel/?utm_source=quadmenu_admin'); ?> |
| 177 |
</p> |
| 178 |
<p> |
| 179 |
<?php printf(__('This element is also available for <a href="%s">categories and archives items</a> and lets you create a carousel of the latest\'s post, products, pages and any post type available in your site.', 'quadmenu'), 'https://quadmenu.com/documentation/content/archives/?utm_source=quadmenu_admin'); ?> |
| 180 |
</p> |
| 181 |
</div> |
| 182 |
</div> |
| 183 |
<div class="column"> |
| 184 |
<img style="box-shadow: 0px 0px 20px 2px rgb(0,0,0,0.05);" src="<?php echo QUADMENU_URL_ASSETS; ?>backend/images/carousel.jpg"> |
| 185 |
</div> |
| 186 |
</div> |
| 187 |
<hr/> |
| 188 |
<div class="has-2-columns is-wider-right" style="max-width: 100%"> |
| 189 |
<div class="column"> |
| 190 |
<img style="box-shadow: 0px 0px 20px 2px rgb(0,0,0,0.05);" src="<?php echo QUADMENU_URL_ASSETS; ?>backend/images/login.jpg"> |
| 191 |
</div> |
| 192 |
<div class="column"> |
| 193 |
<div class="feature-section" style="padding: 10px 0;"> |
| 194 |
<h3><?php esc_html_e('Login', 'quadmenu'); ?></h3> |
| 195 |
<p> |
| 196 |
<?php printf(__('The user login element provides your menu with a <a href="%s">login and register form</a> that is displayed in a drop-down. Recently we\'ve improved this feature to include a drop-down menu for logged in users where you can display any link and a quick access to the user account.', 'quadmenu'), 'https://quadmenu.com/documentation/content/login/?utm_source=quadmenu_admin'); ?> |
| 197 |
</p> |
| 198 |
</div> |
| 199 |
</div> |
| 200 |
</div> |
| 201 |
<hr/> |
| 202 |
<div class="has-2-columns is-wider-left" style="max-width: 100%"> |
| 203 |
<div class="column"> |
| 204 |
<div class="feature-section" style="padding: 10px 0;"> |
| 205 |
<h3><?php esc_html_e('Social', 'quadmenu'); ?></h3> |
| 206 |
<p> |
| 207 |
<?php esc_html_e('The social icons element allow you to include a list of social networks icons with links. There is a mode called toggle that shows an icon in the main menu that toggles the list when the user makes a click and other mode called embed that displays the entire icons list.', 'quadmenu'); ?> |
| 208 |
</p> |
| 209 |
</div> |
| 210 |
</div> |
| 211 |
<div class="column"> |
| 212 |
<img style="box-shadow: 0px 0px 20px 2px rgb(0,0,0,0.05);" src="<?php echo QUADMENU_URL_ASSETS; ?>backend/images/social.jpg"> |
| 213 |
</div> |
| 214 |
</div> |
| 215 |
<hr/> |
| 216 |
<div class="quadmenu-admin-box-text quadmenu-admin-box-three"> |
| 217 |
<h3><?php esc_html_e('Personal', 'quadmenu'); ?></h3> |
| 218 |
<p> |
| 219 |
<?php printf(__('The single or personal license allows you to install %s in one site, receive the premium support for six month and lifetime updates.', 'quadmenu'), QUADMENU_NAME); ?> |
| 220 |
</p> |
| 221 |
<a class="button button-primary" href="<?php echo QUADMENU_DEMO ?>" target="_blank"><?php esc_html_e('Purchase Now', 'quadmenu'); ?></a> |
| 222 |
</div> |
| 223 |
<div class="quadmenu-admin-box-text quadmenu-admin-box-three"> |
| 224 |
<h3><?php esc_html_e('Agency', 'quadmenu'); ?></h3> |
| 225 |
<p> |
| 226 |
<?php printf(__('The single or personal license allows you to install %s in one site, receive the premium support for six month and lifetime updates.', 'quadmenu'), QUADMENU_NAME); ?> |
| 227 |
</p> |
| 228 |
<a class="button button-primary" href="<?php echo QUADMENU_DEMO ?>" target="_blank"><?php esc_html_e('Purchase Now', 'quadmenu'); ?></a> |
| 229 |
</div> |
| 230 |
<div class="quadmenu-admin-box-text quadmenu-admin-box-three quadmenu-admin-box-last"> |
| 231 |
<h3><?php esc_html_e('Developer', 'quadmenu'); ?></h3> |
| 232 |
<p> |
| 233 |
<?php printf(__('The single or personal license allows you to install %s in one site, receive the premium support for six month and lifetime updates.', 'quadmenu'), QUADMENU_NAME); ?> |
| 234 |
</p> |
| 235 |
<a class="button button-primary" href="<?php echo QUADMENU_DEMO ?>" target="_blank"><?php esc_html_e('Purchase Now', 'quadmenu'); ?></a> |
| 236 |
</div> |
| 237 |
</div> |
| 238 |
|
| 239 |
<?php |
| 240 |
} |
| 241 |
|
| 242 |
function header() { |
| 243 |
require_once QUADMENU_PATH . 'includes/panel/header.php'; |
| 244 |
} |
| 245 |
|
| 246 |
function add($section, $status_array) { |
| 247 |
self::$status[$section][] = $status_array; |
| 248 |
} |
| 249 |
|
| 250 |
function tables() { |
| 251 |
foreach (self::$status as $section_name => $section_statuses) { |
| 252 |
?> |
| 253 |
<table class="widefat quadmenu-system-table" cellspacing="0"> |
| 254 |
<thead> |
| 255 |
<tr> |
| 256 |
<th colspan="4"><?php echo esc_html($section_name); ?></th> |
| 257 |
</tr> |
| 258 |
</thead> |
| 259 |
<tbody> |
| 260 |
<?php |
| 261 |
foreach ($section_statuses as $status_params) { |
| 262 |
?> |
| 263 |
<tr> |
| 264 |
<td class="quadmenu-system-name"><?php echo esc_html($status_params['check_name']); ?></td> |
| 265 |
<!--<td class="quadmenu-system-help"></td>--> |
| 266 |
<td class="quadmenu-system-status"> |
| 267 |
<?php |
| 268 |
switch ($status_params['status']) { |
| 269 |
case 'green': |
| 270 |
echo '<div class="quadmenu-system-led success" title="' . esc_html__('Green status: this check passed our system status test!', 'quadmenu') . '"></div>'; |
| 271 |
break; |
| 272 |
case 'yellow': |
| 273 |
echo '<div class="quadmenu-system-led warning" title="' . esc_html__('Yellow status: this setting may affect the backend of the site. The frontend should still run as expected. We recommend that you fix this.', 'quadmenu') . '"></div>'; |
| 274 |
break; |
| 275 |
case 'red' : |
| 276 |
echo '<div class="quadmenu-system-led critical" title="' . esc_html__('Red status: the site may not work as expected with this option.', 'quadmenu') . '"></div>'; |
| 277 |
break; |
| 278 |
case 'info': |
| 279 |
echo '<div class="quadmenu-system-led info title="' . esc_html__('Info status: this is just for information purposes and easier debug if a problem appears', 'quadmenu') . '">i</div>'; |
| 280 |
break; |
| 281 |
} |
| 282 |
?> |
| 283 |
</td> |
| 284 |
<td class="quadmenu-system-value"><?php |
| 285 |
echo wp_kses($status_params['value'], array( |
| 286 |
'a' => array( |
| 287 |
'href' => array(), |
| 288 |
'title' => array() |
| 289 |
), |
| 290 |
'br' => array(), |
| 291 |
'em' => array(), |
| 292 |
'strong' => array(), |
| 293 |
'span' => array(), |
| 294 |
)); |
| 295 |
?></td> |
| 296 |
</tr> |
| 297 |
<?php |
| 298 |
} |
| 299 |
?> |
| 300 |
</tbody> |
| 301 |
</table> |
| 302 |
<?php |
| 303 |
} |
| 304 |
} |
| 305 |
|
| 306 |
} |
| 307 |
|
| 308 |
new QuadMenu_Panel(); |
| 309 |
|