Version Description
- New: Allow menu location settings to be adjusted from the Mega Menu > Menu Locations page
- Fix: Trim "Panel Width" settings in theme editor to prevent attributes from being malformed
- Fix: Hover text decoration not applied when Icon Position is set to "Top"
- Fix: Divi reload bug, ensure sidebar is registered on front and back end
- Fix: collapsable sub menus open and close themselves in mobile view
Download this release
Release Info
Developer | megamenu |
Plugin | Max Mega Menu |
Version | 2.8 |
Comparing to | |
See all releases |
Code changes from version 2.7.7 to 2.8
- classes/nav-menus.class.php +9 -8
- classes/page.locations.class.php +1067 -0
- classes/settings.class.php +12 -375
- classes/widget-manager.class.php +0 -21
- css/admin/admin.css +150 -130
- css/admin/admin.scss +180 -143
- css/megamenu.scss +4 -0
- js/maxmegamenu.js +5 -0
- js/settings.js +2 -2
- megamenu.php +27 -4
- readme.txt +9 -1
classes/nav-menus.class.php
CHANGED
@@ -40,13 +40,13 @@ class Mega_Menu_Nav_Menus {
|
|
40 |
|
41 |
}
|
42 |
|
|
|
43 |
/**
|
44 |
* Constructor
|
45 |
*
|
46 |
* @since 1.0
|
47 |
*/
|
48 |
public function __construct() {
|
49 |
-
|
50 |
add_action( 'admin_init', array( $this, 'register_nav_meta_box' ), 9 );
|
51 |
add_action( 'megamenu_nav_menus_scripts', array( $this, 'enqueue_menu_page_scripts' ), 10 );
|
52 |
add_action( 'wp_ajax_mm_save_settings', array($this, 'save') );
|
@@ -148,16 +148,15 @@ class Mega_Menu_Nav_Menus {
|
|
148 |
|
149 |
}
|
150 |
|
151 |
-
|
152 |
/**
|
153 |
-
* Enqueue required CSS and JS for
|
154 |
*
|
155 |
* @since 1.0
|
156 |
*/
|
157 |
-
public function enqueue_menu_page_scripts($hook) {
|
158 |
-
|
159 |
-
if( 'nav-menus.php' != $hook )
|
160 |
return;
|
|
|
161 |
|
162 |
// Compatibility fix for SlideDeck Pro
|
163 |
wp_deregister_script('codemirror');
|
@@ -313,8 +312,10 @@ class Mega_Menu_Nav_Menus {
|
|
313 |
|
314 |
$locations = array_keys( $tagged_menu_locations );
|
315 |
$location = $locations[0];
|
|
|
316 |
|
317 |
-
if (isset( $tagged_menu_locations[ $location ] ) ) {
|
|
|
318 |
$this->settings_table( $location, $saved_settings );
|
319 |
}
|
320 |
|
@@ -323,7 +324,7 @@ class Mega_Menu_Nav_Menus {
|
|
323 |
<div id='megamenu_accordion'>
|
324 |
<?php foreach ( $theme_locations as $location => $name ) : ?>
|
325 |
<?php if ( isset( $tagged_menu_locations[ $location ] ) ): ?>
|
326 |
-
<
|
327 |
<div class='accordion_content' style='display: none;'>
|
328 |
<?php $this->settings_table( $location, $saved_settings ); ?>
|
329 |
</div>
|
40 |
|
41 |
}
|
42 |
|
43 |
+
|
44 |
/**
|
45 |
* Constructor
|
46 |
*
|
47 |
* @since 1.0
|
48 |
*/
|
49 |
public function __construct() {
|
|
|
50 |
add_action( 'admin_init', array( $this, 'register_nav_meta_box' ), 9 );
|
51 |
add_action( 'megamenu_nav_menus_scripts', array( $this, 'enqueue_menu_page_scripts' ), 10 );
|
52 |
add_action( 'wp_ajax_mm_save_settings', array($this, 'save') );
|
148 |
|
149 |
}
|
150 |
|
|
|
151 |
/**
|
152 |
+
* Enqueue required CSS and JS for the mega menu lightbox and meta options
|
153 |
*
|
154 |
* @since 1.0
|
155 |
*/
|
156 |
+
public function enqueue_menu_page_scripts( $hook ) {
|
157 |
+
if( ! in_array( $hook, array( 'nav-menus.php' ) ) ) {
|
|
|
158 |
return;
|
159 |
+
}
|
160 |
|
161 |
// Compatibility fix for SlideDeck Pro
|
162 |
wp_deregister_script('codemirror');
|
312 |
|
313 |
$locations = array_keys( $tagged_menu_locations );
|
314 |
$location = $locations[0];
|
315 |
+
$name = esc_html( $tagged_menu_locations[ $location ] );
|
316 |
|
317 |
+
if ( isset( $tagged_menu_locations[ $location ] ) ) {
|
318 |
+
echo "<h4><span class='dashicons dashicons-location'></span>{$name}</h4>";
|
319 |
$this->settings_table( $location, $saved_settings );
|
320 |
}
|
321 |
|
324 |
<div id='megamenu_accordion'>
|
325 |
<?php foreach ( $theme_locations as $location => $name ) : ?>
|
326 |
<?php if ( isset( $tagged_menu_locations[ $location ] ) ): ?>
|
327 |
+
<h4><span class='dashicons dashicons-location'></span><?php echo esc_html( $name ); ?></h4>
|
328 |
<div class='accordion_content' style='display: none;'>
|
329 |
<?php $this->settings_table( $location, $saved_settings ); ?>
|
330 |
</div>
|
classes/page.locations.class.php
ADDED
@@ -0,0 +1,1067 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // disable direct access
|
5 |
+
}
|
6 |
+
|
7 |
+
if ( ! class_exists( 'Mega_Menu_Menu_Locations' ) ) :
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Handles the Mega Menu > Menu Settings page
|
11 |
+
*/
|
12 |
+
class Mega_Menu_Menu_Locations {
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Constructor
|
17 |
+
*
|
18 |
+
* @since 2.8
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
add_action( 'admin_post_megamenu_add_menu_location', array( $this, 'add_menu_location') );
|
22 |
+
add_action( 'admin_post_megamenu_delete_menu_location', array( $this, 'delete_menu_location') );
|
23 |
+
add_action( 'admin_post_megamenu_save_menu_location', array( $this, 'save_menu_location') );
|
24 |
+
add_filter( 'megamenu_menu_tabs', array( $this, 'add_locations_tab' ), 999 );
|
25 |
+
add_action( 'megamenu_page_menu_locations', array( $this, 'menu_locations_page'));
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Add a new menu location.
|
31 |
+
*
|
32 |
+
* @since 2.8
|
33 |
+
*/
|
34 |
+
public function add_menu_location() {
|
35 |
+
check_admin_referer( 'megamenu_add_menu_location' );
|
36 |
+
|
37 |
+
$locations = get_option( 'megamenu_locations' );
|
38 |
+
$next_id = $this->get_next_menu_location_id();
|
39 |
+
$new_menu_location_id = "max_mega_menu_" . $next_id;
|
40 |
+
$locations[$new_menu_location_id] = "Max Mega Menu Location " . $next_id;
|
41 |
+
|
42 |
+
update_option( 'megamenu_locations', $locations );
|
43 |
+
|
44 |
+
do_action("megamenu_after_add_menu_location");
|
45 |
+
|
46 |
+
$redirect_url = add_query_arg(
|
47 |
+
array(
|
48 |
+
'page' => 'maxmegamenu_menu_locations',
|
49 |
+
'add_location' => 'true'
|
50 |
+
), admin_url("admin.php")
|
51 |
+
);
|
52 |
+
|
53 |
+
$this->redirect( $redirect_url );
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Delete a menu location.
|
60 |
+
*
|
61 |
+
* @since 2.8
|
62 |
+
*/
|
63 |
+
public function delete_menu_location() {
|
64 |
+
check_admin_referer( 'megamenu_delete_menu_location' );
|
65 |
+
|
66 |
+
$locations = get_option( 'megamenu_locations' );
|
67 |
+
$location_to_delete = esc_attr( $_GET['location'] );
|
68 |
+
|
69 |
+
if ( isset( $locations[ $location_to_delete ] ) ) {
|
70 |
+
unset( $locations[ $location_to_delete ] );
|
71 |
+
update_option( 'megamenu_locations', $locations );
|
72 |
+
}
|
73 |
+
|
74 |
+
do_action("megamenu_after_delete_menu_location");
|
75 |
+
do_action("megamenu_delete_cache");
|
76 |
+
|
77 |
+
$redirect_url = add_query_arg(
|
78 |
+
array(
|
79 |
+
'page' => 'maxmegamenu_menu_locations',
|
80 |
+
'delete_location' => 'true'
|
81 |
+
), admin_url("admin.php")
|
82 |
+
);
|
83 |
+
|
84 |
+
$this->redirect( $redirect_url );
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Save a menu location
|
90 |
+
*
|
91 |
+
* @since 2.0
|
92 |
+
*/
|
93 |
+
public function save_menu_location() {
|
94 |
+
check_admin_referer( 'megamenu_save_menu_location' );
|
95 |
+
|
96 |
+
$location = false;
|
97 |
+
|
98 |
+
if ( isset( $_POST['location'] ) ) {
|
99 |
+
$location = esc_attr( $_POST['location'] );
|
100 |
+
}
|
101 |
+
|
102 |
+
if ( $location ) {
|
103 |
+
$submitted_settings = apply_filters( "megamenu_submitted_settings_meta", $_POST['megamenu_meta'] );
|
104 |
+
|
105 |
+
if ( isset( $submitted_settings[$location]['enabled'] ) ) {
|
106 |
+
$submitted_settings[$location]['enabled'] = '1';
|
107 |
+
}
|
108 |
+
|
109 |
+
if ( ! get_option( 'megamenu_settings' ) ) {
|
110 |
+
update_option( 'megamenu_settings', $submitted_settings );
|
111 |
+
} else {
|
112 |
+
$existing_settings = get_option( 'megamenu_settings' );
|
113 |
+
$new_settings = array_merge( $existing_settings, $submitted_settings );
|
114 |
+
|
115 |
+
update_option( 'megamenu_settings', $new_settings );
|
116 |
+
}
|
117 |
+
|
118 |
+
do_action( "megamenu_after_save_settings" );
|
119 |
+
do_action( "megamenu_delete_cache" );
|
120 |
+
}
|
121 |
+
|
122 |
+
/* Save custom location description **/
|
123 |
+
if ( isset( $_POST['custom_location'] ) && is_array( $_POST['custom_location'] ) ) {
|
124 |
+
$location = array_map( 'sanitize_text_field', $_POST['custom_location'] );
|
125 |
+
$locations = get_option('megamenu_locations');
|
126 |
+
$new_locations = array_merge( (array)$locations, $location );
|
127 |
+
|
128 |
+
update_option( 'megamenu_locations', $new_locations );
|
129 |
+
}
|
130 |
+
|
131 |
+
$redirect_url = add_query_arg(
|
132 |
+
array(
|
133 |
+
'page' => 'maxmegamenu_menu_locations',
|
134 |
+
'location' => urlencode( $location ),
|
135 |
+
'save_location' => 'true'
|
136 |
+
), admin_url("admin.php")
|
137 |
+
);
|
138 |
+
|
139 |
+
$this->redirect( $redirect_url );
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Redirect and exit
|
145 |
+
*
|
146 |
+
* @since 2.8
|
147 |
+
*/
|
148 |
+
public function redirect( $url ) {
|
149 |
+
wp_redirect( $url );
|
150 |
+
exit;
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Returns the next available menu location ID
|
156 |
+
*
|
157 |
+
* @since 2.8
|
158 |
+
*/
|
159 |
+
public function get_next_menu_location_id() {
|
160 |
+
$last_id = 0;
|
161 |
+
|
162 |
+
if ( $locations = get_option( "megamenu_locations" ) ) {
|
163 |
+
foreach ( $locations as $key => $value ) {
|
164 |
+
if ( strpos( $key, 'max_mega_menu_' ) !== FALSE ) {
|
165 |
+
$parts = explode( "_", $key );
|
166 |
+
$menu_id = end( $parts );
|
167 |
+
|
168 |
+
if ($menu_id > $last_id) {
|
169 |
+
$last_id = $menu_id;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
$next_id = $last_id + 1;
|
176 |
+
|
177 |
+
return $next_id;
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Add the Menu Locations tab to our available tabs
|
183 |
+
*
|
184 |
+
* @param array $tabs
|
185 |
+
* @since 2.8
|
186 |
+
*/
|
187 |
+
public function add_locations_tab($tabs) {
|
188 |
+
|
189 |
+
$new_tabs = array();
|
190 |
+
$i = 0;
|
191 |
+
|
192 |
+
// array_splice() does not preserve keys
|
193 |
+
foreach ( $tabs as $index => $title ) {
|
194 |
+
$new_tabs[$index] = $title;
|
195 |
+
$i++;
|
196 |
+
|
197 |
+
if ( $i == 2 ) {
|
198 |
+
$new_tabs['menu_locations'] = __("Menu Locations", "megamenu");
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
return $new_tabs;
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Content for Menu Locations page
|
209 |
+
*
|
210 |
+
* @since 2.8
|
211 |
+
*/
|
212 |
+
public function menu_locations_page( $saved_settings ) {
|
213 |
+
$locations = $this->get_registered_locations();
|
214 |
+
|
215 |
+
?>
|
216 |
+
|
217 |
+
<div class='menu_settings menu_settings_menu_locations'>
|
218 |
+
|
219 |
+
<?php $this->print_messages(); ?>
|
220 |
+
|
221 |
+
<h3 class='first'><?php _e("Menu Locations", "megamenu"); ?></h3>
|
222 |
+
|
223 |
+
<table>
|
224 |
+
<tr>
|
225 |
+
<td class='mega-name'>
|
226 |
+
<?php _e("Registered Menu Locations", "megamenu"); ?>
|
227 |
+
<div class='mega-description'><?php _e("This is an overview of the menu locations supported by your theme.", "megamenu"); ?></div>
|
228 |
+
</td>
|
229 |
+
<td class='mega-value'>
|
230 |
+
<?php
|
231 |
+
|
232 |
+
if ( ! count( $locations ) ) {
|
233 |
+
echo "<p>";
|
234 |
+
_e("Your theme does not natively support menus, but you can add a new menu location using Max Mega Menu and display the menu using the Max Mega Menu widget or shortcode.", "megamenu");
|
235 |
+
echo "</p>";
|
236 |
+
} else {
|
237 |
+
|
238 |
+
echo "<div class='accordion-container'>";
|
239 |
+
echo "<ul class='outer-border'>";
|
240 |
+
|
241 |
+
foreach ( $locations as $location => $description ) {
|
242 |
+
$open_class = ( isset( $_GET['location'] ) && $_GET['location'] == $location ) ? "open" : "";
|
243 |
+
$is_enabled_class = "mega-location-disabled";
|
244 |
+
|
245 |
+
if ( max_mega_menu_is_enabled( $location ) ) {
|
246 |
+
$is_enabled_class = "mega-location-enabled";
|
247 |
+
} else if ( ! has_nav_menu( $location ) ) {
|
248 |
+
$is_enabled_class = "mega-location-disabled-assign-menu";
|
249 |
+
}
|
250 |
+
|
251 |
+
?>
|
252 |
+
|
253 |
+
<li class='control-section accordion-section mega-location <?php echo $open_class ?> <?php echo $is_enabled_class ?>'>
|
254 |
+
<h4 class='accordion-section-title hndle'>
|
255 |
+
<span class='dashicons dashicons-location'></span><?php echo esc_attr( $description ) ?><span class='dashicons dashicons-yes'></span>
|
256 |
+
</h4>
|
257 |
+
<div class='accordion-section-content'>
|
258 |
+
<?php
|
259 |
+
// if no menu has been assigned to the location
|
260 |
+
if ( ! has_nav_menu( $location ) ) {
|
261 |
+
echo "<p class='notice warning'>";
|
262 |
+
echo __("This location does not have a menu assigned to it.", "megamenu");
|
263 |
+
echo " <a href='" . admin_url("nav-menus.php?action=locations") . "'>" . __("Assign a menu", "megamenu") . "</a>";
|
264 |
+
echo "</p>";
|
265 |
+
} else {
|
266 |
+
$this->show_assigned_menu( $location );
|
267 |
+
$this->show_menu_locations_options( $locations, $location );
|
268 |
+
}
|
269 |
+
?>
|
270 |
+
</div>
|
271 |
+
</li>
|
272 |
+
<?php
|
273 |
+
}
|
274 |
+
echo "</div>";
|
275 |
+
echo "</div>";
|
276 |
+
}
|
277 |
+
|
278 |
+
$add_location_url = esc_url( add_query_arg(
|
279 |
+
array(
|
280 |
+
'action'=>'megamenu_add_menu_location'
|
281 |
+
),
|
282 |
+
wp_nonce_url( admin_url("admin-post.php"), 'megamenu_add_menu_location' )
|
283 |
+
) );
|
284 |
+
|
285 |
+
echo "<p><a class='mega-add-location' href='{$add_location_url}'><span class='dashicons dashicons-plus'></span>" . __("Add another menu location", "megamenu") . "</a></p>";
|
286 |
+
?>
|
287 |
+
|
288 |
+
</td>
|
289 |
+
</tr>
|
290 |
+
</table>
|
291 |
+
|
292 |
+
<?php do_action( "megamenu_menu_locations", $saved_settings ); ?>
|
293 |
+
|
294 |
+
</div>
|
295 |
+
|
296 |
+
<?php
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Display a link showing the menu assigned to the specified location
|
302 |
+
*
|
303 |
+
* @param string $location
|
304 |
+
* @since 2.8
|
305 |
+
*/
|
306 |
+
public function show_assigned_menu( $location ) {
|
307 |
+
|
308 |
+
$menu_id = $this->get_menu_id_for_location( $location );
|
309 |
+
|
310 |
+
if ($menu_id) {
|
311 |
+
echo "<div class='mega-assigned-menu'>";
|
312 |
+
echo "<a href='" . admin_url("nav-menus.php?action=edit&menu={$menu_id}") . "'><span class='dashicons dashicons-menu-alt2'></span>" . $this->get_menu_name_for_location( $location ) . "</a>";
|
313 |
+
echo "</div>";
|
314 |
+
} else {
|
315 |
+
echo "<div class='mega-assigned-menu'>";
|
316 |
+
echo "<a href='" . admin_url("nav-menus.php?action=locations") . "'><span class='dashicons dashicons-menu-alt2'></span>" . __("Assign a menu", "megamenu") . "</a>";
|
317 |
+
echo "</div>";
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Content for Menu Location options
|
323 |
+
*
|
324 |
+
* @since 2.8
|
325 |
+
*/
|
326 |
+
public function show_menu_locations_options( $all_locations, $location ) {
|
327 |
+
|
328 |
+
$description = $all_locations[$location];
|
329 |
+
$menu_id = $this->get_menu_id_for_location( $location );
|
330 |
+
$is_custom_location = strpos( $location, 'max_mega_menu_' ) !== FALSE;
|
331 |
+
$plugin_settings = get_option( 'megamenu_settings' );
|
332 |
+
$location_settings = isset( $plugin_settings[$location] ) ? $plugin_settings[$location] : array();
|
333 |
+
|
334 |
+
?>
|
335 |
+
|
336 |
+
<form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
|
337 |
+
<input type="hidden" name="action" value="megamenu_save_menu_location" />
|
338 |
+
<input type="hidden" name="location" value="<?php echo esc_attr($location) ?>" />
|
339 |
+
<?php wp_nonce_field( 'megamenu_save_menu_location' ); ?>
|
340 |
+
|
341 |
+
<?php
|
342 |
+
|
343 |
+
$settings = apply_filters( 'megamenu_location_settings', array(
|
344 |
+
|
345 |
+
'general' => array(
|
346 |
+
'priority' => 10,
|
347 |
+
'title' => __( "General Settings", "megamenu" ),
|
348 |
+
'settings' => array(
|
349 |
+
'enabled' => array(
|
350 |
+
'priority' => 10,
|
351 |
+
'title' => __( "Enabled", "megamenu" ),
|
352 |
+
'description' => __( "Enable Max Mega Menu for this menu location?", "megamenu" ),
|
353 |
+
'settings' => array(
|
354 |
+
array(
|
355 |
+
'type' => 'checkbox_enabled',
|
356 |
+
'key' => 'enabled',
|
357 |
+
'value' => isset ( $location_settings['enabled'] ) ? $location_settings['enabled'] : 0
|
358 |
+
)
|
359 |
+
)
|
360 |
+
),
|
361 |
+
'event' => array(
|
362 |
+
'priority' => 20,
|
363 |
+
'title' => __( "Event", "megamenu" ),
|
364 |
+
'description' => __( "Select the event to trigger sub menus", "megamenu" ),
|
365 |
+
'settings' => array(
|
366 |
+
array(
|
367 |
+
'type' => 'event',
|
368 |
+
'key' => 'event',
|
369 |
+
'value' => isset( $location_settings['event'] ) ? $location_settings['event'] : 'hover'
|
370 |
+
)
|
371 |
+
)
|
372 |
+
),
|
373 |
+
'effect' => array(
|
374 |
+
'priority' => 30,
|
375 |
+
'title' => __( "Effect", "megamenu" ),
|
376 |
+
'description' => __( "Select the sub menu animation type", "megamenu" ),
|
377 |
+
'settings' => array(
|
378 |
+
array(
|
379 |
+
'type' => 'effect',
|
380 |
+
'key' => 'effect',
|
381 |
+
'value' => isset( $location_settings['effect'] ) ? $location_settings['effect'] : 'fade_up',
|
382 |
+
'title' => __("Animation")
|
383 |
+
),
|
384 |
+
array(
|
385 |
+
'type' => 'effect_speed',
|
386 |
+
'key' => 'effect_speed',
|
387 |
+
'value' => isset( $location_settings['effect_speed'] ) ? $location_settings['effect_speed'] : '200',
|
388 |
+
'title' => __("Speed")
|
389 |
+
)
|
390 |
+
)
|
391 |
+
),
|
392 |
+
'effect_mobile' => array(
|
393 |
+
'priority' => 40,
|
394 |
+
'title' => __( "Effect (Mobile)", "megamenu" ),
|
395 |
+
'description' => __( "Choose a style for your mobile menu", "megamenu" ),
|
396 |
+
'settings' => array(
|
397 |
+
array(
|
398 |
+
'type' => 'effect_mobile',
|
399 |
+
'key' => 'effect_mobile',
|
400 |
+
'value' => isset( $location_settings['effect_mobile'] ) ? $location_settings['effect_mobile'] : 'none',
|
401 |
+
'title' => __("Style")
|
402 |
+
),
|
403 |
+
array(
|
404 |
+
'type' => 'effect_speed_mobile',
|
405 |
+
'key' => 'effect_speed_mobile',
|
406 |
+
'value' => isset( $location_settings['effect_speed_mobile'] ) ? $location_settings['effect_speed_mobile'] : '200',
|
407 |
+
'title' => __("Speed")
|
408 |
+
)
|
409 |
+
)
|
410 |
+
),
|
411 |
+
'theme' => array(
|
412 |
+
'priority' => 50,
|
413 |
+
'title' => __( "Theme", "megamenu" ),
|
414 |
+
'description' => __( "Select a theme to be applied to the menu", "megamenu" ),
|
415 |
+
'settings' => array(
|
416 |
+
array(
|
417 |
+
'type' => 'theme_selector',
|
418 |
+
'key' => 'theme',
|
419 |
+
'value' => isset( $location_settings['theme'] ) ? $location_settings['theme'] : 'default'
|
420 |
+
)
|
421 |
+
)
|
422 |
+
)
|
423 |
+
)
|
424 |
+
),
|
425 |
+
'output_options' => array(
|
426 |
+
'priority' => 30,
|
427 |
+
'title' => __( "Menu Output Options", "megamenu" ),
|
428 |
+
'settings' => array(
|
429 |
+
'location_php_function' => array(
|
430 |
+
'priority' => 10,
|
431 |
+
'title' => __( "PHP Function", "megamenu" ),
|
432 |
+
'description' => __( "For use in a theme template (usually header.php)", "megamenu" ),
|
433 |
+
'settings' => array(
|
434 |
+
array(
|
435 |
+
'type' => 'location_php_function',
|
436 |
+
'key' => 'location_php_function',
|
437 |
+
'value' => $location
|
438 |
+
)
|
439 |
+
)
|
440 |
+
),
|
441 |
+
'location_shortcode' => array(
|
442 |
+
'priority' => 20,
|
443 |
+
'title' => __( "Shortcode", "megamenu" ),
|
444 |
+
'description' => __( "For use in a post or page.", "megamenu" ),
|
445 |
+
'settings' => array(
|
446 |
+
array(
|
447 |
+
'type' => 'location_shortcode',
|
448 |
+
'key' => 'location_shortcode',
|
449 |
+
'value' => $location
|
450 |
+
)
|
451 |
+
)
|
452 |
+
),
|
453 |
+
'location_widget' => array(
|
454 |
+
'priority' => 30,
|
455 |
+
'title' => __( "Widget", "megamenu" ),
|
456 |
+
'description' => __( "For use in a widget area.", "megamenu" ),
|
457 |
+
'settings' => array(
|
458 |
+
array(
|
459 |
+
'type' => 'location_widget',
|
460 |
+
'key' => 'location_widget',
|
461 |
+
'value' => $location
|
462 |
+
)
|
463 |
+
)
|
464 |
+
),
|
465 |
+
)
|
466 |
+
)
|
467 |
+
), $location, $plugin_settings );
|
468 |
+
|
469 |
+
|
470 |
+
if ( $is_custom_location ) {
|
471 |
+
|
472 |
+
$settings['general']['settings']['location_description'] = array(
|
473 |
+
'priority' => 15,
|
474 |
+
'title' => __( "Location Description", "megamenu" ),
|
475 |
+
'description' => __( "Update the custom location description", "megamenu" ),
|
476 |
+
'settings' => array(
|
477 |
+
array(
|
478 |
+
'type' => 'location_description',
|
479 |
+
'key' => 'location_description',
|
480 |
+
'value' => $description
|
481 |
+
)
|
482 |
+
)
|
483 |
+
);
|
484 |
+
}
|
485 |
+
|
486 |
+
echo "<div class='accordion-wrapper'>";
|
487 |
+
|
488 |
+
echo "<h2 class='nav-tab-wrapper'>";
|
489 |
+
|
490 |
+
$is_first = true;
|
491 |
+
|
492 |
+
uasort( $settings, array( $this, "compare_elems" ) );
|
493 |
+
|
494 |
+
foreach ( $settings as $section_id => $section ) {
|
495 |
+
|
496 |
+
if ($is_first) {
|
497 |
+
$active = 'nav-tab-active ';
|
498 |
+
$is_first = false;
|
499 |
+
} else {
|
500 |
+
$active = '';
|
501 |
+
}
|
502 |
+
|
503 |
+
echo "<a class='mega-tab nav-tab {$active}' data-tab='mega-tab-content-{$section_id}'>" . $section['title'] . "</a>";
|
504 |
+
|
505 |
+
}
|
506 |
+
|
507 |
+
echo "</h2>";
|
508 |
+
|
509 |
+
$is_first = true;
|
510 |
+
|
511 |
+
foreach ( $settings as $section_id => $section ) {
|
512 |
+
|
513 |
+
if ($is_first) {
|
514 |
+
$display = 'block';
|
515 |
+
$is_first = false;
|
516 |
+
} else {
|
517 |
+
$display = 'none';
|
518 |
+
}
|
519 |
+
|
520 |
+
echo "<div class='mega-tab-content mega-tab-content-{$section_id}' style='display: {$display}'>";
|
521 |
+
|
522 |
+
if ( $section_id == 'output_options' && ! $is_custom_location ) {
|
523 |
+
echo "<p class='notice warning'>" . __("These options are for advanced users only. Your theme should already include the code required to display this menu location on your site.", "megamenu") . "</p>";
|
524 |
+
}
|
525 |
+
|
526 |
+
echo " <table class='{$section_id}'>";
|
527 |
+
|
528 |
+
// order the fields by priority
|
529 |
+
uasort( $section['settings'], array( $this, "compare_elems" ) );
|
530 |
+
|
531 |
+
foreach ( $section['settings'] as $group_id => $group ) {
|
532 |
+
|
533 |
+
echo "<tr class='" . esc_attr( "mega-" . $group_id ) . "'>";
|
534 |
+
|
535 |
+
if ( isset( $group['settings'] ) ) {
|
536 |
+
|
537 |
+
echo "<td class='mega-name'>" . esc_html( $group['title'] ) . "<div class='mega-description'>" . esc_html( $group['description'] ) . "</div></td>";
|
538 |
+
echo "<td class='mega-value'>";
|
539 |
+
|
540 |
+
foreach ( $group['settings'] as $setting_id => $setting ) {
|
541 |
+
|
542 |
+
echo "<label class='" . esc_attr( "mega-" . $setting['key'] ) . "'>";
|
543 |
+
|
544 |
+
if ( isset( $setting['title'] ) ) {
|
545 |
+
echo "<span class='mega-short-desc'>" . esc_html( $setting['title'] ) . "</span>";
|
546 |
+
}
|
547 |
+
|
548 |
+
switch ( $setting['type'] ) {
|
549 |
+
case "freetext":
|
550 |
+
$this->print_location_freetext_option( $location, $setting['key'], $setting['value'] );
|
551 |
+
break;
|
552 |
+
case "textarea":
|
553 |
+
$this->print_location_textarea_option( $location, $setting['key'] );
|
554 |
+
break;
|
555 |
+
case "checkbox_enabled":
|
556 |
+
$this->print_location_enabled_option( $location, $setting['key'], $setting['value'] );
|
557 |
+
break;
|
558 |
+
case "event":
|
559 |
+
$this->print_location_event_option( $location, $setting['key'], $setting['value'] );
|
560 |
+
break;
|
561 |
+
case "effect":
|
562 |
+
$this->print_location_effect_option( $location, $setting['key'], $setting['value'] );
|
563 |
+
break;
|
564 |
+
case "effect_speed":
|
565 |
+
$this->print_location_effect_speed_option( $location, $setting['key'], $setting['value'] );
|
566 |
+
break;
|
567 |
+
case "effect_mobile":
|
568 |
+
$this->print_location_effect_mobile_option( $location, $setting['key'], $setting['value'] );
|
569 |
+
break;
|
570 |
+
case "effect_speed_mobile":
|
571 |
+
$this->print_location_effect_speed_mobile_option( $location, $setting['key'], $setting['value'] );
|
572 |
+
break;
|
573 |
+
case "theme_selector":
|
574 |
+
$this->print_location_theme_selector_option( $location, $setting['key'], $setting['value'] );
|
575 |
+
break;
|
576 |
+
case "location_description":
|
577 |
+
$this->print_location_description_option( $location, $setting['key'], $setting['value'] );
|
578 |
+
break;
|
579 |
+
case "checkbox":
|
580 |
+
$this->print_location_checkbox_option( $location, $setting['key'], $setting['value'] );
|
581 |
+
break;
|
582 |
+
case "location_php_function":
|
583 |
+
$this->print_location_php_function_option( $location, $setting['value'] );
|
584 |
+
break;
|
585 |
+
case "location_shortcode":
|
586 |
+
$this->print_location_shortcode_option( $location, $setting['value'] );
|
587 |
+
break;
|
588 |
+
case "location_widget":
|
589 |
+
$this->print_location_widget_option( $location, $setting['key'], $setting['value'] );
|
590 |
+
break;
|
591 |
+
default:
|
592 |
+
do_action("megamenu_print_location_option_{$setting['type']}", $setting['key'], $this->id );
|
593 |
+
break;
|
594 |
+
}
|
595 |
+
|
596 |
+
echo "</label>";
|
597 |
+
|
598 |
+
}
|
599 |
+
|
600 |
+
if ( isset( $group['info'] ) ) {
|
601 |
+
foreach ( $group['info'] as $paragraph ) {
|
602 |
+
echo "<div class='mega-info'>{$paragraph}</div>";
|
603 |
+
}
|
604 |
+
}
|
605 |
+
|
606 |
+
echo "</td>";
|
607 |
+
} else {
|
608 |
+
echo "<td colspan='2'><h5>{$group['title']}</h5></td>";
|
609 |
+
}
|
610 |
+
echo "</tr>";
|
611 |
+
|
612 |
+
}
|
613 |
+
|
614 |
+
if ( $section_id == 'general' ) {
|
615 |
+
do_action( 'megamenu_settings_table', $location, $plugin_settings );
|
616 |
+
}
|
617 |
+
|
618 |
+
echo "</table>";
|
619 |
+
echo "</div>";
|
620 |
+
}
|
621 |
+
|
622 |
+
?>
|
623 |
+
|
624 |
+
</div>
|
625 |
+
<div class='megamenu_submit'>
|
626 |
+
<div class='mega_left'>
|
627 |
+
<?php submit_button( $text = null ); ?>
|
628 |
+
</div>
|
629 |
+
<div class='mega_right'>
|
630 |
+
<?php
|
631 |
+
if ( $is_custom_location ) {
|
632 |
+
|
633 |
+
$delete_location_url = esc_url( add_query_arg(
|
634 |
+
array(
|
635 |
+
'action' => 'megamenu_delete_menu_location',
|
636 |
+
'location' => $location
|
637 |
+
),
|
638 |
+
wp_nonce_url( admin_url("admin-post.php"), 'megamenu_delete_menu_location' )
|
639 |
+
) );
|
640 |
+
|
641 |
+
echo "<a class='confirm mega-delete' href='{$delete_location_url}'>" . __("Delete location", "megamenu") . "</a>";
|
642 |
+
|
643 |
+
}
|
644 |
+
?>
|
645 |
+
</div>
|
646 |
+
</div>
|
647 |
+
</form>
|
648 |
+
|
649 |
+
<?php
|
650 |
+
}
|
651 |
+
|
652 |
+
|
653 |
+
/**
|
654 |
+
* Return a list of all registed menu locations
|
655 |
+
*
|
656 |
+
* @since 2.8
|
657 |
+
* @return array
|
658 |
+
*/
|
659 |
+
public function get_registered_locations() {
|
660 |
+
$all_locations = get_registered_nav_menus();
|
661 |
+
|
662 |
+
// PolyLang - remove auto created/translated menu locations
|
663 |
+
if ( function_exists( 'pll_default_language' ) ) {
|
664 |
+
$default_lang = pll_default_language( 'name' );
|
665 |
+
|
666 |
+
foreach ( $all_locations as $loc => $description ) {
|
667 |
+
if ( false !== strpos( $loc, '___' ) ) {
|
668 |
+
// Remove locations created by Polylang
|
669 |
+
unregister_nav_menu( $loc );
|
670 |
+
} else {
|
671 |
+
// Remove the language name appended to the original locations
|
672 |
+
register_nav_menu( $loc, str_replace( ' ' . $default_lang, '', $description ) );
|
673 |
+
}
|
674 |
+
}
|
675 |
+
|
676 |
+
$all_locations = get_registered_nav_menus();
|
677 |
+
}
|
678 |
+
|
679 |
+
$locations = array();
|
680 |
+
|
681 |
+
$custom_locations = get_option( 'megamenu_locations' );
|
682 |
+
|
683 |
+
if ( is_array( $custom_locations ) ) {
|
684 |
+
$all_locations = array_merge( $custom_locations, $all_locations );
|
685 |
+
}
|
686 |
+
|
687 |
+
if ( count( $all_locations ) ) {
|
688 |
+
|
689 |
+
$megamenu_locations = array();
|
690 |
+
|
691 |
+
// reorder locations so custom MMM locations are listed at the bottom
|
692 |
+
foreach ( $all_locations as $location => $val ) {
|
693 |
+
|
694 |
+
if ( strpos( $location, 'max_mega_menu_' ) === FALSE ) {
|
695 |
+
$locations[$location] = $val;
|
696 |
+
} else {
|
697 |
+
$megamenu_locations[$location] = $val;
|
698 |
+
}
|
699 |
+
|
700 |
+
}
|
701 |
+
|
702 |
+
$locations = array_merge( $locations, $megamenu_locations );
|
703 |
+
}
|
704 |
+
|
705 |
+
return $locations;
|
706 |
+
}
|
707 |
+
|
708 |
+
|
709 |
+
/**
|
710 |
+
* Returns the menu ID for a specified menu location, defaults to 0
|
711 |
+
*
|
712 |
+
* @since 2.8
|
713 |
+
* @param string $location
|
714 |
+
*/
|
715 |
+
private function get_menu_id_for_location( $location ) {
|
716 |
+
|
717 |
+
$locations = get_nav_menu_locations();
|
718 |
+
|
719 |
+
$id = isset( $locations[ $location ] ) ? $locations[ $location ] : 0;
|
720 |
+
|
721 |
+
return $id;
|
722 |
+
|
723 |
+
}
|
724 |
+
|
725 |
+
|
726 |
+
/**
|
727 |
+
* Returns the menu name for a specified menu location
|
728 |
+
*
|
729 |
+
* @since 2.8
|
730 |
+
* @param string $location
|
731 |
+
*/
|
732 |
+
private function get_menu_name_for_location( $location ) {
|
733 |
+
|
734 |
+
$id = $this->get_menu_id_for_location( $location );
|
735 |
+
|
736 |
+
$menus = wp_get_nav_menus();
|
737 |
+
|
738 |
+
foreach ( $menus as $menu ) {
|
739 |
+
if ( $menu->term_id == $id ) {
|
740 |
+
return $menu->name;
|
741 |
+
}
|
742 |
+
}
|
743 |
+
|
744 |
+
return false;
|
745 |
+
}
|
746 |
+
|
747 |
+
|
748 |
+
/**
|
749 |
+
* Display messages to the user
|
750 |
+
*
|
751 |
+
* @since 2.0
|
752 |
+
*/
|
753 |
+
public function print_messages() {
|
754 |
+
|
755 |
+
if ( isset( $_GET['add_location'] ) ) {
|
756 |
+
echo "<p class='success'>" . __("New Menu Location Created", "megamenu") . "</p>";
|
757 |
+
}
|
758 |
+
|
759 |
+
if ( isset( $_GET['delete_location'] ) ) {
|
760 |
+
echo "<p class='success'>" . __("Menu Location Deleted", "megamenu") . "</p>";
|
761 |
+
}
|
762 |
+
|
763 |
+
if ( isset( $_GET['save_location'] ) ) {
|
764 |
+
echo "<p class='success'>" . __("Menu Location Saved", "megamenu") . "</p>";
|
765 |
+
}
|
766 |
+
|
767 |
+
}
|
768 |
+
|
769 |
+
|
770 |
+
/**
|
771 |
+
* Print a checkbox option for enabling/disabling MMM for a specific location
|
772 |
+
*
|
773 |
+
* @since 2.8
|
774 |
+
* @param string $key
|
775 |
+
* @param string $value
|
776 |
+
*/
|
777 |
+
public function print_location_enabled_option( $location, $key, $value ) {
|
778 |
+
?>
|
779 |
+
<input type='checkbox' name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]' <?php checked( $value, '1' ); ?> />
|
780 |
+
<?php
|
781 |
+
}
|
782 |
+
|
783 |
+
|
784 |
+
/**
|
785 |
+
* Print a generic checkbox option
|
786 |
+
*
|
787 |
+
* @since 2.8
|
788 |
+
* @param string $key
|
789 |
+
* @param string $value
|
790 |
+
*/
|
791 |
+
public function print_location_checkbox_option( $location, $key, $value ) {
|
792 |
+
?>
|
793 |
+
<input type='checkbox' value='true' name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]' <?php checked( $value, "true" ); ?> />
|
794 |
+
<?php
|
795 |
+
}
|
796 |
+
|
797 |
+
|
798 |
+
/**
|
799 |
+
* Print a select box containing all available sub menu trigger events
|
800 |
+
*
|
801 |
+
* @since 2.8
|
802 |
+
* @param string $key
|
803 |
+
* @param string $value
|
804 |
+
*/
|
805 |
+
public function print_location_event_option( $location, $key, $value ) {
|
806 |
+
|
807 |
+
$options = apply_filters( "megamenu_event_options", array(
|
808 |
+
'hover' => __("Hover Intent", "megamenu"),
|
809 |
+
'hover_' => __("Hover", "megamenu"),
|
810 |
+
'click' => __("Click", "megamenu")
|
811 |
+
) );
|
812 |
+
|
813 |
+
echo "<select name='megamenu_meta[$location][$key]'>";
|
814 |
+
|
815 |
+
foreach ( $options as $type => $name ) {
|
816 |
+
echo "<option value='" . esc_attr( $type ) . "' " . selected( $value, $type, false ) . ">" . esc_html( $name ) . "</option>";
|
817 |
+
}
|
818 |
+
|
819 |
+
echo "</select>";
|
820 |
+
|
821 |
+
}
|
822 |
+
|
823 |
+
/**
|
824 |
+
* Print a select box containing all available sub menu animation options
|
825 |
+
*
|
826 |
+
* @since 2.8
|
827 |
+
* @param string $key
|
828 |
+
* @param string $value
|
829 |
+
*/
|
830 |
+
public function print_location_effect_option( $location, $key, $value ) {
|
831 |
+
|
832 |
+
echo "<select name='" . esc_attr( "megamenu_meta[$location][$key]" ) . "'>";
|
833 |
+
|
834 |
+
$selected = strlen( $value ) ? $value : 'fade_up';
|
835 |
+
|
836 |
+
$options = apply_filters("megamenu_transition_effects", array(
|
837 |
+
"disabled" => array(
|
838 |
+
'label' => __("None", "megamenu"),
|
839 |
+
'selected' => $selected == 'disabled',
|
840 |
+
),
|
841 |
+
"fade" => array(
|
842 |
+
'label' => __("Fade", "megamenu"),
|
843 |
+
'selected' => $selected == 'fade',
|
844 |
+
),
|
845 |
+
"fade_up" => array(
|
846 |
+
'label' => __("Fade Up", "megamenu"),
|
847 |
+
'selected' => $selected == 'fade_up' || $selected == 'fadeUp',
|
848 |
+
),
|
849 |
+
"slide" => array(
|
850 |
+
'label' => __("Slide", "megamenu"),
|
851 |
+
'selected' => $selected == 'slide',
|
852 |
+
),
|
853 |
+
"slide_up" => array(
|
854 |
+
'label' => __("Slide Up", "megamenu"),
|
855 |
+
'selected' => $selected == 'slide_up',
|
856 |
+
)
|
857 |
+
), $selected );
|
858 |
+
|
859 |
+
foreach ( $options as $key => $value ) {
|
860 |
+
echo "<option value='" . esc_attr( $key ) . "' " . selected( $value['selected'] ) . ">" . esc_html( $value['label'] ) . "</option>";
|
861 |
+
}
|
862 |
+
|
863 |
+
echo "</select>";
|
864 |
+
|
865 |
+
}
|
866 |
+
|
867 |
+
|
868 |
+
/**
|
869 |
+
* Print a select box containing all available effect speeds (desktop)
|
870 |
+
*
|
871 |
+
* @since 2.8
|
872 |
+
* @param string $key
|
873 |
+
* @param string $value
|
874 |
+
*/
|
875 |
+
public function print_location_effect_speed_option( $location, $key, $value ) {
|
876 |
+
echo "<select name='" . esc_attr( "megamenu_meta[$location][$key]" ) . "'>";
|
877 |
+
|
878 |
+
$selected = strlen( $value ) ? $value : '200';
|
879 |
+
|
880 |
+
$options = apply_filters("megamenu_effect_speed", array(
|
881 |
+
"600" => __("Slow", "megamenu"),
|
882 |
+
"400" => __("Med", "megamenu"),
|
883 |
+
"200" => __("Fast", "megamenu")
|
884 |
+
), $selected );
|
885 |
+
|
886 |
+
ksort($options);
|
887 |
+
|
888 |
+
foreach ( $options as $key => $value ) {
|
889 |
+
echo "<option value='" . esc_attr( $key ) . "' " . selected( $selected, $key ) . ">" . esc_html( $value ) . "</option>";
|
890 |
+
}
|
891 |
+
|
892 |
+
echo "</select>";
|
893 |
+
|
894 |
+
}
|
895 |
+
|
896 |
+
|
897 |
+
/**
|
898 |
+
* Print the textbox containing the various mobile menu options
|
899 |
+
*
|
900 |
+
* @since 2.8
|
901 |
+
* @param string $key
|
902 |
+
* @param string $value
|
903 |
+
*/
|
904 |
+
public function print_location_effect_mobile_option( $location, $key, $value ) {
|
905 |
+
echo "<select name='" . esc_attr( "megamenu_meta[$location][$key]" ) . "'>";
|
906 |
+
|
907 |
+
$selected = strlen( $value ) ? $value : 'disabled';
|
908 |
+
|
909 |
+
$options = apply_filters("megamenu_transition_effects_mobile", array(
|
910 |
+
"disabled" => array(
|
911 |
+
'label' => __("None", "megamenu"),
|
912 |
+
'selected' => $selected == 'disabled',
|
913 |
+
),
|
914 |
+
"slide" => array(
|
915 |
+
'label' => __("Slide Down", "megamenu"),
|
916 |
+
'selected' => $selected == 'slide',
|
917 |
+
),
|
918 |
+
"slide_left" => array(
|
919 |
+
'label' => __("Slide Left (Off Canvas)", "megamenu"),
|
920 |
+
'selected' => $selected == 'slide_left',
|
921 |
+
),
|
922 |
+
"slide_right" => array(
|
923 |
+
'label' => __("Slide Right (Off Canvas)", "megamenu"),
|
924 |
+
'selected' => $selected == 'slide_right',
|
925 |
+
)
|
926 |
+
), $selected );
|
927 |
+
|
928 |
+
foreach ( $options as $key => $value ) {
|
929 |
+
echo "<option value='" . esc_attr( $key ) . "' " . selected( $value['selected'] ) . ">" . esc_html( $value['label'] ) . "</option>";
|
930 |
+
}
|
931 |
+
|
932 |
+
echo "</select>";
|
933 |
+
|
934 |
+
}
|
935 |
+
|
936 |
+
|
937 |
+
/**
|
938 |
+
* Print a select box containing all available effect speeds (mobile)
|
939 |
+
*
|
940 |
+
* @since 2.8
|
941 |
+
* @param string $key
|
942 |
+
* @param string $value
|
943 |
+
*/
|
944 |
+
public function print_location_effect_speed_mobile_option( $location, $key, $value ) {
|
945 |
+
echo "<select name='" . esc_attr( "megamenu_meta[$location][$key]" ) . "'>";
|
946 |
+
|
947 |
+
$selected = strlen( $value ) ? $value : '200';
|
948 |
+
|
949 |
+
$options = apply_filters("megamenu_effect_speed_mobile", array(
|
950 |
+
"600" => __("Slow", "megamenu"),
|
951 |
+
"400" => __("Med", "megamenu"),
|
952 |
+
"200" => __("Fast", "megamenu")
|
953 |
+
), $selected );
|
954 |
+
|
955 |
+
ksort($options);
|
956 |
+
|
957 |
+
foreach ( $options as $key => $value ) {
|
958 |
+
echo "<option value='" . esc_attr( $key ) . "' " . selected( $selected, $key ) . ">" . esc_html( $value ) . "</option>";
|
959 |
+
}
|
960 |
+
|
961 |
+
echo "</select>";
|
962 |
+
|
963 |
+
}
|
964 |
+
|
965 |
+
|
966 |
+
/**
|
967 |
+
* Print a select box containing all available menu themes
|
968 |
+
*
|
969 |
+
* @since 2.8
|
970 |
+
* @param string $key
|
971 |
+
* @param string $value
|
972 |
+
*/
|
973 |
+
public function print_location_theme_selector_option( $location, $key, $value ) {
|
974 |
+
echo "<select name='" . esc_attr( "megamenu_meta[$location][$key]" ) . "'>";
|
975 |
+
|
976 |
+
$style_manager = new Mega_Menu_Style_Manager();
|
977 |
+
$themes = $style_manager->get_themes();
|
978 |
+
$selected_theme = strlen( $value ) ? $value : 'default';
|
979 |
+
|
980 |
+
foreach ( $themes as $key => $theme ) {
|
981 |
+
echo "<option value='" . esc_attr( $key ) . "' " . selected( $selected_theme, $key ) . ">" . esc_html( $theme['title'] ) . "</option>";
|
982 |
+
}
|
983 |
+
|
984 |
+
echo "</select>";
|
985 |
+
}
|
986 |
+
|
987 |
+
|
988 |
+
/**
|
989 |
+
* Print the textbox containing the sample PHP code to output a menu location
|
990 |
+
*
|
991 |
+
* @since 2.8
|
992 |
+
* @param string $key
|
993 |
+
* @param string $value
|
994 |
+
*/
|
995 |
+
public function print_location_php_function_option( $location, $value ) {
|
996 |
+
?>
|
997 |
+
<textarea readonly="readonly"><?php wp_nav_menu( array( 'theme_location' => '<?php echo esc_attr( $value ) ?>' ) ); ?></textarea>
|
998 |
+
<?php
|
999 |
+
}
|
1000 |
+
|
1001 |
+
|
1002 |
+
/**
|
1003 |
+
* Print the textbox containing the sample shortcode to output a menu location
|
1004 |
+
*
|
1005 |
+
* @since 2.8
|
1006 |
+
* @param string $key
|
1007 |
+
* @param string $value
|
1008 |
+
*/
|
1009 |
+
public function print_location_shortcode_option( $location, $value ) {
|
1010 |
+
?>
|
1011 |
+
<textarea readonly="readonly">[maxmegamenu location=<?php echo esc_attr( $value ) ?>]</textarea>
|
1012 |
+
<?php
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
|
1016 |
+
/**
|
1017 |
+
* Print the textbox containing instructions on how to display this menu location using a widget
|
1018 |
+
*
|
1019 |
+
* @since 2.8
|
1020 |
+
* @param string $key
|
1021 |
+
* @param string $value
|
1022 |
+
*/
|
1023 |
+
public function print_location_widget_option( $location, $value ) {
|
1024 |
+
?>
|
1025 |
+
<textarea readonly="readonly"><?php _e("Add the 'Max Mega Menu' widget to a widget area.", "megamenu") ?></textarea>
|
1026 |
+
<?php
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
|
1030 |
+
/**
|
1031 |
+
* Print a standard text input box
|
1032 |
+
*
|
1033 |
+
* @since 2.8
|
1034 |
+
* @param string $key
|
1035 |
+
* @param string $value
|
1036 |
+
*/
|
1037 |
+
public function print_location_freetext_option( $location, $key, $value ) {
|
1038 |
+
echo "<input class='" . esc_attr( "mega-setting-" . $key ) . "' type='text' name='megamenu_meta[$location][$key]' value='" . esc_attr( $value ) . "' />";
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
|
1042 |
+
/**
|
1043 |
+
* Print a text input box allowing the user to change the name of a custom menu location
|
1044 |
+
*
|
1045 |
+
* @since 2.8
|
1046 |
+
* @param string $key
|
1047 |
+
* @param string $value
|
1048 |
+
*/
|
1049 |
+
public function print_location_description_option( $location, $key, $value ) {
|
1050 |
+
echo "<input class='" . esc_attr( "mega-setting-" . $key ) . "' type='text' name='custom_location[$location]' value='" . esc_attr( $value ) . "' />";
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
|
1054 |
+
/**
|
1055 |
+
* Compare array values
|
1056 |
+
*
|
1057 |
+
* @since 2.8
|
1058 |
+
* @param array $elem1
|
1059 |
+
* @param array $elem2
|
1060 |
+
* @return bool
|
1061 |
+
*/
|
1062 |
+
private function compare_elems( $elem1, $elem2 ) {
|
1063 |
+
return $elem1['priority'] > $elem2['priority'];
|
1064 |
+
}
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
endif;
|
classes/settings.class.php
CHANGED
@@ -45,9 +45,6 @@ class Mega_Menu_Settings {
|
|
45 |
add_action( 'admin_post_megamenu_import_theme', array( $this, 'import_theme') );
|
46 |
add_action( 'admin_post_megamenu_duplicate_theme', array( $this, 'duplicate_theme') );
|
47 |
|
48 |
-
add_action( 'admin_post_megamenu_add_menu_location', array( $this, 'add_menu_location') );
|
49 |
-
add_action( 'admin_post_megamenu_delete_menu_location', array( $this, 'delete_menu_location') );
|
50 |
-
|
51 |
add_action( 'admin_post_megamenu_save_settings', array( $this, 'save_settings') );
|
52 |
add_action( 'admin_post_megamenu_clear_css_cache', array( $this, 'tools_clear_css_cache') );
|
53 |
add_action( 'admin_post_megamenu_delete_data', array( $this, 'delete_data') );
|
@@ -55,7 +52,6 @@ class Mega_Menu_Settings {
|
|
55 |
add_action( 'megamenu_page_theme_editor', array( $this, 'theme_editor_page'));
|
56 |
add_action( 'megamenu_page_tools', array( $this, 'tools_page'));
|
57 |
add_action( 'megamenu_page_general_settings', array( $this, 'general_settings_page'));
|
58 |
-
add_action( 'megamenu_page_menu_locations', array( $this, 'menu_locations_page'));
|
59 |
|
60 |
add_action( 'admin_menu', array( $this, 'megamenu_themes_page') );
|
61 |
add_action( 'megamenu_admin_scripts', array( $this, 'enqueue_scripts' ) );
|
@@ -142,6 +138,14 @@ class Mega_Menu_Settings {
|
|
142 |
unset( $submitted_settings['toggle_blocks'] );
|
143 |
}
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
$theme = array_map( 'esc_attr', $submitted_settings );
|
146 |
|
147 |
return $theme;
|
@@ -185,58 +189,6 @@ class Mega_Menu_Settings {
|
|
185 |
}
|
186 |
|
187 |
|
188 |
-
/**
|
189 |
-
* Add a new menu location.
|
190 |
-
*
|
191 |
-
* @since 1.8
|
192 |
-
*/
|
193 |
-
public function add_menu_location() {
|
194 |
-
|
195 |
-
check_admin_referer( 'megamenu_add_menu_location' );
|
196 |
-
|
197 |
-
$locations = get_option( 'megamenu_locations' );
|
198 |
-
|
199 |
-
$next_id = $this->get_next_menu_location_id();
|
200 |
-
|
201 |
-
$new_menu_location_id = "max_mega_menu_" . $next_id;
|
202 |
-
|
203 |
-
$locations[$new_menu_location_id] = "Max Mega Menu Location " . $next_id;
|
204 |
-
|
205 |
-
update_option( 'megamenu_locations', $locations );
|
206 |
-
|
207 |
-
do_action("megamenu_after_add_menu_location");
|
208 |
-
|
209 |
-
$this->redirect( admin_url( 'admin.php?page=maxmegamenu_menu_locations&add_location=true' ) );
|
210 |
-
|
211 |
-
}
|
212 |
-
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Delete a menu location.
|
216 |
-
*
|
217 |
-
* @since 1.8
|
218 |
-
*/
|
219 |
-
public function delete_menu_location() {
|
220 |
-
|
221 |
-
check_admin_referer( 'megamenu_delete_menu_location' );
|
222 |
-
|
223 |
-
$locations = get_option( 'megamenu_locations' );
|
224 |
-
|
225 |
-
$location_to_delete = esc_attr( $_GET['location'] );
|
226 |
-
|
227 |
-
if ( isset( $locations[ $location_to_delete ] ) ) {
|
228 |
-
unset( $locations[ $location_to_delete ] );
|
229 |
-
update_option( 'megamenu_locations', $locations );
|
230 |
-
}
|
231 |
-
|
232 |
-
do_action("megamenu_after_delete_menu_location");
|
233 |
-
|
234 |
-
do_action("megamenu_delete_cache");
|
235 |
-
|
236 |
-
$this->redirect( admin_url( 'admin.php?page=maxmegamenu_menu_locations&delete_location=true' ) );
|
237 |
-
|
238 |
-
}
|
239 |
-
|
240 |
/**
|
241 |
* Clear the CSS cache.
|
242 |
*
|
@@ -347,15 +299,6 @@ class Mega_Menu_Settings {
|
|
347 |
update_option( 'megamenu_settings', $new_settings );
|
348 |
}
|
349 |
|
350 |
-
// update location description
|
351 |
-
if ( isset( $_POST['location'] ) && is_array( $_POST['location'] ) ) {
|
352 |
-
$location = array_map( 'sanitize_text_field', $_POST['location'] );
|
353 |
-
$locations = get_option('megamenu_locations');
|
354 |
-
$new_locations = array_merge( (array)$locations, $location );
|
355 |
-
|
356 |
-
update_option( 'megamenu_locations', $new_locations );
|
357 |
-
}
|
358 |
-
|
359 |
delete_transient('megamenu_failed_to_write_css_to_filesystem');
|
360 |
|
361 |
do_action("megamenu_after_save_general_settings");
|
@@ -561,39 +504,6 @@ class Mega_Menu_Settings {
|
|
561 |
}
|
562 |
|
563 |
|
564 |
-
/**
|
565 |
-
* Returns the next available menu location ID
|
566 |
-
*
|
567 |
-
* @since 1.0
|
568 |
-
*/
|
569 |
-
public function get_next_menu_location_id() {
|
570 |
-
|
571 |
-
$last_id = 0;
|
572 |
-
|
573 |
-
if ( $locations = get_option( "megamenu_locations" ) ) {
|
574 |
-
|
575 |
-
foreach ( $locations as $key => $value ) {
|
576 |
-
|
577 |
-
if ( strpos( $key, 'max_mega_menu_' ) !== FALSE ) {
|
578 |
-
|
579 |
-
$parts = explode( "_", $key );
|
580 |
-
$menu_id = end( $parts );
|
581 |
-
|
582 |
-
if ($menu_id > $last_id) {
|
583 |
-
$last_id = $menu_id;
|
584 |
-
}
|
585 |
-
|
586 |
-
}
|
587 |
-
|
588 |
-
}
|
589 |
-
|
590 |
-
}
|
591 |
-
|
592 |
-
$next_id = $last_id + 1;
|
593 |
-
|
594 |
-
return $next_id;
|
595 |
-
}
|
596 |
-
|
597 |
/**
|
598 |
* Returns the next available custom theme ID
|
599 |
*
|
@@ -685,7 +595,6 @@ class Mega_Menu_Settings {
|
|
685 |
$tabs = apply_filters("megamenu_menu_tabs", array(
|
686 |
'general_settings' => __("General Settings", "megamenu"),
|
687 |
'theme_editor' => __("Menu Themes", "megamenu"),
|
688 |
-
'menu_locations' => __("Menu Locations", "megamenu"),
|
689 |
'tools' => __("Tools", "megamenu")
|
690 |
));
|
691 |
|
@@ -694,6 +603,10 @@ class Mega_Menu_Settings {
|
|
694 |
add_submenu_page( 'maxmegamenu', __('Max Mega Menu', 'megamenu') . ' - ' . $title, $title, $capability, 'maxmegamenu', array($this, 'page') );
|
695 |
} else {
|
696 |
add_submenu_page( 'maxmegamenu', __('Max Mega Menu', 'megamenu') . ' - ' . $title, $title, $capability, 'maxmegamenu_' . $key, array($this, 'page') );
|
|
|
|
|
|
|
|
|
697 |
}
|
698 |
}
|
699 |
|
@@ -863,273 +776,6 @@ class Mega_Menu_Settings {
|
|
863 |
<?php
|
864 |
}
|
865 |
|
866 |
-
|
867 |
-
/**
|
868 |
-
* Content for 'Settings' tab
|
869 |
-
*
|
870 |
-
* @since 1.4
|
871 |
-
*/
|
872 |
-
public function menu_locations_page( $saved_settings ) {
|
873 |
-
|
874 |
-
$all_locations = get_registered_nav_menus();
|
875 |
-
|
876 |
-
// PolyLang - remove auto created/translated menu locations
|
877 |
-
if ( function_exists( 'pll_default_language' ) ) {
|
878 |
-
$default_lang = pll_default_language( 'name' );
|
879 |
-
|
880 |
-
foreach ( $all_locations as $loc => $description ) {
|
881 |
-
if ( false !== strpos( $loc, '___' ) ) {
|
882 |
-
// Remove locations created by Polylang
|
883 |
-
unregister_nav_menu( $loc );
|
884 |
-
} else {
|
885 |
-
// Remove the language name appended to the original locations
|
886 |
-
register_nav_menu( $loc, str_replace( ' ' . $default_lang, '', $description ) );
|
887 |
-
}
|
888 |
-
}
|
889 |
-
|
890 |
-
$all_locations = get_registered_nav_menus();
|
891 |
-
}
|
892 |
-
|
893 |
-
$locations = array();
|
894 |
-
|
895 |
-
$custom_locations = get_option( 'megamenu_locations' );
|
896 |
-
|
897 |
-
if ( is_array( $custom_locations ) ) {
|
898 |
-
$all_locations = array_merge( $custom_locations, $all_locations );
|
899 |
-
}
|
900 |
-
|
901 |
-
if ( count( $all_locations ) ) {
|
902 |
-
|
903 |
-
$megamenu_locations = array();
|
904 |
-
|
905 |
-
// reorder locations so custom MMM locations are listed at the bottom
|
906 |
-
foreach ( $all_locations as $location => $val ) {
|
907 |
-
|
908 |
-
if ( strpos( $location, 'max_mega_menu_' ) === FALSE ) {
|
909 |
-
$locations[$location] = $val;
|
910 |
-
} else {
|
911 |
-
$megamenu_locations[$location] = $val;
|
912 |
-
}
|
913 |
-
|
914 |
-
}
|
915 |
-
|
916 |
-
$locations = array_merge( $locations, $megamenu_locations );
|
917 |
-
}
|
918 |
-
|
919 |
-
?>
|
920 |
-
|
921 |
-
<div class='menu_settings menu_settings_menu_locations'>
|
922 |
-
|
923 |
-
<form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
|
924 |
-
<input type="hidden" name="action" value="megamenu_save_settings" />
|
925 |
-
<?php wp_nonce_field( 'megamenu_save_settings' ); ?>
|
926 |
-
|
927 |
-
<h3 class='first'><?php _e("Menu Locations", "megamenu"); ?></h3>
|
928 |
-
|
929 |
-
<table>
|
930 |
-
<tr>
|
931 |
-
<td class='mega-name'>
|
932 |
-
<?php _e("Registered Menu Locations", "megamenu"); ?>
|
933 |
-
<div class='mega-description'><?php _e("This is an overview of the menu locations supported by your theme. You can enable Max Mega Menu and adjust the settings for a specific menu location by going to Appearance > Menus.", "megamenu"); ?></div>
|
934 |
-
</td>
|
935 |
-
<td class='mega-value'>
|
936 |
-
<p>
|
937 |
-
<?php
|
938 |
-
if ( ! count($locations)) {
|
939 |
-
_e("Your theme does not natively support menus, but you can add a new menu location using Max Mega Menu and display the menu using the Max Mega Menu widget or shortcode.", "megamenu");
|
940 |
-
} else {
|
941 |
-
echo sprintf( _n("Your theme supports %s menu location.", "Your theme supports %s menu locations.", count($locations), "megamenu"), count($locations) );
|
942 |
-
}
|
943 |
-
?>
|
944 |
-
</p>
|
945 |
-
|
946 |
-
<?php
|
947 |
-
|
948 |
-
if ( count ( $locations ) ) {
|
949 |
-
|
950 |
-
echo "<div class='accordion-container'>";
|
951 |
-
echo "<ul class='outer-border'>";
|
952 |
-
|
953 |
-
foreach ( $locations as $location => $description ) {
|
954 |
-
|
955 |
-
$menu_id = $this->get_menu_id_for_location( $location );
|
956 |
-
|
957 |
-
$is_custom_location = strpos( $location, 'max_mega_menu_' ) !== FALSE;
|
958 |
-
|
959 |
-
?>
|
960 |
-
|
961 |
-
|
962 |
-
<li class='control-section accordion-section mega-location'>
|
963 |
-
<h4 class='accordion-section-title hndle'>
|
964 |
-
|
965 |
-
<?php echo esc_attr( $description ) ?>
|
966 |
-
|
967 |
-
<?php
|
968 |
-
|
969 |
-
if ($menu_id) {
|
970 |
-
echo "<div class='mega-assigned-menu'>";
|
971 |
-
echo "<a href='" . admin_url("nav-menus.php?action=edit&menu={$menu_id}") . "'>" . $this->get_menu_name_for_location( $location ) . "</a>";
|
972 |
-
echo "</div>";
|
973 |
-
}
|
974 |
-
|
975 |
-
?>
|
976 |
-
|
977 |
-
</h4>
|
978 |
-
<div class='accordion-section-content'>
|
979 |
-
|
980 |
-
<?php if ( ! max_mega_menu_is_enabled( $location ) ): ?>
|
981 |
-
<div class='notice fail'><p><?php _e("Max Mega Menu is not enabled for this menu location. If you wish to use Max Mega Menu for this location you must enable it under Appearance > Menus.", "megamenu"); ?></p></div>
|
982 |
-
<?php endif; ?>
|
983 |
-
|
984 |
-
<table>
|
985 |
-
<?php if ( $is_custom_location ) : ?>
|
986 |
-
<tr>
|
987 |
-
<td class='mega-name'>
|
988 |
-
<?php _e("Location Description", "megamenu"); ?>
|
989 |
-
<div class='mega-description'><?php _e("Change the name of the location.", "megamenu"); ?></div>
|
990 |
-
</td>
|
991 |
-
<td class='mega-value wide'>
|
992 |
-
<input type='text' name='location[<?php echo esc_attr($location) ?>]' value='<?php echo esc_attr( $description ); ?>' />
|
993 |
-
</td>
|
994 |
-
</tr>
|
995 |
-
<?php endif; ?>
|
996 |
-
</table>
|
997 |
-
|
998 |
-
<h5><?php _e("Menu Display Options", "megamenu"); ?></h5>
|
999 |
-
|
1000 |
-
<?php if ( ! $is_custom_location ) : ?>
|
1001 |
-
<p><?php _e("These options are for advanced users only. Your theme should already include the code required to display this menu on your site.", "megamenu"); ?>
|
1002 |
-
<?php endif; ?>
|
1003 |
-
|
1004 |
-
<table>
|
1005 |
-
<tr>
|
1006 |
-
<td class='mega-name'>
|
1007 |
-
<?php _e("PHP Function", "megamenu"); ?>
|
1008 |
-
<div class='mega-description'><?php _e("For use in a theme template (usually header.php)", "megamenu"); ?></div>
|
1009 |
-
</td>
|
1010 |
-
<td class='mega-value'>
|
1011 |
-
<textarea readonly="readonly"><?php wp_nav_menu( array( 'theme_location' => '<?php echo esc_attr( $location ) ?>' ) ); ?></textarea>
|
1012 |
-
</td>
|
1013 |
-
</tr>
|
1014 |
-
<tr>
|
1015 |
-
<td class='mega-name'>
|
1016 |
-
<?php _e("Shortcode", "megamenu"); ?>
|
1017 |
-
<div class='mega-description'><?php _e("For use in a post or page.", "megamenu"); ?></div>
|
1018 |
-
</td>
|
1019 |
-
<td class='mega-value'>
|
1020 |
-
<textarea readonly="readonly">[maxmegamenu location=<?php echo esc_attr( $location ) ?>]</textarea>
|
1021 |
-
</td>
|
1022 |
-
</tr>
|
1023 |
-
<tr>
|
1024 |
-
<td class='mega-name'>
|
1025 |
-
<?php _e("Widget", "megamenu"); ?>
|
1026 |
-
<div class='mega-description'><?php _e("For use in a widget area.", "megamenu"); ?></div>
|
1027 |
-
</td>
|
1028 |
-
<td class='mega-value'>
|
1029 |
-
<?php _e("Add the 'Max Mega Menu' widget to a widget area.", "megamenu") ?>
|
1030 |
-
</td>
|
1031 |
-
</tr>
|
1032 |
-
</table>
|
1033 |
-
|
1034 |
-
|
1035 |
-
<?php
|
1036 |
-
|
1037 |
-
if ( $is_custom_location ) {
|
1038 |
-
|
1039 |
-
$delete_location_url = esc_url( add_query_arg(
|
1040 |
-
array(
|
1041 |
-
'action' => 'megamenu_delete_menu_location',
|
1042 |
-
'location' => $location
|
1043 |
-
),
|
1044 |
-
wp_nonce_url( admin_url("admin-post.php"), 'megamenu_delete_menu_location' )
|
1045 |
-
) );
|
1046 |
-
|
1047 |
-
echo '<div class="megamenu_submit"><div class="mega_left">';
|
1048 |
-
submit_button();
|
1049 |
-
echo '</div><div class="mega_right">';
|
1050 |
-
echo "<a class='confirm mega-delete' href='{$delete_location_url}'>" . __("Delete location", "megamenu") . "</a>";
|
1051 |
-
echo '</div></div>';
|
1052 |
-
|
1053 |
-
}
|
1054 |
-
|
1055 |
-
?>
|
1056 |
-
|
1057 |
-
</div>
|
1058 |
-
</li>
|
1059 |
-
<?php
|
1060 |
-
}
|
1061 |
-
|
1062 |
-
echo "</div>";
|
1063 |
-
|
1064 |
-
|
1065 |
-
echo "</div>";
|
1066 |
-
|
1067 |
-
|
1068 |
-
}
|
1069 |
-
|
1070 |
-
$add_location_url = esc_url( add_query_arg(
|
1071 |
-
array(
|
1072 |
-
'action'=>'megamenu_add_menu_location'
|
1073 |
-
),
|
1074 |
-
wp_nonce_url( admin_url("admin-post.php"), 'megamenu_add_menu_location' )
|
1075 |
-
) );
|
1076 |
-
|
1077 |
-
echo "<br /><p><a class='button button-primary' href='{$add_location_url}'>" . __("Add another menu location", "megamenu") . "</a></p>";
|
1078 |
-
|
1079 |
-
?>
|
1080 |
-
|
1081 |
-
</td>
|
1082 |
-
</tr>
|
1083 |
-
</table>
|
1084 |
-
|
1085 |
-
<?php do_action( "megamenu_menu_locations", $saved_settings ); ?>
|
1086 |
-
|
1087 |
-
|
1088 |
-
</form>
|
1089 |
-
</div>
|
1090 |
-
|
1091 |
-
<?php
|
1092 |
-
}
|
1093 |
-
|
1094 |
-
|
1095 |
-
/**
|
1096 |
-
* Returns the menu ID for a specified menu location, defaults to 0
|
1097 |
-
*
|
1098 |
-
* @since 1.8
|
1099 |
-
* @param string $location
|
1100 |
-
*/
|
1101 |
-
private function get_menu_id_for_location( $location ) {
|
1102 |
-
|
1103 |
-
$locations = get_nav_menu_locations();
|
1104 |
-
|
1105 |
-
$id = isset( $locations[ $location ] ) ? $locations[ $location ] : 0;
|
1106 |
-
|
1107 |
-
return $id;
|
1108 |
-
|
1109 |
-
}
|
1110 |
-
|
1111 |
-
/**
|
1112 |
-
* Returns the menu name for a specified menu location
|
1113 |
-
*
|
1114 |
-
* @since 1.8
|
1115 |
-
* @param string $location
|
1116 |
-
*/
|
1117 |
-
private function get_menu_name_for_location( $location ) {
|
1118 |
-
|
1119 |
-
$id = $this->get_menu_id_for_location( $location );
|
1120 |
-
|
1121 |
-
$menus = wp_get_nav_menus();
|
1122 |
-
|
1123 |
-
foreach ( $menus as $menu ) {
|
1124 |
-
if ( $menu->term_id == $id ) {
|
1125 |
-
return $menu->name;
|
1126 |
-
}
|
1127 |
-
}
|
1128 |
-
|
1129 |
-
return false;
|
1130 |
-
}
|
1131 |
-
|
1132 |
-
|
1133 |
/**
|
1134 |
* Content for 'Tools' tab
|
1135 |
*
|
@@ -1398,7 +1044,6 @@ class Mega_Menu_Settings {
|
|
1398 |
$tabs = apply_filters("megamenu_menu_tabs", array(
|
1399 |
'general_settings' => __("General Settings", "megamenu"),
|
1400 |
'theme_editor' => __("Menu Themes", "megamenu"),
|
1401 |
-
'menu_locations' => __("Menu Locations", "megamenu"),
|
1402 |
'tools' => __("Tools", "megamenu")
|
1403 |
));
|
1404 |
|
@@ -1486,14 +1131,6 @@ class Mega_Menu_Settings {
|
|
1486 |
echo "<p class='success'>" . __("New Theme Created. To apply this theme to a menu, go to <i>Appearance > Menus > Max Mega Menu Settings</i> and select this theme from the 'Theme' dropdown.", "megamenu") . "</p>";
|
1487 |
}
|
1488 |
|
1489 |
-
if ( isset( $_GET['add_location'] ) ) {
|
1490 |
-
echo "<p class='success'>" . __("New Menu Location Created", "megamenu") . "</p>";
|
1491 |
-
}
|
1492 |
-
|
1493 |
-
if ( isset( $_GET['delete_location'] ) ) {
|
1494 |
-
echo "<p class='success'>" . __("Menu Location Deleted", "megamenu") . "</p>";
|
1495 |
-
}
|
1496 |
-
|
1497 |
if ( isset( $_GET['theme_imported'] ) && $_GET['theme_imported'] == 'false' ) {
|
1498 |
echo "<p class='fail'>" . __("Theme Import Failed", "megamenu") . "</p>";
|
1499 |
}
|
45 |
add_action( 'admin_post_megamenu_import_theme', array( $this, 'import_theme') );
|
46 |
add_action( 'admin_post_megamenu_duplicate_theme', array( $this, 'duplicate_theme') );
|
47 |
|
|
|
|
|
|
|
48 |
add_action( 'admin_post_megamenu_save_settings', array( $this, 'save_settings') );
|
49 |
add_action( 'admin_post_megamenu_clear_css_cache', array( $this, 'tools_clear_css_cache') );
|
50 |
add_action( 'admin_post_megamenu_delete_data', array( $this, 'delete_data') );
|
52 |
add_action( 'megamenu_page_theme_editor', array( $this, 'theme_editor_page'));
|
53 |
add_action( 'megamenu_page_tools', array( $this, 'tools_page'));
|
54 |
add_action( 'megamenu_page_general_settings', array( $this, 'general_settings_page'));
|
|
|
55 |
|
56 |
add_action( 'admin_menu', array( $this, 'megamenu_themes_page') );
|
57 |
add_action( 'megamenu_admin_scripts', array( $this, 'enqueue_scripts' ) );
|
138 |
unset( $submitted_settings['toggle_blocks'] );
|
139 |
}
|
140 |
|
141 |
+
if ( isset( $submitted_settings['panel_width'] ) ) {
|
142 |
+
$submitted_settings['panel_width'] = trim( $submitted_settings['panel_width'] );
|
143 |
+
}
|
144 |
+
|
145 |
+
if ( isset( $submitted_settings['panel_inner_width'] ) ) {
|
146 |
+
$submitted_settings['panel_inner_width'] = trim( $submitted_settings['panel_inner_width'] );
|
147 |
+
}
|
148 |
+
|
149 |
$theme = array_map( 'esc_attr', $submitted_settings );
|
150 |
|
151 |
return $theme;
|
189 |
}
|
190 |
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
/**
|
193 |
* Clear the CSS cache.
|
194 |
*
|
299 |
update_option( 'megamenu_settings', $new_settings );
|
300 |
}
|
301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
delete_transient('megamenu_failed_to_write_css_to_filesystem');
|
303 |
|
304 |
do_action("megamenu_after_save_general_settings");
|
504 |
}
|
505 |
|
506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
/**
|
508 |
* Returns the next available custom theme ID
|
509 |
*
|
595 |
$tabs = apply_filters("megamenu_menu_tabs", array(
|
596 |
'general_settings' => __("General Settings", "megamenu"),
|
597 |
'theme_editor' => __("Menu Themes", "megamenu"),
|
|
|
598 |
'tools' => __("Tools", "megamenu")
|
599 |
));
|
600 |
|
603 |
add_submenu_page( 'maxmegamenu', __('Max Mega Menu', 'megamenu') . ' - ' . $title, $title, $capability, 'maxmegamenu', array($this, 'page') );
|
604 |
} else {
|
605 |
add_submenu_page( 'maxmegamenu', __('Max Mega Menu', 'megamenu') . ' - ' . $title, $title, $capability, 'maxmegamenu_' . $key, array($this, 'page') );
|
606 |
+
|
607 |
+
//if ( $key == 'menu_locations') {
|
608 |
+
//add_submenu_page( 'maxmegamenu', __('Menus', 'megamenu'), __('Menus', 'megamenu'), $capability, 'nav-menus.php' );
|
609 |
+
//}
|
610 |
}
|
611 |
}
|
612 |
|
776 |
<?php
|
777 |
}
|
778 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
/**
|
780 |
* Content for 'Tools' tab
|
781 |
*
|
1044 |
$tabs = apply_filters("megamenu_menu_tabs", array(
|
1045 |
'general_settings' => __("General Settings", "megamenu"),
|
1046 |
'theme_editor' => __("Menu Themes", "megamenu"),
|
|
|
1047 |
'tools' => __("Tools", "megamenu")
|
1048 |
));
|
1049 |
|
1131 |
echo "<p class='success'>" . __("New Theme Created. To apply this theme to a menu, go to <i>Appearance > Menus > Max Mega Menu Settings</i> and select this theme from the 'Theme' dropdown.", "megamenu") . "</p>";
|
1132 |
}
|
1133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1134 |
if ( isset( $_GET['theme_imported'] ) && $_GET['theme_imported'] == 'false' ) {
|
1135 |
echo "<p class='fail'>" . __("Theme Import Failed", "megamenu") . "</p>";
|
1136 |
}
|
classes/widget-manager.class.php
CHANGED
@@ -22,8 +22,6 @@ class Mega_Menu_Widget_Manager {
|
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
|
25 |
-
add_action( 'init', array( $this, 'register_sidebar' ) );
|
26 |
-
|
27 |
add_action( 'wp_ajax_mm_edit_widget', array( $this, 'ajax_show_widget_form' ) );
|
28 |
add_action( 'wp_ajax_mm_edit_menu_item', array( $this, 'ajax_show_menu_item_form' ) );
|
29 |
add_action( 'wp_ajax_mm_save_widget', array( $this, 'ajax_save_widget' ) );
|
@@ -69,25 +67,6 @@ class Mega_Menu_Widget_Manager {
|
|
69 |
}
|
70 |
|
71 |
|
72 |
-
/**
|
73 |
-
* Create our own widget area to store all mega menu widgets.
|
74 |
-
* All widgets from all menus are stored here, they are filtered later
|
75 |
-
* to ensure the correct widgets show under the correct menu item.
|
76 |
-
*
|
77 |
-
* @since 1.0
|
78 |
-
*/
|
79 |
-
public function register_sidebar() {
|
80 |
-
|
81 |
-
register_sidebar(
|
82 |
-
array(
|
83 |
-
'id' => 'mega-menu',
|
84 |
-
'name' => __("Max Mega Menu Widgets", "megamenu"),
|
85 |
-
'description' => __("This is where Max Mega Menu stores widgets that you have added to sub menus using the mega menu builder. You can edit existing widgets here, but new widgets must be added through the Mega Menu interface (under Appearance > Menus).", "megamenu")
|
86 |
-
)
|
87 |
-
);
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
/**
|
92 |
* Display a widget settings form
|
93 |
*
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
|
|
|
|
|
25 |
add_action( 'wp_ajax_mm_edit_widget', array( $this, 'ajax_show_widget_form' ) );
|
26 |
add_action( 'wp_ajax_mm_edit_menu_item', array( $this, 'ajax_show_menu_item_form' ) );
|
27 |
add_action( 'wp_ajax_mm_save_widget', array( $this, 'ajax_save_widget' ) );
|
67 |
}
|
68 |
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
/**
|
71 |
* Display a widget settings form
|
72 |
*
|
css/admin/admin.css
CHANGED
@@ -31,16 +31,15 @@
|
|
31 |
.rtl.nav-menus-php .mega_menu_meta_box div table td:nth-child(2) {
|
32 |
text-align: left; }
|
33 |
|
34 |
-
.nav-menus-php.mega-colorbox-open ul#adminmenu a.wp-has-current-submenu:after,
|
35 |
-
.nav-menus-php.mega-colorbox-open ul#adminmenu > li.current > a.current:after {
|
36 |
-
border-right-color: #373737; }
|
37 |
-
|
38 |
.nav-menus-php #cboxOverlay {
|
39 |
left: 160px; }
|
40 |
|
41 |
.nav-menus-php #colorbox {
|
42 |
-
transform: translateX(80px);
|
43 |
-
|
|
|
|
|
|
|
44 |
|
45 |
.nav-menus-php #cboxContent {
|
46 |
padding: 0;
|
@@ -1128,14 +1127,6 @@
|
|
1128 |
.nav-menus-php #cboxClose:hover {
|
1129 |
color: #0074a2; }
|
1130 |
|
1131 |
-
.nav-menus-php.megamenu_enabled .mm_launch {
|
1132 |
-
background: #0073aa;
|
1133 |
-
border-color: #0074a2; }
|
1134 |
-
|
1135 |
-
.nav-menus-php.megamenu_enabled .mm_launch.mm_disabled {
|
1136 |
-
background: #999;
|
1137 |
-
border-color: #444; }
|
1138 |
-
|
1139 |
.nav-menus-php.megamenu_enabled .mm_prefix {
|
1140 |
display: block;
|
1141 |
font-size: 0.9em;
|
@@ -1155,8 +1146,8 @@
|
|
1155 |
width: auto;
|
1156 |
font-weight: normal;
|
1157 |
height: auto;
|
1158 |
-
background: #
|
1159 |
-
border-color: #
|
1160 |
border-width: 1px;
|
1161 |
padding: 1px 5px;
|
1162 |
border-radius: 3px;
|
@@ -1184,105 +1175,64 @@
|
|
1184 |
margin-right: 1px;
|
1185 |
height: auto; }
|
1186 |
|
1187 |
-
.nav-menus-php .mega_menu_meta_box div
|
1188 |
-
padding: 0
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
width: 100%;
|
1194 |
-
color: #999;
|
1195 |
-
font-size: 14px;
|
1196 |
-
font-weight: normal;
|
1197 |
-
border: 0; }
|
1198 |
-
.nav-menus-php .mega_menu_meta_box div#megamenu_accordion h3:hover {
|
1199 |
-
color: #444; }
|
1200 |
-
.nav-menus-php .mega_menu_meta_box div#megamenu_accordion h3:hover::before {
|
1201 |
-
color: #000; }
|
1202 |
-
.nav-menus-php .mega_menu_meta_box div#megamenu_accordion h3::before {
|
1203 |
-
right: 0;
|
1204 |
-
content: '\f139';
|
1205 |
border: 0;
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1209 |
float: left;
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
position: relative;
|
1214 |
-
-webkit-font-smoothing: antialiased;
|
1215 |
-
-moz-osx-font-smoothing: grayscale;
|
1216 |
-
text-decoration: none !important;
|
1217 |
-
margin-right: 6px; }
|
1218 |
-
|
1219 |
-
.nav-menus-php .mega_menu_meta_box div#megamenu_accordion h3.ui-state-active {
|
1220 |
-
color: #444; }
|
1221 |
-
.nav-menus-php .mega_menu_meta_box div#megamenu_accordion h3.ui-state-active::before {
|
1222 |
-
content: '\f140'; }
|
1223 |
-
|
1224 |
-
.nav-menus-php .mega_menu_meta_box div#megamenu_accordion th::before {
|
1225 |
-
right: 0;
|
1226 |
-
content: '\f139';
|
1227 |
-
border: 0;
|
1228 |
-
background: 0 0;
|
1229 |
-
font: 400 20px/1 dashicons;
|
1230 |
-
speak: none;
|
1231 |
-
float: left;
|
1232 |
-
padding: 0;
|
1233 |
-
text-indent: 0;
|
1234 |
-
text-align: center;
|
1235 |
-
position: relative;
|
1236 |
-
-webkit-font-smoothing: antialiased;
|
1237 |
-
-moz-osx-font-smoothing: grayscale;
|
1238 |
-
text-decoration: none !important;
|
1239 |
-
margin-right: 6px; }
|
1240 |
-
|
1241 |
-
.nav-menus-php .mega_menu_meta_box div.accordion_content {
|
1242 |
-
padding: 0 0 20px 0;
|
1243 |
-
float: left;
|
1244 |
-
border: 0;
|
1245 |
-
width: 100%; }
|
1246 |
-
|
1247 |
-
.nav-menus-php .mega_menu_meta_box div table {
|
1248 |
-
font-size: 0.9em;
|
1249 |
-
width: 100%;
|
1250 |
-
margin-bottom: 5px;
|
1251 |
-
border-collapse: collapse; }
|
1252 |
-
.nav-menus-php .mega_menu_meta_box div table select {
|
1253 |
font-size: 0.9em;
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
.nav-menus-php .mega_menu_meta_box
|
1271 |
-
|
|
|
|
|
|
|
1272 |
|
1273 |
-
.nav-menus-php .mega_menu_meta_box p.submit {
|
1274 |
float: right;
|
1275 |
text-align: right;
|
1276 |
width: auto;
|
1277 |
margin: 0 0 15px 0;
|
1278 |
padding: 0; }
|
1279 |
|
1280 |
-
.nav-menus-php .mega_menu_meta_box .spinner {
|
1281 |
float: right; }
|
1282 |
|
1283 |
-
.nav-menus-php #nav-menu-meta .mega_menu_meta_box .accordion-section-content {
|
1284 |
-
padding: 0 10px; }
|
1285 |
-
|
1286 |
.nav-menus-php .menu-item-handle .item-title {
|
1287 |
margin-right: 0; }
|
1288 |
|
@@ -1628,6 +1578,55 @@ body.toplevel_page_maxmegamenu .megamenu_right {
|
|
1628 |
border: 0;
|
1629 |
float: left;
|
1630 |
width: 100%; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1631 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes td.mega-name,
|
1632 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes td.mega-name {
|
1633 |
padding-left: 10px;
|
@@ -1644,43 +1643,64 @@ body.toplevel_page_maxmegamenu .megamenu_right {
|
|
1644 |
width: 100%; }
|
1645 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container,
|
1646 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container {
|
|
|
1647 |
border: 1px solid #DFDFDF; }
|
1648 |
-
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container
|
1649 |
-
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container
|
1650 |
-
|
1651 |
-
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section
|
1652 |
-
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
opacity: 0.7;
|
1661 |
-
margin-right: 28px;
|
1662 |
-
font-size: 0.8em; }
|
1663 |
-
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-assigned-menu:before,
|
1664 |
-
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-assigned-menu:before {
|
1665 |
-
font: 400 16px/21px dashicons;
|
1666 |
-
margin-right: 4px;
|
1667 |
-
content: "\f333";
|
1668 |
-
speak: none;
|
1669 |
-
padding: 0;
|
1670 |
display: inline-block;
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1674 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table .mega-value textarea,
|
1675 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table .mega-value textarea {
|
1676 |
-
height: 40px;
|
|
|
|
|
1677 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations h5,
|
1678 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations h5 {
|
1679 |
font-size: 12px; }
|
1680 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content,
|
1681 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content {
|
1682 |
width: 100%;
|
1683 |
-
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1684 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table,
|
1685 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table {
|
1686 |
width: 100%;
|
31 |
.rtl.nav-menus-php .mega_menu_meta_box div table td:nth-child(2) {
|
32 |
text-align: left; }
|
33 |
|
|
|
|
|
|
|
|
|
34 |
.nav-menus-php #cboxOverlay {
|
35 |
left: 160px; }
|
36 |
|
37 |
.nav-menus-php #colorbox {
|
38 |
+
transform: translateX(80px); }
|
39 |
+
|
40 |
+
.nav-menus-php.mega-colorbox-open ul#adminmenu a.wp-has-current-submenu:after,
|
41 |
+
.nav-menus-php.mega-colorbox-open ul#adminmenu > li.current > a.current:after {
|
42 |
+
border-right-color: #373737; }
|
43 |
|
44 |
.nav-menus-php #cboxContent {
|
45 |
padding: 0;
|
1127 |
.nav-menus-php #cboxClose:hover {
|
1128 |
color: #0074a2; }
|
1129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1130 |
.nav-menus-php.megamenu_enabled .mm_prefix {
|
1131 |
display: block;
|
1132 |
font-size: 0.9em;
|
1146 |
width: auto;
|
1147 |
font-weight: normal;
|
1148 |
height: auto;
|
1149 |
+
background: #0073aa;
|
1150 |
+
border-color: #0074a2;
|
1151 |
border-width: 1px;
|
1152 |
padding: 1px 5px;
|
1153 |
border-radius: 3px;
|
1175 |
margin-right: 1px;
|
1176 |
height: auto; }
|
1177 |
|
1178 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content {
|
1179 |
+
padding: 0 10px; }
|
1180 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content h4 {
|
1181 |
+
outline: none;
|
1182 |
+
float: left;
|
1183 |
+
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1184 |
border: 0;
|
1185 |
+
margin: 10px 0 0;
|
1186 |
+
padding-bottom: 10px;
|
1187 |
+
white-space: nowrap;
|
1188 |
+
overflow: hidden;
|
1189 |
+
text-overflow: ellipsis; }
|
1190 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content h4 .dashicons {
|
1191 |
+
margin-right: 6px; }
|
1192 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content #megamenu_accordion h4 {
|
1193 |
+
cursor: pointer;
|
1194 |
+
border-bottom: 0;
|
1195 |
+
padding-bottom: 0; }
|
1196 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content #megamenu_accordion h4.ui-accordion-header-active {
|
1197 |
+
padding-bottom: 10px; }
|
1198 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content div.accordion_content {
|
1199 |
float: left;
|
1200 |
+
border: 0;
|
1201 |
+
width: 100%; }
|
1202 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1203 |
font-size: 0.9em;
|
1204 |
+
width: 100%;
|
1205 |
+
margin-bottom: 5px;
|
1206 |
+
border-collapse: collapse; }
|
1207 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table tr {
|
1208 |
+
height: 29px;
|
1209 |
+
vertical-align: middle; }
|
1210 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table tr td:nth-child(2) {
|
1211 |
+
text-align: right;
|
1212 |
+
min-width: 150px;
|
1213 |
+
padding: 2px 0; }
|
1214 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table tr select {
|
1215 |
+
font-size: 0.9em;
|
1216 |
+
max-width: 120px;
|
1217 |
+
margin: 0; }
|
1218 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table tr select.megamenu_effect_mobile {
|
1219 |
+
max-width: 80px; }
|
1220 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table tr input[type=checkbox] {
|
1221 |
+
margin: 0; }
|
1222 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table.sticky_settings td:nth-child(2) {
|
1223 |
+
text-align: right;
|
1224 |
+
min-width: 100px; }
|
1225 |
|
1226 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box p.submit {
|
1227 |
float: right;
|
1228 |
text-align: right;
|
1229 |
width: auto;
|
1230 |
margin: 0 0 15px 0;
|
1231 |
padding: 0; }
|
1232 |
|
1233 |
+
.nav-menus-php #nav-menu-meta .mega_menu_meta_box .spinner {
|
1234 |
float: right; }
|
1235 |
|
|
|
|
|
|
|
1236 |
.nav-menus-php .menu-item-handle .item-title {
|
1237 |
margin-right: 0; }
|
1238 |
|
1578 |
border: 0;
|
1579 |
float: left;
|
1580 |
width: 100%; }
|
1581 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-add-location,
|
1582 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-add-location {
|
1583 |
+
float: right; }
|
1584 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations div.mega-tab-content,
|
1585 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations div.mega-tab-content {
|
1586 |
+
border: 0; }
|
1587 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper,
|
1588 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper {
|
1589 |
+
border: 0; }
|
1590 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab,
|
1591 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active,
|
1592 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab,
|
1593 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active {
|
1594 |
+
font-size: 11px;
|
1595 |
+
font-weight: normal;
|
1596 |
+
padding: 3px 5px;
|
1597 |
+
border: 0;
|
1598 |
+
margin: 0 10px 0 0;
|
1599 |
+
background: white;
|
1600 |
+
color: #444;
|
1601 |
+
border-radius: 3px; }
|
1602 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active,
|
1603 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active {
|
1604 |
+
background: #0073aa;
|
1605 |
+
color: white; }
|
1606 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table td,
|
1607 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table td {
|
1608 |
+
padding-bottom: 0; }
|
1609 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table td.mega-name,
|
1610 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table td.mega-name {
|
1611 |
+
width: 25%; }
|
1612 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table.output_options td.mega-value textarea,
|
1613 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table.output_options td.mega-value textarea {
|
1614 |
+
width: 100%; }
|
1615 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table.output_options td.mega-value label,
|
1616 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table.output_options td.mega-value label {
|
1617 |
+
float: none; }
|
1618 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table.sticky_settings tr td:first-child,
|
1619 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table.sticky_settings tr td:first-child {
|
1620 |
+
width: 33%; }
|
1621 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td.mega-name,
|
1622 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td.mega-name {
|
1623 |
+
width: 33%; }
|
1624 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .megamenu_submit,
|
1625 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .megamenu_submit {
|
1626 |
+
margin-bottom: 0; }
|
1627 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-setting-location_description,
|
1628 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-setting-location_description {
|
1629 |
+
width: 300px; }
|
1630 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes td.mega-name,
|
1631 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes td.mega-name {
|
1632 |
padding-left: 10px;
|
1643 |
width: 100%; }
|
1644 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container,
|
1645 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container {
|
1646 |
+
font-size: 14px;
|
1647 |
border: 1px solid #DFDFDF; }
|
1648 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .accordion-section-title,
|
1649 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .accordion-section-title {
|
1650 |
+
padding: 10px; }
|
1651 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section h4,
|
1652 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section h4 {
|
1653 |
+
margin: 0;
|
1654 |
+
font-size: 0.9em; }
|
1655 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .dashicons-yes,
|
1656 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .dashicons-yes {
|
1657 |
+
display: none; }
|
1658 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section.mega-location-enabled .dashicons-yes,
|
1659 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section.mega-location-enabled .dashicons-yes {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1660 |
display: inline-block;
|
1661 |
+
color: #46b450; }
|
1662 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .dashicons,
|
1663 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .dashicons {
|
1664 |
+
font-size: 18px;
|
1665 |
+
vertical-align: middle;
|
1666 |
+
margin-right: 6px; }
|
1667 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .mega-assigned-menu,
|
1668 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .mega-assigned-menu {
|
1669 |
+
float: right;
|
1670 |
+
padding: 10px;
|
1671 |
+
font-size: 0.9em; }
|
1672 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .mega-assigned-menu .dashicons,
|
1673 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-container .accordion-section .mega-assigned-menu .dashicons {
|
1674 |
+
margin-right: 2px; }
|
1675 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .warning,
|
1676 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .warning {
|
1677 |
+
margin: 10px; }
|
1678 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content .warning,
|
1679 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content .warning {
|
1680 |
+
margin: 20px 0 0 0; }
|
1681 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table .mega-value textarea,
|
1682 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table .mega-value textarea {
|
1683 |
+
height: 40px;
|
1684 |
+
width: 500px;
|
1685 |
+
padding: 10px; }
|
1686 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations h5,
|
1687 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations h5 {
|
1688 |
font-size: 12px; }
|
1689 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content,
|
1690 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content {
|
1691 |
width: 100%;
|
1692 |
+
box-sizing: border-box;
|
1693 |
+
padding: 0; }
|
1694 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content .accordion-wrapper,
|
1695 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content .accordion-wrapper {
|
1696 |
+
padding: 10px 20px; }
|
1697 |
+
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content .megamenu_submit,
|
1698 |
+
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .accordion-section-content .megamenu_submit {
|
1699 |
+
border-top: 1px solid #ddd;
|
1700 |
+
box-sizing: border-box;
|
1701 |
+
padding: 20px;
|
1702 |
+
background: #f7f7f7;
|
1703 |
+
margin-top: 20px; }
|
1704 |
body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table,
|
1705 |
body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table {
|
1706 |
width: 100%;
|
css/admin/admin.scss
CHANGED
@@ -48,7 +48,15 @@ $header_height: 75px;
|
|
48 |
text-align: left;
|
49 |
}
|
50 |
}
|
|
|
51 |
.nav-menus-php {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
&.mega-colorbox-open {
|
54 |
ul#adminmenu a.wp-has-current-submenu:after,
|
@@ -57,14 +65,6 @@ $header_height: 75px;
|
|
57 |
}
|
58 |
}
|
59 |
|
60 |
-
#cboxOverlay {
|
61 |
-
left: 160px;
|
62 |
-
}
|
63 |
-
|
64 |
-
#colorbox {
|
65 |
-
transform: translateX(80px);
|
66 |
-
z-index: 99999;
|
67 |
-
}
|
68 |
#cboxContent {
|
69 |
padding: 0;
|
70 |
user-select: none;
|
@@ -1323,17 +1323,6 @@ $header_height: 75px;
|
|
1323 |
}
|
1324 |
|
1325 |
&.megamenu_enabled {
|
1326 |
-
|
1327 |
-
.mm_launch {
|
1328 |
-
background: $light_blue;
|
1329 |
-
border-color: #0074a2;
|
1330 |
-
}
|
1331 |
-
|
1332 |
-
.mm_launch.mm_disabled {
|
1333 |
-
background: $dark_grey;
|
1334 |
-
border-color: $text_grey;
|
1335 |
-
}
|
1336 |
-
|
1337 |
.mm_prefix {
|
1338 |
display: block;
|
1339 |
font-size: 0.9em;
|
@@ -1356,8 +1345,8 @@ $header_height: 75px;
|
|
1356 |
width: auto;
|
1357 |
font-weight: normal;
|
1358 |
height: auto;
|
1359 |
-
background: $
|
1360 |
-
border-color:
|
1361 |
border-width: 1px;
|
1362 |
padding: 1px 5px;
|
1363 |
border-radius: 3px;
|
@@ -1397,122 +1386,83 @@ $header_height: 75px;
|
|
1397 |
}
|
1398 |
}
|
1399 |
|
1400 |
-
.mega_menu_meta_box {
|
1401 |
-
div
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
cursor: pointer;
|
1406 |
outline: none;
|
1407 |
float: left;
|
1408 |
width: 100%;
|
1409 |
-
color: $dark_grey;
|
1410 |
-
font-size: 14px;
|
1411 |
-
font-weight: normal;
|
1412 |
border: 0;
|
|
|
|
|
|
|
|
|
|
|
1413 |
|
1414 |
-
|
1415 |
-
color: $text_grey;
|
1416 |
-
|
1417 |
-
&::before {
|
1418 |
-
color: $black;
|
1419 |
-
}
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
&::before {
|
1423 |
-
right: 0;
|
1424 |
-
content: '\f139';
|
1425 |
-
border: 0;
|
1426 |
-
background: 0 0;
|
1427 |
-
font: 400 20px/1 dashicons;
|
1428 |
-
speak: none;
|
1429 |
-
float: left;
|
1430 |
-
padding: 0;
|
1431 |
-
text-indent: 0;
|
1432 |
-
text-align: center;
|
1433 |
-
position: relative;
|
1434 |
-
-webkit-font-smoothing: antialiased;
|
1435 |
-
-moz-osx-font-smoothing: grayscale;
|
1436 |
-
text-decoration: none !important;
|
1437 |
margin-right: 6px;
|
1438 |
}
|
1439 |
}
|
1440 |
|
1441 |
-
|
1442 |
-
|
|
|
|
|
1443 |
|
1444 |
-
|
1445 |
-
|
1446 |
}
|
1447 |
}
|
1448 |
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
border: 0;
|
1454 |
-
background: 0 0;
|
1455 |
-
font: 400 20px/1 dashicons;
|
1456 |
-
speak: none;
|
1457 |
-
float: left;
|
1458 |
-
padding: 0;
|
1459 |
-
text-indent: 0;
|
1460 |
-
text-align: center;
|
1461 |
-
position: relative;
|
1462 |
-
-webkit-font-smoothing: antialiased;
|
1463 |
-
-moz-osx-font-smoothing: grayscale;
|
1464 |
-
text-decoration: none !important;
|
1465 |
-
margin-right: 6px;
|
1466 |
-
}
|
1467 |
}
|
1468 |
-
}
|
1469 |
|
1470 |
-
div.accordion_content {
|
1471 |
-
padding: 0 0 20px 0;
|
1472 |
-
float: left;
|
1473 |
-
border: 0;
|
1474 |
-
width: 100%;
|
1475 |
-
}
|
1476 |
-
|
1477 |
-
div {
|
1478 |
table {
|
1479 |
font-size: 0.9em;
|
1480 |
width: 100%;
|
1481 |
margin-bottom: 5px;
|
1482 |
border-collapse: collapse;
|
1483 |
-
|
1484 |
-
font-size: 0.9em;
|
1485 |
-
max-width: 120px;
|
1486 |
-
}
|
1487 |
-
select.megamenu_effect_mobile {
|
1488 |
-
max-width: 80px;
|
1489 |
-
}
|
1490 |
tr {
|
1491 |
height: 29px;
|
1492 |
vertical-align: middle;
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
text-align: right;
|
1501 |
-
min-width: 150px;
|
1502 |
}
|
1503 |
-
}
|
1504 |
-
}
|
1505 |
-
}
|
1506 |
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1512 |
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
|
|
|
|
|
|
|
|
|
|
1516 |
}
|
1517 |
}
|
1518 |
|
@@ -1529,13 +1479,6 @@ $header_height: 75px;
|
|
1529 |
}
|
1530 |
}
|
1531 |
|
1532 |
-
#nav-menu-meta {
|
1533 |
-
.mega_menu_meta_box {
|
1534 |
-
.accordion-section-content {
|
1535 |
-
padding: 0 10px;
|
1536 |
-
}
|
1537 |
-
}
|
1538 |
-
}
|
1539 |
|
1540 |
.menu-item-handle {
|
1541 |
.item-title {
|
@@ -1919,6 +1862,68 @@ body.toplevel_page_maxmegamenu {
|
|
1919 |
|
1920 |
.menu_settings {
|
1921 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1922 |
&.menu_settings_menu_themes {
|
1923 |
|
1924 |
td.mega-name {
|
@@ -1944,41 +1949,60 @@ body.toplevel_page_maxmegamenu {
|
|
1944 |
&.menu_settings_menu_locations {
|
1945 |
|
1946 |
.accordion-container {
|
|
|
1947 |
border: 1px solid $grey;
|
1948 |
|
1949 |
-
|
1950 |
-
margin: 0;
|
1951 |
-
}
|
1952 |
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
}
|
1957 |
-
}
|
1958 |
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
|
|
1966 |
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1977 |
}
|
1978 |
}
|
1979 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1980 |
table .mega-value textarea {
|
1981 |
height: 40px;
|
|
|
|
|
1982 |
}
|
1983 |
|
1984 |
h5 {
|
@@ -1988,6 +2012,19 @@ body.toplevel_page_maxmegamenu {
|
|
1988 |
.accordion-section-content {
|
1989 |
width: 100%;
|
1990 |
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1991 |
}
|
1992 |
}
|
1993 |
|
48 |
text-align: left;
|
49 |
}
|
50 |
}
|
51 |
+
|
52 |
.nav-menus-php {
|
53 |
+
#cboxOverlay {
|
54 |
+
left: 160px;
|
55 |
+
}
|
56 |
+
|
57 |
+
#colorbox {
|
58 |
+
transform: translateX(80px);
|
59 |
+
}
|
60 |
|
61 |
&.mega-colorbox-open {
|
62 |
ul#adminmenu a.wp-has-current-submenu:after,
|
65 |
}
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
#cboxContent {
|
69 |
padding: 0;
|
70 |
user-select: none;
|
1323 |
}
|
1324 |
|
1325 |
&.megamenu_enabled {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1326 |
.mm_prefix {
|
1327 |
display: block;
|
1328 |
font-size: 0.9em;
|
1345 |
width: auto;
|
1346 |
font-weight: normal;
|
1347 |
height: auto;
|
1348 |
+
background: $light_blue;
|
1349 |
+
border-color: #0074a2;
|
1350 |
border-width: 1px;
|
1351 |
padding: 1px 5px;
|
1352 |
border-radius: 3px;
|
1386 |
}
|
1387 |
}
|
1388 |
|
1389 |
+
#nav-menu-meta .mega_menu_meta_box {
|
1390 |
+
div.accordion-section-content {
|
1391 |
+
padding: 0 10px;
|
1392 |
+
|
1393 |
+
h4 {
|
|
|
1394 |
outline: none;
|
1395 |
float: left;
|
1396 |
width: 100%;
|
|
|
|
|
|
|
1397 |
border: 0;
|
1398 |
+
margin: 10px 0 0;
|
1399 |
+
padding-bottom: 10px;
|
1400 |
+
white-space: nowrap;
|
1401 |
+
overflow: hidden;
|
1402 |
+
text-overflow: ellipsis;
|
1403 |
|
1404 |
+
.dashicons {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1405 |
margin-right: 6px;
|
1406 |
}
|
1407 |
}
|
1408 |
|
1409 |
+
#megamenu_accordion h4 {
|
1410 |
+
cursor: pointer;
|
1411 |
+
border-bottom: 0;
|
1412 |
+
padding-bottom: 0;
|
1413 |
|
1414 |
+
&.ui-accordion-header-active {
|
1415 |
+
padding-bottom: 10px;
|
1416 |
}
|
1417 |
}
|
1418 |
|
1419 |
+
div.accordion_content {
|
1420 |
+
float: left;
|
1421 |
+
border: 0;
|
1422 |
+
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1423 |
}
|
|
|
1424 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1425 |
table {
|
1426 |
font-size: 0.9em;
|
1427 |
width: 100%;
|
1428 |
margin-bottom: 5px;
|
1429 |
border-collapse: collapse;
|
1430 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
1431 |
tr {
|
1432 |
height: 29px;
|
1433 |
vertical-align: middle;
|
1434 |
+
|
1435 |
+
td {
|
1436 |
+
&:nth-child(2) {
|
1437 |
+
text-align: right;
|
1438 |
+
min-width: 150px;
|
1439 |
+
padding: 2px 0;
|
1440 |
+
}
|
|
|
|
|
1441 |
}
|
|
|
|
|
|
|
1442 |
|
1443 |
+
select {
|
1444 |
+
font-size: 0.9em;
|
1445 |
+
max-width: 120px;
|
1446 |
+
margin: 0;
|
1447 |
+
|
1448 |
+
&.megamenu_effect_mobile {
|
1449 |
+
max-width: 80px;
|
1450 |
+
}
|
1451 |
+
}
|
1452 |
+
|
1453 |
+
input[type=checkbox] {
|
1454 |
+
margin: 0;
|
1455 |
+
}
|
1456 |
+
}
|
1457 |
|
1458 |
+
&.sticky_settings {
|
1459 |
+
td {
|
1460 |
+
&:nth-child(2) {
|
1461 |
+
text-align: right;
|
1462 |
+
min-width: 100px;
|
1463 |
+
}
|
1464 |
+
}
|
1465 |
+
}
|
1466 |
}
|
1467 |
}
|
1468 |
|
1479 |
}
|
1480 |
}
|
1481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1482 |
|
1483 |
.menu-item-handle {
|
1484 |
.item-title {
|
1862 |
|
1863 |
.menu_settings {
|
1864 |
|
1865 |
+
&.menu_settings_menu_locations {
|
1866 |
+
|
1867 |
+
.mega-add-location {
|
1868 |
+
float: right;
|
1869 |
+
}
|
1870 |
+
div.mega-tab-content {
|
1871 |
+
border: 0;
|
1872 |
+
}
|
1873 |
+
.nav-tab-wrapper {
|
1874 |
+
border: 0;
|
1875 |
+
|
1876 |
+
a.nav-tab,
|
1877 |
+
a.nav-tab-active {
|
1878 |
+
font-size: 11px;
|
1879 |
+
font-weight: normal;
|
1880 |
+
padding: 3px 5px;
|
1881 |
+
border: 0;
|
1882 |
+
margin: 0 10px 0 0;
|
1883 |
+
background: white;
|
1884 |
+
color: $text_grey;
|
1885 |
+
border-radius: 3px;
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
a.nav-tab-active {
|
1889 |
+
background: $light_blue;
|
1890 |
+
color: white;
|
1891 |
+
}
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
table td {
|
1895 |
+
padding-bottom: 0;
|
1896 |
+
|
1897 |
+
&.mega-name {
|
1898 |
+
width: 25%;
|
1899 |
+
}
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
table.output_options td.mega-value {
|
1903 |
+
textarea {
|
1904 |
+
width: 100%;
|
1905 |
+
}
|
1906 |
+
label {
|
1907 |
+
float: none;
|
1908 |
+
}
|
1909 |
+
}
|
1910 |
+
|
1911 |
+
table.sticky_settings tr td:first-child {
|
1912 |
+
width: 33%;
|
1913 |
+
}
|
1914 |
+
|
1915 |
+
.mega-tab-content table td.mega-name {
|
1916 |
+
width: 33%;
|
1917 |
+
}
|
1918 |
+
|
1919 |
+
.megamenu_submit {
|
1920 |
+
margin-bottom: 0;
|
1921 |
+
}
|
1922 |
+
.mega-setting-location_description {
|
1923 |
+
width: 300px;
|
1924 |
+
}
|
1925 |
+
}
|
1926 |
+
|
1927 |
&.menu_settings_menu_themes {
|
1928 |
|
1929 |
td.mega-name {
|
1949 |
&.menu_settings_menu_locations {
|
1950 |
|
1951 |
.accordion-container {
|
1952 |
+
font-size: 14px;
|
1953 |
border: 1px solid $grey;
|
1954 |
|
1955 |
+
.accordion-section {
|
|
|
|
|
1956 |
|
1957 |
+
.accordion-section-title {
|
1958 |
+
padding: 10px;
|
1959 |
+
}
|
|
|
|
|
1960 |
|
1961 |
+
h4 {
|
1962 |
+
margin: 0;
|
1963 |
+
font-size: 0.9em;
|
1964 |
+
}
|
1965 |
+
|
1966 |
+
.dashicons-yes {
|
1967 |
+
display: none;
|
1968 |
+
}
|
1969 |
|
1970 |
+
&.mega-location-enabled .dashicons-yes {
|
1971 |
+
display: inline-block;
|
1972 |
+
color: $green;
|
1973 |
+
}
|
1974 |
+
|
1975 |
+
.dashicons {
|
1976 |
+
font-size: 18px;
|
1977 |
+
vertical-align: middle;
|
1978 |
+
margin-right: 6px;
|
1979 |
+
}
|
1980 |
+
|
1981 |
+
.mega-assigned-menu {
|
1982 |
+
float: right;
|
1983 |
+
padding: 10px;
|
1984 |
+
font-size: 0.9em;
|
1985 |
+
|
1986 |
+
.dashicons {
|
1987 |
+
margin-right: 2px;
|
1988 |
+
}
|
1989 |
+
}
|
1990 |
}
|
1991 |
}
|
1992 |
|
1993 |
+
.warning {
|
1994 |
+
margin: 10px;
|
1995 |
+
}
|
1996 |
+
|
1997 |
+
.mega-tab-content {
|
1998 |
+
.warning {
|
1999 |
+
margin: 20px 0 0 0;
|
2000 |
+
}
|
2001 |
+
}
|
2002 |
table .mega-value textarea {
|
2003 |
height: 40px;
|
2004 |
+
width: 500px;
|
2005 |
+
padding: 10px;
|
2006 |
}
|
2007 |
|
2008 |
h5 {
|
2012 |
.accordion-section-content {
|
2013 |
width: 100%;
|
2014 |
box-sizing: border-box;
|
2015 |
+
padding: 0;
|
2016 |
+
|
2017 |
+
.accordion-wrapper {
|
2018 |
+
padding: 10px 20px;
|
2019 |
+
}
|
2020 |
+
|
2021 |
+
.megamenu_submit {
|
2022 |
+
border-top: 1px solid #ddd;
|
2023 |
+
box-sizing: border-box;
|
2024 |
+
padding: 20px;
|
2025 |
+
background: $light_grey;
|
2026 |
+
margin-top: 20px;
|
2027 |
+
}
|
2028 |
}
|
2029 |
}
|
2030 |
|
css/megamenu.scss
CHANGED
@@ -670,6 +670,10 @@
|
|
670 |
font-weight: $panel_second_level_font_weight_hover;
|
671 |
text-decoration: $panel_second_level_text_decoration_hover;
|
672 |
@include background($panel_second_level_background_hover_from, $panel_second_level_background_hover_to);
|
|
|
|
|
|
|
|
|
673 |
}
|
674 |
|
675 |
li.mega-menu-item {
|
670 |
font-weight: $panel_second_level_font_weight_hover;
|
671 |
text-decoration: $panel_second_level_text_decoration_hover;
|
672 |
@include background($panel_second_level_background_hover_from, $panel_second_level_background_hover_to);
|
673 |
+
|
674 |
+
> span.mega-title-below {
|
675 |
+
text-decoration: $panel_second_level_text_decoration_hover;
|
676 |
+
}
|
677 |
}
|
678 |
|
679 |
li.mega-menu-item {
|
js/maxmegamenu.js
CHANGED
@@ -414,6 +414,11 @@
|
|
414 |
|
415 |
plugin.unbindClickEvents = function() {
|
416 |
$("> a.mega-menu-link", items_with_submenus).off("click.megamenu touchend.megamenu");
|
|
|
|
|
|
|
|
|
|
|
417 |
};
|
418 |
|
419 |
plugin.unbindHoverEvents = function() {
|
414 |
|
415 |
plugin.unbindClickEvents = function() {
|
416 |
$("> a.mega-menu-link", items_with_submenus).off("click.megamenu touchend.megamenu");
|
417 |
+
|
418 |
+
if ( plugin.isMobileView() ) {
|
419 |
+
var collapse_children_parents = $("li.mega-menu-megamenu li.mega-menu-item-has-children.mega-collapse-children > a.mega-menu-link"); // these are always activated on click
|
420 |
+
collapse_children_parents.off("click.megamenu touchend.megamenu");
|
421 |
+
}
|
422 |
};
|
423 |
|
424 |
plugin.unbindHoverEvents = function() {
|
js/settings.js
CHANGED
@@ -112,8 +112,8 @@ jQuery(function ($) {
|
|
112 |
selected_tab.siblings().removeClass('nav-tab-active');
|
113 |
selected_tab.addClass('nav-tab-active');
|
114 |
var content_to_show = $(this).attr('data-tab');
|
115 |
-
$('.mega-tab-content').hide();
|
116 |
-
$('.' + content_to_show).show();
|
117 |
});
|
118 |
|
119 |
$(".theme_editor").on("submit", function(e) {
|
112 |
selected_tab.siblings().removeClass('nav-tab-active');
|
113 |
selected_tab.addClass('nav-tab-active');
|
114 |
var content_to_show = $(this).attr('data-tab');
|
115 |
+
$(this).parent().parent().find('.mega-tab-content').hide();
|
116 |
+
$(this).parent().parent().find('.' + content_to_show).show();
|
117 |
});
|
118 |
|
119 |
$(".theme_editor").on("submit", function(e) {
|
megamenu.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Max Mega Menu
|
5 |
* Plugin URI: https://www.megamenu.com
|
6 |
* Description: An easy to use mega menu plugin. Written the WordPress way.
|
7 |
-
* Version: 2.
|
8 |
* Author: megamenu.com
|
9 |
* Author URI: https://www.megamenu.com
|
10 |
* License: GPL-2.0+
|
@@ -36,7 +36,7 @@ final class Mega_Menu {
|
|
36 |
/**
|
37 |
* @var string
|
38 |
*/
|
39 |
-
public $version = '2.
|
40 |
|
41 |
|
42 |
/**
|
@@ -67,6 +67,7 @@ final class Mega_Menu {
|
|
67 |
$this->includes();
|
68 |
|
69 |
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
|
|
|
70 |
add_action( 'admin_init', array( $this, 'install_upgrade_check' ) );
|
71 |
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
|
72 |
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
@@ -105,6 +106,7 @@ final class Mega_Menu {
|
|
105 |
new Mega_Menu_Widget_Manager();
|
106 |
new Mega_Menu_Menu_Item_Manager();
|
107 |
new Mega_Menu_Settings();
|
|
|
108 |
}
|
109 |
|
110 |
if ( class_exists( 'Mega_Menu_Toggle_Blocks' ) ) {
|
@@ -145,7 +147,8 @@ final class Mega_Menu {
|
|
145 |
*/
|
146 |
public function admin_enqueue_scripts( $hook ) {
|
147 |
if ( ! wp_script_is('maxmegamenu') ) {
|
148 |
-
|
|
|
149 |
// load widget scripts and styles first to allow us to dequeue conflicting colorbox scripts from other plugins
|
150 |
do_action( 'sidebar_admin_setup' );
|
151 |
do_action( 'admin_enqueue_scripts', 'widgets.php' );
|
@@ -276,6 +279,25 @@ final class Mega_Menu {
|
|
276 |
}
|
277 |
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
/**
|
280 |
* Shortcode used to display a menu
|
281 |
*
|
@@ -331,6 +353,7 @@ final class Mega_Menu {
|
|
331 |
'mega_menu_nav_menus' => MEGAMENU_PATH . 'classes/nav-menus.class.php',
|
332 |
'mega_menu_style_manager' => MEGAMENU_PATH . 'classes/style-manager.class.php',
|
333 |
'mega_menu_settings' => MEGAMENU_PATH . 'classes/settings.class.php',
|
|
|
334 |
'mega_menu_widget' => MEGAMENU_PATH . 'classes/widget.class.php',
|
335 |
'mega_menu_widget_reusable_block' => MEGAMENU_PATH . 'classes/widget-reusable-block.class.php',
|
336 |
'mega_menu_widget_elementor_template' => MEGAMENU_PATH . 'classes/widget-elementor-template.class.php',
|
@@ -1133,7 +1156,7 @@ final class Mega_Menu {
|
|
1133 |
"data-effect-mobile" => $effect_mobile,
|
1134 |
"data-effect-speed-mobile" => $effect_speed_mobile,
|
1135 |
"data-panel-width" => preg_match('/^\d/', $menu_theme['panel_width']) !== 1 ? $menu_theme['panel_width'] : '',
|
1136 |
-
"data-panel-inner-width" => substr( $menu_theme['panel_inner_width'], -1 ) !== '%' ? $menu_theme['panel_inner_width'] : '',
|
1137 |
"data-mobile-force-width" => $mobile_force_width,
|
1138 |
"data-second-click" => $second_click,
|
1139 |
"data-document-click" => 'collapse',
|
4 |
* Plugin Name: Max Mega Menu
|
5 |
* Plugin URI: https://www.megamenu.com
|
6 |
* Description: An easy to use mega menu plugin. Written the WordPress way.
|
7 |
+
* Version: 2.8
|
8 |
* Author: megamenu.com
|
9 |
* Author URI: https://www.megamenu.com
|
10 |
* License: GPL-2.0+
|
36 |
/**
|
37 |
* @var string
|
38 |
*/
|
39 |
+
public $version = '2.8';
|
40 |
|
41 |
|
42 |
/**
|
67 |
$this->includes();
|
68 |
|
69 |
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
|
70 |
+
add_action( 'init', array( $this, 'register_sidebar' ) );
|
71 |
add_action( 'admin_init', array( $this, 'install_upgrade_check' ) );
|
72 |
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
|
73 |
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
106 |
new Mega_Menu_Widget_Manager();
|
107 |
new Mega_Menu_Menu_Item_Manager();
|
108 |
new Mega_Menu_Settings();
|
109 |
+
new Mega_Menu_Menu_Locations();
|
110 |
}
|
111 |
|
112 |
if ( class_exists( 'Mega_Menu_Toggle_Blocks' ) ) {
|
147 |
*/
|
148 |
public function admin_enqueue_scripts( $hook ) {
|
149 |
if ( ! wp_script_is('maxmegamenu') ) {
|
150 |
+
|
151 |
+
if ( in_array( $hook, array('nav-menus.php', 'gutenberg_page_gutenberg-navigation') ) ) {
|
152 |
// load widget scripts and styles first to allow us to dequeue conflicting colorbox scripts from other plugins
|
153 |
do_action( 'sidebar_admin_setup' );
|
154 |
do_action( 'admin_enqueue_scripts', 'widgets.php' );
|
279 |
}
|
280 |
|
281 |
|
282 |
+
/**
|
283 |
+
* Create our own widget area to store all mega menu widgets.
|
284 |
+
* All widgets from all menus are stored here, they are filtered later
|
285 |
+
* to ensure the correct widgets show under the correct menu item.
|
286 |
+
*
|
287 |
+
* @since 1.0
|
288 |
+
*/
|
289 |
+
public function register_sidebar() {
|
290 |
+
|
291 |
+
register_sidebar(
|
292 |
+
array(
|
293 |
+
'id' => 'mega-menu',
|
294 |
+
'name' => __("Max Mega Menu Widgets", "megamenu"),
|
295 |
+
'description' => __("This is where Max Mega Menu stores widgets that you have added to sub menus using the mega menu builder. You can edit existing widgets here, but new widgets must be added through the Mega Menu interface (under Appearance > Menus).", "megamenu")
|
296 |
+
)
|
297 |
+
);
|
298 |
+
}
|
299 |
+
|
300 |
+
|
301 |
/**
|
302 |
* Shortcode used to display a menu
|
303 |
*
|
353 |
'mega_menu_nav_menus' => MEGAMENU_PATH . 'classes/nav-menus.class.php',
|
354 |
'mega_menu_style_manager' => MEGAMENU_PATH . 'classes/style-manager.class.php',
|
355 |
'mega_menu_settings' => MEGAMENU_PATH . 'classes/settings.class.php',
|
356 |
+
'mega_menu_menu_locations' => MEGAMENU_PATH . 'classes/page.locations.class.php',
|
357 |
'mega_menu_widget' => MEGAMENU_PATH . 'classes/widget.class.php',
|
358 |
'mega_menu_widget_reusable_block' => MEGAMENU_PATH . 'classes/widget-reusable-block.class.php',
|
359 |
'mega_menu_widget_elementor_template' => MEGAMENU_PATH . 'classes/widget-elementor-template.class.php',
|
1156 |
"data-effect-mobile" => $effect_mobile,
|
1157 |
"data-effect-speed-mobile" => $effect_speed_mobile,
|
1158 |
"data-panel-width" => preg_match('/^\d/', $menu_theme['panel_width']) !== 1 ? $menu_theme['panel_width'] : '',
|
1159 |
+
"data-panel-inner-width" => substr( trim( $menu_theme['panel_inner_width'] ), -1 ) !== '%' ? $menu_theme['panel_inner_width'] : '',
|
1160 |
"data-mobile-force-width" => $mobile_force_width,
|
1161 |
"data-second-click" => $second_click,
|
1162 |
"data-document-click" => 'collapse',
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: megamenu
|
|
3 |
Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.4
|
6 |
-
Stable tag: 2.7.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -133,6 +133,14 @@ See https://www.megamenu.com for more screenshots
|
|
133 |
|
134 |
== Changelog ==
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
= 2.7.7 =
|
137 |
|
138 |
* Refactor: Improve method to determine the depth of a menu item (when loading menu item options in back end)
|
3 |
Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
|
4 |
Requires at least: 4.9
|
5 |
Tested up to: 5.4
|
6 |
+
Stable tag: 2.7.7
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
133 |
|
134 |
== Changelog ==
|
135 |
|
136 |
+
= 2.8 =
|
137 |
+
|
138 |
+
* New: Allow menu location settings to be adjusted from the Mega Menu > Menu Locations page
|
139 |
+
* Fix: Trim "Panel Width" settings in theme editor to prevent attributes from being malformed
|
140 |
+
* Fix: Hover text decoration not applied when Icon Position is set to "Top"
|
141 |
+
* Fix: Divi reload bug, ensure sidebar is registered on front and back end
|
142 |
+
* Fix: collapsable sub menus open and close themselves in mobile view
|
143 |
+
|
144 |
= 2.7.7 =
|
145 |
|
146 |
* Refactor: Improve method to determine the depth of a menu item (when loading menu item options in back end)
|