Max Mega Menu - Version 2.8.0.3

Version Description

Download this release

Release Info

Developer megamenu
Plugin Icon 128x128 Max Mega Menu
Version 2.8.0.3
Comparing to
See all releases

Code changes from version 2.8 to 2.8.0.3

classes/menu-item-manager.class.php CHANGED
@@ -684,7 +684,7 @@ class Mega_Menu_Menu_Item_Manager {
684
  $return .= __("Icon Position", "megamenu");
685
  $return .= ' </td>';
686
  $return .= ' <td class="mega-value">';
687
- $return .= ' <select id="mega-item-align" name="settings[icon_position]">';
688
  $return .= ' <option value="left" ' . selected( $menu_item_meta['icon_position'], 'left', false ) . '>' . __("Left", "megamenu") . '</option>';
689
  $return .= ' <option value="top" ' . selected( $menu_item_meta['icon_position'], 'top', false ) . '>' . __("Top", "megamenu") . '</option>';
690
  $return .= ' <option value="right" ' . selected( $menu_item_meta['icon_position'], 'right', false ) . '>' . __("Right", "megamenu") . '</option>';
684
  $return .= __("Icon Position", "megamenu");
685
  $return .= ' </td>';
686
  $return .= ' <td class="mega-value">';
687
+ $return .= ' <select name="settings[icon_position]">';
688
  $return .= ' <option value="left" ' . selected( $menu_item_meta['icon_position'], 'left', false ) . '>' . __("Left", "megamenu") . '</option>';
689
  $return .= ' <option value="top" ' . selected( $menu_item_meta['icon_position'], 'top', false ) . '>' . __("Top", "megamenu") . '</option>';
690
  $return .= ' <option value="right" ' . selected( $menu_item_meta['icon_position'], 'right', false ) . '>' . __("Right", "megamenu") . '</option>';
classes/nav-menus.class.php CHANGED
@@ -201,8 +201,7 @@ class Mega_Menu_Nav_Menus {
201
  wp_enqueue_script( 'maxmegamenu', MEGAMENU_BASE_URL . 'js/admin.js', array(
202
  'jquery',
203
  'jquery-ui-core',
204
- 'jquery-ui-sortable',
205
- 'jquery-ui-accordion'),
206
  MEGAMENU_VERSION );
207
 
208
  wp_enqueue_script( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/jquery.colorbox-min.js', array( 'jquery' ), MEGAMENU_VERSION );
@@ -298,7 +297,6 @@ class Mega_Menu_Nav_Menus {
298
 
299
  if ( ! count( $theme_locations ) ) {
300
  $link = '<a href="https://www.megamenu.com/documentation/widget/?utm_source=free&amp;utm_medium=link&amp;utm_campaign=pro" target="_blank">' . __("here", "megamenu") . '</a>';
301
-
302
  echo "<p>" . __("This theme does not register any menu locations.", "megamenu") . "</p>";
303
  echo "<p>" . __("You will need to create a new menu location and use the Max Mega Menu widget or shortcode to display the menu on your site.", "megamenu") . "</p>";
304
  echo "<p>" . str_replace( "{link}", $link, __("Click {link} for instructions.", "megamenu") ) . "</p>";
@@ -306,41 +304,40 @@ class Mega_Menu_Nav_Menus {
306
  echo "<p>" . __("Please assign this menu to a theme location to enable the Mega Menu settings.", "megamenu") . "</p>";
307
  echo "<p>" . __("To assign this menu to a theme location, scroll to the bottom of this page and tag the menu to a 'Display location'.", "megamenu") . "</p>";
308
  } else { ?>
309
-
310
- <?php if ( count( $tagged_menu_locations ) == 1 ) : ?>
311
  <?php
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
-
322
- ?>
323
- <?php else: ?>
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>
331
- <?php endif; ?>
332
- <?php endforeach;?>
333
- </div>
334
- <?php endif; ?>
 
 
 
 
 
335
 
336
  <?php submit_button( __( 'Save' ), 'max-mega-menu-save button-primary alignright'); ?>
337
 
338
  <span class='spinner'></span>
339
-
340
  <?php
341
-
342
  }
343
-
344
  }
345
 
346
  /**
201
  wp_enqueue_script( 'maxmegamenu', MEGAMENU_BASE_URL . 'js/admin.js', array(
202
  'jquery',
203
  'jquery-ui-core',
204
+ 'jquery-ui-sortable'),
 
205
  MEGAMENU_VERSION );
206
 
207
  wp_enqueue_script( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/jquery.colorbox-min.js', array( 'jquery' ), MEGAMENU_VERSION );
297
 
298
  if ( ! count( $theme_locations ) ) {
299
  $link = '<a href="https://www.megamenu.com/documentation/widget/?utm_source=free&amp;utm_medium=link&amp;utm_campaign=pro" target="_blank">' . __("here", "megamenu") . '</a>';
 
300
  echo "<p>" . __("This theme does not register any menu locations.", "megamenu") . "</p>";
301
  echo "<p>" . __("You will need to create a new menu location and use the Max Mega Menu widget or shortcode to display the menu on your site.", "megamenu") . "</p>";
302
  echo "<p>" . str_replace( "{link}", $link, __("Click {link} for instructions.", "megamenu") ) . "</p>";
304
  echo "<p>" . __("Please assign this menu to a theme location to enable the Mega Menu settings.", "megamenu") . "</p>";
305
  echo "<p>" . __("To assign this menu to a theme location, scroll to the bottom of this page and tag the menu to a 'Display location'.", "megamenu") . "</p>";
306
  } else { ?>
307
+ <div class='mega-accordion'>
 
308
  <?php
309
+ $i = 0;
310
+ foreach ( $theme_locations as $location => $name ) {
311
+ if ( isset( $tagged_menu_locations[ $location ] ) ) {
312
+ $open_class = $i == 0 ? ' mega-accordion-open' : '';
313
+ $edit_url = admin_url("admin.php?page=maxmegamenu&location={$location}");
314
+ $i++;
315
+ ?>
316
+ <div class='mega-accordion-title<?php echo $open_class; ?>'>
 
 
 
 
 
 
 
317
  <h4><span class='dashicons dashicons-location'></span><?php echo esc_html( $name ); ?></h4>
318
+ <div class='mega-ellipsis'>
319
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false">
320
+ <path d="M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"></path>
321
+ </svg>
322
+ <ul class='mega-ellipsis-content'>
323
+ <li><a href='<?php echo $edit_url; ?>'><span class='dashicons dashicons-external'></span><?php echo __("More options", "megamenu"); ?></a></li>
324
+ </ul>
325
  </div>
326
+ </div>
327
+ <div class='mega-accordion-content'>
328
+ <?php $this->settings_table( $location, $saved_settings ); ?>
329
+ </div>
330
+ <?php
331
+ }
332
+ }
333
+ ?>
334
+ </div>
335
 
336
  <?php submit_button( __( 'Save' ), 'max-mega-menu-save button-primary alignright'); ?>
337
 
338
  <span class='spinner'></span>
 
339
  <?php
 
340
  }
 
341
  }
342
 
343
  /**
classes/pages/general.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // disable direct access
5
+ }
6
+
7
+ if ( ! class_exists( 'Mega_Menu_General' ) ) :
8
+
9
+ /**
10
+ * Handles the Mega Menu > Menu Settings page
11
+ */
12
+ class Mega_Menu_General {
13
+
14
+ /**
15
+ * Constructor
16
+ *
17
+ * @since 1.0
18
+ */
19
+ public function __construct() {
20
+ add_action( 'admin_post_megamenu_save_settings', array( $this, 'save_settings') );
21
+ add_action( 'admin_post_megamenu_clear_css_cache', array( $this, 'tools_clear_css_cache') );
22
+ add_action( 'admin_post_megamenu_delete_data', array( $this, 'delete_data') );
23
+
24
+ add_filter( 'megamenu_menu_tabs', array( $this, 'add_general_tab' ), 4 );
25
+ add_action( 'megamenu_page_general_settings', array( $this, 'general_settings_page'));
26
+
27
+ }
28
+
29
+
30
+ /**
31
+ * Add the Menu Locations tab to our available tabs
32
+ *
33
+ * @param array $tabs
34
+ * @since 2.8
35
+ */
36
+ public function add_general_tab( $tabs ) {
37
+ $tabs['general_settings'] = __("Settings", "megamenu");
38
+ return $tabs;
39
+ }
40
+
41
+ /**
42
+ * Sanitize multidimensional array
43
+ *
44
+ * @since 2.7.5
45
+ */
46
+ public function sanitize_array( &$array ) {
47
+ foreach ( $array as &$value) {
48
+ if ( ! is_array( $value ) ) {
49
+ $value = sanitize_textarea_field( $value );
50
+ } else {
51
+ $this->sanitize_array( $value );
52
+ }
53
+ }
54
+ return $array;
55
+ }
56
+
57
+
58
+ /**
59
+ * Save menu general settings.
60
+ *
61
+ * @since 1.0
62
+ */
63
+ public function save_settings() {
64
+ check_admin_referer( 'megamenu_save_settings' );
65
+
66
+ if ( isset( $_POST['settings'] ) && is_array( $_POST['settings'] ) ) {
67
+ $settings = $this->sanitize_array( $_POST['settings'] );
68
+ $submitted_settings = apply_filters( "megamenu_submitted_settings", $settings );
69
+ $existing_settings = get_option( 'megamenu_settings' );
70
+ $new_settings = array_merge( (array)$existing_settings, $submitted_settings );
71
+
72
+ update_option( 'megamenu_settings', $new_settings );
73
+ }
74
+
75
+ delete_transient('megamenu_failed_to_write_css_to_filesystem');
76
+
77
+ do_action("megamenu_after_save_general_settings");
78
+ do_action("megamenu_delete_cache");
79
+
80
+ $url = isset( $_POST['_wp_http_referer'] ) ? $_POST['_wp_http_referer'] : admin_url( "admin.php?page=maxmegamenu&saved=true" );
81
+
82
+ $this->redirect( $url );
83
+ }
84
+
85
+
86
+
87
+ /**
88
+ * Redirect and exit
89
+ *
90
+ * @since 1.8
91
+ */
92
+ public function redirect( $url ) {
93
+ wp_redirect( $url );
94
+ exit;
95
+ }
96
+
97
+
98
+
99
+
100
+ /**
101
+ * Content for 'Settings' tab
102
+ *
103
+ * @since 1.4
104
+ */
105
+ public function general_settings_page( $saved_settings ) {
106
+
107
+ $css = isset( $saved_settings['css'] ) ? $saved_settings['css'] : 'fs';
108
+ $js = isset( $saved_settings['js'] ) ? $saved_settings['js'] : 'footer';
109
+
110
+ $locations = get_registered_nav_menus();
111
+
112
+ ?>
113
+
114
+ <div class='menu_settings menu_settings_general_settings'>
115
+
116
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
117
+ <input type="hidden" name="action" value="megamenu_save_settings" />
118
+ <?php wp_nonce_field( 'megamenu_save_settings' ); ?>
119
+
120
+ <h3 class='first'><?php _e("General Settings", "megamenu"); ?></h3>
121
+
122
+ <table>
123
+ <tr>
124
+ <td class='mega-name'>
125
+ <?php _e("CSS Output", "megamenu"); ?>
126
+ <div class='mega-description'>
127
+ </div>
128
+ </td>
129
+ <td class='mega-value'>
130
+ <select name='settings[css]' id='mega_css'>
131
+ <option value='fs' <?php echo selected( $css == 'fs'); ?>><?php _e("Save to filesystem", "megamenu"); ?>
132
+ <?php
133
+ if ( get_transient('megamenu_failed_to_write_css_to_filesystem') ) {
134
+ echo " " . __("(Action required: Check upload folder permissions)", "megamenu");
135
+ }
136
+ ?>
137
+ </option>
138
+ <option value='head' <?php echo selected( $css == 'head'); ?>><?php _e("Output in &lt;head&gt;", "megamenu"); ?></option>
139
+ <option value='disabled' <?php echo selected( $css == 'disabled'); ?>><?php _e("Don't output CSS", "megamenu"); ?></option>
140
+ <select>
141
+ <div class='mega-description'>
142
+ <div class='fs' style='display: <?php echo $css == 'fs' ? 'block' : 'none' ?>'><?php _e("CSS will be saved to wp-content/uploads/maxmegamenu/style.css and enqueued from there.", "megamenu"); ?></div>
143
+ <div class='head' style='display: <?php echo $css == 'head' ? 'block' : 'none' ?>'><?php _e("CSS will be loaded from the cache in a &lt;style&gt; tag in the &lt;head&gt; of the page.", "megamenu"); ?></div>
144
+ <div class='disabled' style='display: <?php echo $css == 'disabled' ? 'block' : 'none' ?>'>
145
+ <?php _e("CSS will not be output, you must enqueue the CSS for the menu manually.", "megamenu"); ?>
146
+ <div class='fail'><?php _e("Selecting this option will effectively disable the theme editor and many of the features available in Max Mega Menu and Max Mega Menu Pro. Only enable this option if you fully understand the consequences.", "megamenu"); ?>
147
+ </div>
148
+ </div>
149
+ </td>
150
+ </tr>
151
+ <tr>
152
+ <td class='mega-name'>
153
+ <?php _e("JavaScript Output", "megamenu"); ?>
154
+ <div class='mega-description'>
155
+ </div>
156
+ </td>
157
+ <td class='mega-value'>
158
+ <select name='settings[js]' id='mega_css'>
159
+ <option value='footer' <?php echo selected( $js == 'footer'); ?>><?php _e("Footer (default)", "megamenu"); ?></option>
160
+ <option value='head' <?php echo selected( $js == 'head'); ?>><?php _e("Output in &lt;head&gt;", "megamenu"); ?></option>
161
+ <select>
162
+ </td>
163
+ </tr>
164
+ </table>
165
+
166
+ <?php do_action( "megamenu_general_settings", $saved_settings ); ?>
167
+
168
+ <?php submit_button(); ?>
169
+ </form>
170
+ </div>
171
+
172
+ <?php
173
+ }
174
+
175
+
176
+ /**
177
+ * Display messages to the user
178
+ *
179
+ * @since 1.0
180
+ */
181
+ public function print_messages() {
182
+
183
+ if ( isset( $_GET['clear_css_cache'] ) && $_GET['clear_css_cache'] == 'true' ) {
184
+ echo "<p class='success'>";
185
+ echo __("The cache has been cleared and the menu CSS has been regenerated.", "megamenu");
186
+
187
+ $active_plugins = max_mega_menu_get_active_caching_plugins();
188
+
189
+ if ( count( $active_plugins ) ) {
190
+ echo "<br /><br />";
191
+ echo __("You may also need to clear the cache for any Caching, Minification or CDN plugin you have installed.", "megamenu");
192
+ }
193
+
194
+ echo "</p>";
195
+ }
196
+
197
+ if ( isset( $_GET['delete_data'] ) && $_GET['delete_data'] == 'true' ) {
198
+ echo "<p class='success'>" . __("All plugin data removed", "megamenu") . "</p>";
199
+ }
200
+
201
+ if ( is_plugin_active('clearfy/clearfy.php') ) {
202
+ if ( $clearfy_options = get_option('wbcr_clearfy_cache_options') ) {
203
+ if ( $clearfy_options['disable_dashicons'] == true ) {
204
+ echo "<p class='fail'>" . __("Please enable Dashicons in the Clearfy plugin options. Max Mega Menu requires Dashicons.", "megamenu") . "</p>";
205
+ }
206
+ }
207
+ }
208
+
209
+ do_action("megamenu_print_messages");
210
+
211
+ }
212
+
213
+ }
214
+
215
+ endif;
classes/{page.locations.class.php → pages/locations.php} RENAMED
@@ -4,13 +4,12 @@ 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
@@ -18,11 +17,30 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -37,16 +55,36 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -76,7 +114,7 @@ class Mega_Menu_Menu_Locations {
76
 
77
  $redirect_url = add_query_arg(
78
  array(
79
- 'page' => 'maxmegamenu_menu_locations',
80
  'delete_location' => 'true'
81
  ), admin_url("admin.php")
82
  );
@@ -105,6 +143,18 @@ class Mega_Menu_Menu_Locations {
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 );
@@ -121,16 +171,16 @@ class Mega_Menu_Menu_Locations {
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")
@@ -179,37 +229,17 @@ class Mega_Menu_Menu_Locations {
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
  ?>
@@ -224,9 +254,12 @@ class Mega_Menu_Menu_Locations {
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 ) ) {
@@ -234,13 +267,10 @@ class Mega_Menu_Menu_Locations {
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";
@@ -248,41 +278,81 @@ class Mega_Menu_Menu_Locations {
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>
@@ -297,27 +367,202 @@ class Mega_Menu_Menu_Locations {
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
  *
@@ -422,9 +667,100 @@ class Mega_Menu_Menu_Locations {
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,
@@ -483,7 +819,13 @@ class Mega_Menu_Menu_Locations {
483
  );
484
  }
485
 
486
- echo "<div class='accordion-wrapper'>";
 
 
 
 
 
 
487
 
488
  echo "<h2 class='nav-tab-wrapper'>";
489
 
@@ -520,7 +862,7 @@ class Mega_Menu_Menu_Locations {
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}'>";
@@ -534,7 +876,13 @@ class Mega_Menu_Menu_Locations {
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 ) {
@@ -588,6 +936,27 @@ class Mega_Menu_Menu_Locations {
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;
@@ -627,21 +996,7 @@ class Mega_Menu_Menu_Locations {
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>
@@ -752,7 +1107,7 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -795,6 +1150,178 @@ class Mega_Menu_Menu_Locations {
795
  }
796
 
797
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
798
  /**
799
  * Print a select box containing all available sub menu trigger events
800
  *
@@ -828,8 +1355,9 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -873,7 +1401,9 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -902,7 +1432,9 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -942,7 +1474,9 @@ class Mega_Menu_Menu_Locations {
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
 
@@ -971,7 +1505,9 @@ class Mega_Menu_Menu_Locations {
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();
@@ -1047,7 +1583,7 @@ class Mega_Menu_Menu_Locations {
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
 
4
  exit; // disable direct access
5
  }
6
 
7
+ if ( ! class_exists( 'Mega_Menu_Locations' ) ) :
8
 
9
  /**
10
  * Handles the Mega Menu > Menu Settings page
11
  */
12
+ class Mega_Menu_Locations {
 
13
 
14
  /**
15
  * Constructor
17
  * @since 2.8
18
  */
19
  public function __construct() {
20
+ define( 'CONCATENATE_SCRIPTS', false );
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
+
25
+ add_action( 'admin_post_megamenu_sandbox', array( $this, 'sandbox' ) );
26
+ add_action( 'wp_print_scripts', array( $this, 'sandbox_remove_unnecessary_scripts' ) );
27
+ add_action( 'wp_print_styles', array( $this, 'sandbox_remove_unnecessary_styles' ) );
28
+
29
+
30
+ add_filter( 'megamenu_menu_tabs', array( $this, 'add_locations_tab' ), 1 );
31
+ add_action( 'megamenu_page_menu_locations', array( $this, 'menu_locations_page' ) );
32
+ }
33
+
34
+
35
+ /**
36
+ * Add the Menu Locations tab to our available tabs
37
+ *
38
+ * @param array $tabs
39
+ * @since 2.8
40
+ */
41
+ public function add_locations_tab( $tabs ) {
42
+ $tabs['menu_locations'] = __("Menu Locations", "megamenu");
43
+ return $tabs;
44
  }
45
 
46
 
55
  $locations = get_option( 'megamenu_locations' );
56
  $next_id = $this->get_next_menu_location_id();
57
  $new_menu_location_id = "max_mega_menu_" . $next_id;
58
+
59
+ $title = "Max Mega Menu Location " . $next_id;
60
+
61
+ if ( isset( $_POST['title'] ) ) {
62
+ $title = esc_attr( $_POST['title'] );
63
+ }
64
+
65
+ $locations[$new_menu_location_id] = $title;
66
 
67
  update_option( 'megamenu_locations', $locations );
68
 
69
+ $menu_id = 0;
70
+
71
+ if ( isset( $_POST['menu_id'] ) ) {
72
+ $menu_id = absint( $_POST['menu_id'] );
73
+ }
74
+
75
+ if ( $menu_id > 0 ) {
76
+ $locations = get_theme_mod( 'nav_menu_locations' );
77
+ $locations[ $new_menu_location_id ] = $menu_id;
78
+ set_theme_mod( 'nav_menu_locations', $locations );
79
+ }
80
+
81
  do_action("megamenu_after_add_menu_location");
82
 
83
  $redirect_url = add_query_arg(
84
  array(
85
+ 'page' => 'maxmegamenu',
86
+ 'location_added' => 'true',
87
+ 'location' => $new_menu_location_id
88
  ), admin_url("admin.php")
89
  );
90
 
114
 
115
  $redirect_url = add_query_arg(
116
  array(
117
+ 'page' => 'maxmegamenu',
118
  'delete_location' => 'true'
119
  ), admin_url("admin.php")
120
  );
143
  if ( isset( $submitted_settings[$location]['enabled'] ) ) {
144
  $submitted_settings[$location]['enabled'] = '1';
145
  }
146
+
147
+ if ( ! isset( $submitted_settings[$location]['unbind'] ) ) {
148
+ $submitted_settings[$location]['unbind'] = 'disabled';
149
+ }
150
+
151
+ if ( ! isset( $submitted_settings[$location]['descriptions'] ) ) {
152
+ $submitted_settings[$location]['descriptions'] = 'disabled';
153
+ }
154
+
155
+ if ( ! isset( $submitted_settings[$location]['prefix'] ) ) {
156
+ $submitted_settings[$location]['prefix'] = 'disabled';
157
+ }
158
 
159
  if ( ! get_option( 'megamenu_settings' ) ) {
160
  update_option( 'megamenu_settings', $submitted_settings );
171
 
172
  /* Save custom location description **/
173
  if ( isset( $_POST['custom_location'] ) && is_array( $_POST['custom_location'] ) ) {
174
+ $custom_location = array_map( 'sanitize_text_field', $_POST['custom_location'] );
175
  $locations = get_option('megamenu_locations');
176
+ $new_locations = array_merge( (array)$locations, $custom_location );
177
 
178
  update_option( 'megamenu_locations', $new_locations );
179
  }
180
 
181
  $redirect_url = add_query_arg(
182
  array(
183
+ 'page' => 'maxmegamenu',
184
  'location' => urlencode( $location ),
185
  'save_location' => 'true'
186
  ), admin_url("admin.php")
229
 
230
 
231
  /**
232
+ * Content for Menu Locations page
233
  *
 
234
  * @since 2.8
235
  */
236
+ public function menu_locations_page( $saved_settings ) {
 
 
 
 
 
 
 
 
237
 
238
+ if ( isset( $_GET['add_location'] ) ) {
239
+ $this->add_location_page();
240
+ return;
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
243
  $locations = $this->get_registered_locations();
244
 
245
  ?>
254
  <tr>
255
  <td class='mega-name'>
256
  <?php _e("Registered Menu Locations", "megamenu"); ?>
257
+ <div class='mega-description'>
258
+ <p><?php _e("This is an overview of the menu locations supported by your theme.", "megamenu"); ?></p>
259
+ <p><?php _e("Use these options to enable Max Mega Menu and define the behaviour of each menu location.", "megamenu"); ?></p>
260
+ </div>
261
  </td>
262
+ <td class='mega-value mega-vartical-align-top'>
263
  <?php
264
 
265
  if ( ! count( $locations ) ) {
267
  _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");
268
  echo "</p>";
269
  } else {
 
 
 
 
270
  foreach ( $locations as $location => $description ) {
271
+ $open_class = ( isset( $_GET['location'] ) && $_GET['location'] == $location ) ? " mega-accordion-open" : "";
272
  $is_enabled_class = "mega-location-disabled";
273
+ $tooltip = "";
274
 
275
  if ( max_mega_menu_is_enabled( $location ) ) {
276
  $is_enabled_class = "mega-location-enabled";
278
  $is_enabled_class = "mega-location-disabled-assign-menu";
279
  }
280
 
281
+ $has_active_location_class = "";
282
+
283
+ $active_instance = 0;
284
+
285
+ if ( isset( $saved_settings[$location]['active_instance'] ) ) {
286
+ $active_instance = $saved_settings[$location]['active_instance'];
287
+ } else if ( isset( $saved_settings['instances'][$location] ) ) {
288
+ $active_instance = $saved_settings['instances'][$location];
289
+ }
290
+
291
+ if ( $active_instance > 0 ) {
292
+ $has_active_location_class = "mega-has-active-location";
293
+ $tooltip = __("Active for Instance") . " " . esc_attr( $active_instance );
294
+ }
295
+
296
  ?>
297
 
298
+ <div class='mega-location <?php echo $is_enabled_class ?> <?php echo $has_active_location_class ?>'>
299
+ <div class='mega-accordion-title<?php echo $open_class ?>'>
300
+ <span class='dashicons dashicons-location'></span>
301
+ <h4><?php echo esc_html( $description ) ?></h4>
302
+ <?php
303
+
304
+ $tooltip_attr = "";
305
+
306
+ if ( strlen( $tooltip ) > 0 ) {
307
+ $tooltip_attr = " data-tooltip='{$tooltip}'";
308
+ }
309
+ ?>
310
+ <span class='mega-tooltip'<?php echo $tooltip_attr ?>>
311
+ <span class='dashicons dashicons-yes'></span>
312
+ </span>
313
+
314
+ <div class='mega-ellipsis'>
315
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false">
316
+ <path d="M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"></path>
317
+ </svg>
318
+ <ul class='mega-ellipsis-content'>
319
+ <li><?php echo $this->assigned_menu_link( $location ); ?></li>
320
+ <li><?php echo $this->sandbox_link( $location ); ?></li>
321
+ <?php
322
+ if ( strpos( $location, 'max_mega_menu_' ) !== FALSE ) {
323
+ echo "<li>" . $this->delete_location_link( $location ) . "</li>";
324
+ }
325
+ ?>
326
+ </ul>
327
+ </div>
328
+ </div>
329
+ <div class='mega-accordion-content'>
330
  <?php
331
  // if no menu has been assigned to the location
332
  if ( ! has_nav_menu( $location ) ) {
333
+ echo "<p class='mega-warning'><span class='dashicons dashicons-warning'></span>";
334
+ echo " <a href='" . admin_url("nav-menus.php?action=locations") . "'>" . esc_html__("Assign a menu", "megamenu") . "</a> ";
335
+ echo __("to this location to enable these options.", "megamenu");
336
  echo "</p>";
337
  } else {
 
338
  $this->show_menu_locations_options( $locations, $location );
339
  }
340
  ?>
341
  </div>
342
+ </div>
343
  <?php
344
  }
 
 
345
  }
346
 
347
  $add_location_url = esc_url( add_query_arg(
348
  array(
349
+ 'page' => 'maxmegamenu',
350
+ 'add_location' => 'true'
351
  ),
352
+ admin_url("admin.php")
353
  ) );
354
 
355
+ echo "<p><a class='button button-secondary mega-add-location' href='{$add_location_url}'>" . __("Add another menu location", "megamenu") . "</a></p>";
356
  ?>
357
 
358
  </td>
367
  }
368
 
369
 
370
+ /**
371
+ * Content for Menu Locations page
372
+ *
373
+ * @since 2.8
374
+ */
375
+ public function add_location_page() {
376
+
377
+ ?>
378
+
379
+ <div class='menu_settings menu_settings_add_location'>
380
+
381
+ <h3 class='first'><?php _e("Add Menu Location", "megamenu"); ?></h3>
382
+
383
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
384
+ <input type="hidden" name="action" value="megamenu_add_menu_location" />
385
+ <?php wp_nonce_field( 'megamenu_add_menu_location' ); ?>
386
+
387
+ <table>
388
+ <tr>
389
+ <td class='mega-name'>
390
+ <?php _e("Location Name", "megamenu"); ?>
391
+ <div class='mega-description'>
392
+ <p><?php _e("Give the location a name that describes where the menu will be displayed on your site.", "megamenu"); ?></p>
393
+ </div>
394
+ </td>
395
+ <td class='mega-value mega-vartical-align-top'>
396
+ <input class='wide' type='text' name='title' required='required' placeholder='<?php esc_attr_e("E.g. Footer, Blog Sidebar, Header", "megamenu"); ?>' />
397
+ </td>
398
+ </tr>
399
+ <tr>
400
+ <td class='mega-name'>
401
+ <?php _e("Assign a menu", "megamenu"); ?>
402
+ <div class='mega-description'>
403
+ <p><?php _e("Select a menu to be assigned to this location. This can be changed later using the Appearance > Menus > Manage Location page.", "megamenu"); ?></p>
404
+ </div>
405
+ </td>
406
+ <td class='mega-value mega-vartical-align-top'>
407
+ <?php
408
+
409
+ $menus = wp_get_nav_menus();
410
+
411
+ if ( count( $menus ) ) {
412
+ foreach ( $menus as $menu ) {
413
+ echo '<div class="mega-radio-row"><input type="radio" id="' . esc_attr( $menu->slug ) . '" name="menu_id" value="' . esc_attr( $menu->term_id ) . '" /><label for="' . esc_attr( $menu->slug ) . '">' . esc_attr( $menu->name ) . '</label></div>';
414
+ }
415
+ }
416
+
417
+ echo '<div class="mega-radio-row"><input checked="checked" type="radio" id="0" name="menu_id" value="0" /><label for="0">' . esc_html__("Skip - I'll assign a menu later", "megamenu") . '</label></div>';
418
+ ?>
419
+ </td>
420
+ </tr>
421
+ </table>
422
+ <?php submit_button(__("Add menu location", "megamenu") ); ?>
423
+ </form>
424
+ </div>
425
+
426
+ <?php
427
+ }
428
+
429
+
430
  /**
431
  * Display a link showing the menu assigned to the specified location
432
  *
433
  * @param string $location
434
  * @since 2.8
435
  */
436
+ public function assigned_menu_link( $location ) {
 
437
  $menu_id = $this->get_menu_id_for_location( $location );
438
 
439
  if ($menu_id) {
440
+ return "<a href='" . admin_url("nav-menus.php?action=edit&menu={$menu_id}") . "'><span class='dashicons dashicons-menu-alt2'></span>" . esc_html( $this->get_menu_name_for_location( $location ) ) . "</a>";
 
 
441
  } else {
442
+ return "<a href='" . admin_url("nav-menus.php?action=locations") . "'><span class='dashicons dashicons-menu-alt2'></span>" . esc_html__("Assign a menu", "megamenu") . "</a>";
 
 
443
  }
444
  }
445
 
446
+ /**
447
+ * Display a link showing the menu assigned to the specified location
448
+ *
449
+ * @param string $location
450
+ * @since 2.8
451
+ */
452
+ public function sandbox_link( $location ) {
453
+ return "<a target='megamenu_sandbox' href='" . admin_url("admin-post.php?action=megamenu_sandbox&location={$location}") . "'><span class='dashicons dashicons-external'></span>" . esc_html__("View in Sandbox", "megamenu") . "</a>";
454
+ }
455
+
456
+
457
+ /**
458
+ * Display a link showing the menu assigned to the specified location
459
+ *
460
+ * @param string $location
461
+ * @since 2.8
462
+ */
463
+ public function delete_location_link( $location ) {
464
+ $delete_location_url = esc_url( add_query_arg(
465
+ array(
466
+ 'action' => 'megamenu_delete_menu_location',
467
+ 'location' => $location
468
+ ),
469
+ wp_nonce_url( admin_url("admin-post.php"), 'megamenu_delete_menu_location' )
470
+ ) );
471
+
472
+ return "<a class='confirm' href='{$delete_location_url}'><span class='dashicons dashicons-trash'></span>" . esc_html__("Delete location", "megamenu") . "</a>";
473
+ }
474
+
475
+ /**
476
+ * Remove unnecessary scripts from the sandbox page
477
+ *
478
+ * @since 2.9
479
+ */
480
+ public function sandbox_remove_unnecessary_scripts(){
481
+ if ( isset( $_GET['action'] ) && $_GET['action'] == 'megamenu_sandbox' ) {
482
+ global $wp_scripts;
483
+
484
+ $queue_items = $wp_scripts->queue;
485
+ $wp_scripts->queue = array();
486
+
487
+ do_action("megamenu_enqueue_scripts");
488
+ }
489
+ }
490
+
491
+ /**
492
+ * Remove unnecessary styles from the sandbox page
493
+ *
494
+ * @since 2.9
495
+ */
496
+ public function sandbox_remove_unnecessary_styles(){
497
+ if ( isset( $_GET['action'] ) && $_GET['action'] == 'megamenu_sandbox' ) {
498
+ global $wp_styles;
499
+
500
+ $queue_items = $wp_styles->queue;
501
+ $wp_styles->queue = array();
502
+
503
+ do_action("megamenu_enqueue_styles");
504
+ }
505
+ }
506
+
507
+
508
+ /**
509
+ * Content for Sandbox page
510
+ *
511
+ * @since 2.9
512
+ */
513
+ public function sandbox() {
514
+ remove_action('wp_footer', 'wp_admin_bar_render', 1000);
515
+ remove_action('wp_head', '_admin_bar_bump_cb');
516
+
517
+ if ( isset( $_GET['location'] ) ) {
518
+ $location = esc_attr( $_GET['location'] );
519
+
520
+ ?>
521
+ <!DOCTYPE html>
522
+ <html>
523
+ <head>
524
+ <title>Sandbox: <?php echo $location; ?></title>
525
+ <style type='text/css'>
526
+ body, html {
527
+ margin: 0;
528
+ padding: 0;
529
+ min-height: 200vh;
530
+ }
531
+ body {
532
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
533
+ background-image:
534
+ linear-gradient(45deg, #eee 25%, transparent 25%),
535
+ linear-gradient(135deg, #eee 25%, transparent 25%),
536
+ linear-gradient(45deg, transparent 75%, #eee 75%),
537
+ linear-gradient(135deg, transparent 75%, #eee 75%);
538
+ background-size:25px 25px;
539
+ background-position:0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px;
540
+ }
541
+ #query-monitor-main {
542
+ display: none;
543
+ }
544
+ .menu_wrapper {
545
+ max-width: 1280px;
546
+ margin: 0 auto;
547
+ margin-top: 20px;
548
+ }
549
+ </style>
550
+ <?php wp_head(); ?>
551
+ </head>
552
+ <body>
553
+ <div class='menu_wrapper'>
554
+ <?php echo do_shortcode("[maxmegamenu location={$location}]"); ?>
555
+ </div>
556
+ <?php wp_footer(); ?>
557
+ </body>
558
+ </html>
559
+ <?php
560
+ }
561
+
562
+ die();
563
+
564
+ }
565
+
566
  /**
567
  * Content for Menu Location options
568
  *
667
  )
668
  )
669
  ),
670
+ 'advanced' => array(
671
+ 'priority' => 25,
672
+ 'title' => __( "Advanced", "megamenu" ),
673
+ 'settings' => array(
674
+ 'click_behaviour' => array(
675
+ 'priority' => 10,
676
+ 'title' => __( "Click Event Behaviour", "megamenu" ),
677
+ 'description' => __( "Define what should happen when the event is set to 'click'. This also applies to mobiles.", "megamenu" ),
678
+ 'settings' => array(
679
+ array(
680
+ 'type' => 'click_behaviour',
681
+ 'key' => 'click_behaviour',
682
+ 'value' => $plugin_settings
683
+ )
684
+ )
685
+ ),
686
+ 'mobile_behaviour' => array(
687
+ 'priority' => 20,
688
+ 'title' => __( "Mobile Menu Behaviour", "megamenu" ),
689
+ 'description' => __( "Define the sub menu toggle behaviour for the mobile menu.", "megamenu" ),
690
+ 'settings' => array(
691
+ array(
692
+ 'type' => 'mobile_behaviour',
693
+ 'key' => 'mobile_behaviour',
694
+ 'value' => $plugin_settings
695
+ )
696
+ )
697
+ ),
698
+ 'descriptions' => array(
699
+ 'priority' => 20,
700
+ 'title' => __( "Menu Item Descriptions", "megamenu" ),
701
+ 'description' => __( "Enable output of menu item descriptions.", "megamenu" ),
702
+ 'settings' => array(
703
+ array(
704
+ 'type' => 'descriptions',
705
+ 'key' => 'descriptions',
706
+ 'value' => $plugin_settings
707
+ )
708
+ )
709
+ ),
710
+ 'unbind' => array(
711
+ 'priority' => 20,
712
+ 'title' => __( "Unbind JavaScript Events", "megamenu" ),
713
+ 'description' => __( "To avoid conflicts with theme menu systems, JavaScript events which have been added to menu items will be removed by default.", "megamenu" ),
714
+ 'settings' => array(
715
+ array(
716
+ 'type' => 'unbind',
717
+ 'key' => 'unbind',
718
+ 'value' => $plugin_settings
719
+ )
720
+ )
721
+ ),
722
+ 'prefix' => array(
723
+ 'priority' => 20,
724
+ 'title' => __( "Prefix Menu Item Classes", "megamenu" ),
725
+ 'description' => __( "Prefix custom menu item classes with 'mega-'?", "megamenu" ),
726
+ 'settings' => array(
727
+ array(
728
+ 'type' => 'prefix',
729
+ 'key' => 'prefix',
730
+ 'value' => $plugin_settings
731
+ )
732
+ )
733
+ ),
734
+ 'container' => array(
735
+ 'priority' => 20,
736
+ 'title' => __( "Container", "megamenu" ),
737
+ 'description' => __( "Use nav or div element for menu wrapper?", "megamenu" ),
738
+ 'settings' => array(
739
+ array(
740
+ 'type' => 'container',
741
+ 'key' => 'container',
742
+ 'value' => $plugin_settings
743
+ )
744
+ )
745
+ ),
746
+ 'active_instance' => array(
747
+ 'priority' => 30,
748
+ 'title' => __( "Active Menu Instance", "megamenu" ),
749
+ 'info' => array( __("0: Apply to all instances. 1: Apply to first instance. 2: Apply to second instance", "megamenu") . "…"),
750
+ 'description' => __( "Some themes will output this menu location multiple times on the same page. For example, it may be output once for the main menu, then again for the mobile menu. This setting can be used to make sure Max Mega Menu is only applied to one of those instances.", "megamenu" ),
751
+ 'settings' => array(
752
+ array(
753
+ 'type' => 'active_instance',
754
+ 'key' => 'active_instance',
755
+ 'value' => $plugin_settings
756
+ )
757
+ )
758
+ )
759
+ )
760
+ ),
761
  'output_options' => array(
762
  'priority' => 30,
763
+ 'title' => __( "Display Options", "megamenu" ),
764
  'settings' => array(
765
  'location_php_function' => array(
766
  'priority' => 10,
819
  );
820
  }
821
 
822
+ $initial_version = get_option( "megamenu_initial_version");
823
+
824
+ if ( $initial_version && version_compare( $initial_version, '2.8', '>' ) ) {
825
+ unset( $settings['advanced']['settings']['prefix'] ); // users who started out with 2.8.1+ will not see this option
826
+ }
827
+
828
+ echo "<div class='mega-accordion-content-wrapper'>";
829
 
830
  echo "<h2 class='nav-tab-wrapper'>";
831
 
862
  echo "<div class='mega-tab-content mega-tab-content-{$section_id}' style='display: {$display}'>";
863
 
864
  if ( $section_id == 'output_options' && ! $is_custom_location ) {
865
+ echo "<p class='mega-warning '><span class='dashicons dashicons-warning'></span>" . __("This menu location is registered by your theme. Your theme should already include the code required to display this menu location on your site.", "megamenu") . "</p>";
866
  }
867
 
868
  echo " <table class='{$section_id}'>";
876
 
877
  if ( isset( $group['settings'] ) ) {
878
 
879
+ echo "<td class='mega-name'>";
880
+ if ( isset( $group['icon'] ) ) {
881
+ echo "<span class='dashicons dashicons-" . esc_html( $group['icon'] ) . "'></span>";
882
+ }
883
+ echo esc_html( $group['title'] );
884
+ echo "<div class='mega-description'>" . esc_html( $group['description'] ) . "</div>";
885
+ echo "</td>";
886
  echo "<td class='mega-value'>";
887
 
888
  foreach ( $group['settings'] as $setting_id => $setting ) {
936
  case "location_widget":
937
  $this->print_location_widget_option( $location, $setting['key'], $setting['value'] );
938
  break;
939
+ case "active_instance":
940
+ $this->print_active_instance_option( $location, $setting['value'] );
941
+ break;
942
+ case "click_behaviour":
943
+ $this->print_click_behaviour_option( $location, $setting['value'] );
944
+ break;
945
+ case "mobile_behaviour":
946
+ $this->print_mobile_behaviour_option( $location, $setting['value'] );
947
+ break;
948
+ case "container":
949
+ $this->print_container_option( $location, $setting['value'] );
950
+ break;
951
+ case "descriptions":
952
+ $this->print_descriptions_option( $location, $setting['value'] );
953
+ break;
954
+ case "unbind":
955
+ $this->print_unbind_option( $location, $setting['value'] );
956
+ break;
957
+ case "prefix":
958
+ $this->print_prefix_option( $location, $setting['value'] );
959
+ break;
960
  default:
961
  do_action("megamenu_print_location_option_{$setting['type']}", $setting['key'], $this->id );
962
  break;
996
  <?php submit_button( $text = null ); ?>
997
  </div>
998
  <div class='mega_right'>
 
 
 
 
 
 
 
 
 
 
999
 
 
 
 
 
1000
  </div>
1001
  </div>
1002
  </form>
1107
  */
1108
  public function print_messages() {
1109
 
1110
+ if ( isset( $_GET['location_added'] ) ) {
1111
  echo "<p class='success'>" . __("New Menu Location Created", "megamenu") . "</p>";
1112
  }
1113
 
1150
  }
1151
 
1152
 
1153
+ /**
1154
+ * Print a generic checkbox option
1155
+ *
1156
+ * @since 2.8
1157
+ * @param string $key
1158
+ * @param string $value
1159
+ */
1160
+ public function print_active_instance_option( $location, $plugin_settings ) {
1161
+
1162
+ $active_instance = 0;
1163
+
1164
+ if ( isset( $plugin_settings[$location]['active_instance'] ) ) {
1165
+ $active_instance = $plugin_settings[$location]['active_instance'];
1166
+ } else if ( isset( $plugin_settings['instances'][$location] ) ) {
1167
+ $active_instance = $plugin_settings['instances'][$location];
1168
+ }
1169
+
1170
+ ?>
1171
+ <input type='text' name='megamenu_meta[<?php esc_attr_e($location) ?>][active_instance]' value='<?php echo esc_attr_e($active_instance) ?>' />
1172
+ <?php
1173
+ }
1174
+
1175
+ /**
1176
+ * Print a generic checkbox option
1177
+ *
1178
+ * @since 2.8
1179
+ * @param string $key
1180
+ * @param string $value
1181
+ */
1182
+ public function print_click_behaviour_option( $location, $plugin_settings ) {
1183
+
1184
+ $second_click = 'go';
1185
+
1186
+ if ( isset( $plugin_settings[$location]['second_click'] ) ) {
1187
+ $second_click = $plugin_settings[$location]['second_click'];
1188
+ } else if ( isset( $plugin_settings['second_click'] ) ) {
1189
+ $second_click = $plugin_settings['second_click'];
1190
+ }
1191
+
1192
+ ?>
1193
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][second_click]'>
1194
+ <option value='close' <?php echo selected( $second_click == 'close'); ?>><?php _e("First click will open a sub menu, second click will close the sub menu.", "megamenu"); ?></option>
1195
+ <option value='go' <?php echo selected( $second_click == 'go'); ?>><?php _e("First click will open a sub menu, second click will follow the link.", "megamenu"); ?></option>
1196
+ <select>
1197
+ <?php
1198
+ }
1199
+
1200
+
1201
+ /**
1202
+ * Print a generic checkbox option
1203
+ *
1204
+ * @since 2.8
1205
+ * @param string $key
1206
+ * @param string $value
1207
+ */
1208
+ public function print_mobile_behaviour_option( $location, $plugin_settings ) {
1209
+
1210
+ $mobile_behaviour = 'standard';
1211
+
1212
+ if ( isset( $plugin_settings[$location]['mobile_behaviour'] ) ) {
1213
+ $mobile_behaviour = $plugin_settings[$location]['mobile_behaviour'];
1214
+ } else if ( isset( $plugin_settings['mobile_behaviour'] ) ) {
1215
+ $mobile_behaviour = $plugin_settings['mobile_behaviour'];
1216
+ }
1217
+
1218
+ ?>
1219
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][mobile_behaviour]'>
1220
+ <option value='standard' <?php echo selected( $mobile_behaviour == 'standard'); ?>><?php _e("Standard - Open sub menus will remain open until closed by the user.", "megamenu"); ?></option>
1221
+ <option value='accordion' <?php echo selected( $mobile_behaviour == 'accordion'); ?>><?php _e("Accordion - Open sub menus will automatically close when another one is opened.", "megamenu"); ?></option>
1222
+ <select>
1223
+ <?php
1224
+ }
1225
+
1226
+ /**
1227
+ * Print a generic checkbox option
1228
+ *
1229
+ * @since 2.8
1230
+ * @param string $key
1231
+ * @param string $value
1232
+ */
1233
+ public function print_container_option( $location, $plugin_settings ) {
1234
+
1235
+ $container = 'div';
1236
+
1237
+ if ( isset( $plugin_settings[$location]['container'] ) ) {
1238
+ $container = $plugin_settings[$location]['container'];
1239
+ }
1240
+
1241
+ ?>
1242
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][container]'>
1243
+ <option value='div' <?php echo selected( $container == 'div'); ?>><?php _e("div", "megamenu"); ?></option>
1244
+ <option value='nav' <?php echo selected( $container == 'nav'); ?>><?php _e("nav", "megamenu"); ?></option>
1245
+ <select>
1246
+ <?php
1247
+ }
1248
+
1249
+
1250
+ /**
1251
+ * Print the checkbox option for enabling menu item descriptions
1252
+ *
1253
+ * @since 2.8
1254
+ * @param string $key
1255
+ * @param string $value
1256
+ */
1257
+ public function print_descriptions_option( $location, $plugin_settings ) {
1258
+
1259
+ $descriptions = "disabled";
1260
+
1261
+ if ( isset( $plugin_settings[$location]['descriptions'] ) ) {
1262
+ $descriptions = $plugin_settings[$location]['descriptions'];
1263
+ } else if ( isset( $plugin_settings['descriptions'] ) ) {
1264
+ $descriptions = $plugin_settings['descriptions'];
1265
+ }
1266
+
1267
+ ?>
1268
+
1269
+ <input type='checkbox' value='true' name='megamenu_meta[<?php esc_attr_e($location) ?>][descriptions]' <?php checked( $descriptions, "enabled" ); ?> />
1270
+
1271
+ <?php
1272
+ }
1273
+
1274
+
1275
+ /**
1276
+ * Print the checkbox option for enabling menu item descriptions
1277
+ *
1278
+ * @since 2.8
1279
+ * @param string $key
1280
+ * @param string $value
1281
+ */
1282
+ public function print_prefix_option( $location, $plugin_settings ) {
1283
+
1284
+ $prefix = "disabled";
1285
+
1286
+ if ( isset( $plugin_settings[$location]['prefix'] ) ) {
1287
+ $prefix = $plugin_settings[$location]['prefix'];
1288
+ } else if ( isset( $plugin_settings['prefix'] ) ) {
1289
+ $prefix = $plugin_settings['prefix'];
1290
+ }
1291
+
1292
+ ?>
1293
+
1294
+ <input type='checkbox' value='true' name='megamenu_meta[<?php esc_attr_e($location) ?>][prefix]' <?php checked( $prefix, "enabled" ); ?> />
1295
+
1296
+ <?php
1297
+ }
1298
+
1299
+
1300
+ /**
1301
+ * Print the checkbox option for enabling menu item descriptions
1302
+ *
1303
+ * @since 2.8
1304
+ * @param string $key
1305
+ * @param string $value
1306
+ */
1307
+ public function print_unbind_option( $location, $plugin_settings ) {
1308
+
1309
+ $unbind = "enabled";
1310
+
1311
+ if ( isset( $plugin_settings[$location]['unbind'] ) ) {
1312
+ $unbind = $plugin_settings[$location]['unbind'];
1313
+ } else if ( isset( $plugin_settings['unbind'] ) ) {
1314
+ $unbind = $plugin_settings['unbind'];
1315
+ }
1316
+
1317
+ ?>
1318
+
1319
+ <input type='checkbox' value='true' name='megamenu_meta[<?php esc_attr_e($location) ?>][unbind]' <?php checked( $unbind, "enabled" ); ?> />
1320
+
1321
+ <?php
1322
+ }
1323
+
1324
+
1325
  /**
1326
  * Print a select box containing all available sub menu trigger events
1327
  *
1355
  * @param string $value
1356
  */
1357
  public function print_location_effect_option( $location, $key, $value ) {
1358
+ ?>
1359
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]'>
1360
+ <?php
1361
 
1362
  $selected = strlen( $value ) ? $value : 'fade_up';
1363
 
1401
  * @param string $value
1402
  */
1403
  public function print_location_effect_speed_option( $location, $key, $value ) {
1404
+ ?>
1405
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]'>
1406
+ <?php
1407
 
1408
  $selected = strlen( $value ) ? $value : '200';
1409
 
1432
  * @param string $value
1433
  */
1434
  public function print_location_effect_mobile_option( $location, $key, $value ) {
1435
+ ?>
1436
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]'>
1437
+ <?php
1438
 
1439
  $selected = strlen( $value ) ? $value : 'disabled';
1440
 
1474
  * @param string $value
1475
  */
1476
  public function print_location_effect_speed_mobile_option( $location, $key, $value ) {
1477
+ ?>
1478
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]'>
1479
+ <?php
1480
 
1481
  $selected = strlen( $value ) ? $value : '200';
1482
 
1505
  * @param string $value
1506
  */
1507
  public function print_location_theme_selector_option( $location, $key, $value ) {
1508
+ ?>
1509
+ <select name='megamenu_meta[<?php esc_attr_e($location) ?>][<?php esc_attr_e($key) ?>]'>
1510
+ <?php
1511
 
1512
  $style_manager = new Mega_Menu_Style_Manager();
1513
  $themes = $style_manager->get_themes();
1583
  * @param string $value
1584
  */
1585
  public function print_location_description_option( $location, $key, $value ) {
1586
+ echo "<input class='" . esc_attr( "mega-setting-" . $key ) . " wide' type='text' name='custom_location[$location]' value='" . esc_attr( $value ) . "' />";
1587
  }
1588
 
1589
 
classes/pages/page.php ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // disable direct access
5
+ }
6
+
7
+ if ( ! class_exists( 'Mega_Menu_Page' ) ) :
8
+
9
+ /**
10
+ * Handles all admin related functionality.
11
+ */
12
+ class Mega_Menu_Page {
13
+
14
+ /**
15
+ * Constructor
16
+ *
17
+ * @since 1.0
18
+ */
19
+ public function __construct() {
20
+ add_action( 'admin_menu', array( $this, 'megamenu_settings_page') );
21
+ add_action( 'megamenu_admin_scripts', array( $this, 'enqueue_scripts' ) );
22
+ }
23
+
24
+
25
+ /**
26
+ * Adds the "Menu Themes" menu item and page.
27
+ *
28
+ * @since 1.0
29
+ */
30
+ public function megamenu_settings_page() {
31
+
32
+ $svg = 'PHN2ZyB2ZXJzaW9uPSIxLjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEyNy4wMDAwMDBwdCIgaGVpZ2h0PSIxMjcuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCAxMjcuMDAwMDAwIDEyNy4wMDAwMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgogICAgICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDEyNy4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiIGZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0zMzAgMTEyNyBsLTI0NSAtMTQzIC03IC0xODAgYy01IC05OCAtNyAtMjUzIC01IC0zNDQgbDIgLTE2NSAxMzAKICAgICAgICAgICAgICAgICAgICAgICAgLTc2IGMyOTUgLTE3MyAzNDUgLTIwNCAzNDUgLTIxMSAwIC00IDI0IC04IDU0IC04IDQ4IDAgNjUgNyAxNjcgNjYgMjIzIDEyOQogICAgICAgICAgICAgICAgICAgICAgICAzNzYgMjI0IDM5MCAyNDAgMTggMjEgMjYgNTkzIDEwIDYzNyAtMTIgMzAgLTczIDcyIC0yNzYgMTkwIC03MSA0MiAtMTUyIDkwCiAgICAgICAgICAgICAgICAgICAgICAgIC0xNzkgMTA2IC0zNiAyMyAtNjAgMzEgLTk1IDMxIC00MSAwIC03MiAtMTYgLTI5MSAtMTQzeiBtNDEwIC03NyBjMTMxIC03NgogICAgICAgICAgICAgICAgICAgICAgICAxNDEgLTg1IDExNSAtMTA1IC00MyAtMzEgLTIyMSAtMTI1IC0yMzkgLTEyNSAtMjEgMCAtMjE3IDExMiAtMjM1IDEzNCAtOCAxMAogICAgICAgICAgICAgICAgICAgICAgICAtNiAxNyA3IDI4IDM3IDMyIDIwNyAxMjggMjI2IDEyOCAxMiAwIDY4IC0yNyAxMjYgLTYweiBtLTM2MSAtMjc5IGM4OCAtNTAKICAgICAgICAgICAgICAgICAgICAgICAgMTgxIC05OSAyMDcgLTExMCBsNDcgLTIxIDEyMSA2OSBjMTY4IDk2IDI1NSAxNDEgMjcyIDE0MSAxMiAwIDE0IC0zOCAxNCAtMjI4CiAgICAgICAgICAgICAgICAgICAgICAgIGwwIC0yMjggLTc3IC00NyAtNzggLTQ3IC03IDE0NiBjLTMgODAgLTggMTQ3IC0xMCAxNDkgLTIgMiAtNTMgLTI1IC0xMTMgLTYwCiAgICAgICAgICAgICAgICAgICAgICAgIC02MSAtMzUgLTExOSAtNjQgLTEyOSAtNjUgLTExIDAgLTcwIDI3IC0xMzIgNjAgLTYyIDMzIC0xMTUgNjAgLTExNyA2MCAtMyAwCiAgICAgICAgICAgICAgICAgICAgICAgIC04IC02MyAtMTIgLTE0MCAtNCAtNzcgLTExIC0xNDAgLTE2IC0xNDAgLTQgMCAtMzkgMTkgLTc4IDQyIGwtNzAgNDIgLTMgMTI2CiAgICAgICAgICAgICAgICAgICAgICAgIGMtNCAxODIgMSAzNDAgMTIgMzQwIDUgMCA4MSAtNDAgMTY5IC04OXogbTE5NSAtNDU4IGw1NSAtMjcgNDEgMjggYzIzIDE1IDQ4CiAgICAgICAgICAgICAgICAgICAgICAgIDI1IDU2IDIyIDE1IC02IDIwIC03OSA4IC0xMTEgLTcgLTE4IC05NCAtNjUgLTEyMSAtNjUgLTIyIDAgLTgzIDM1IC0xMDAgNTgKICAgICAgICAgICAgICAgICAgICAgICAgLTE4IDIyIC0xNSAxMjIgMyAxMjIgMiAwIDI4IC0xMiA1OCAtMjd6Ii8+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9zdmc+';
33
+
34
+ $icon = "data:image/svg+xml;base64," . $svg;
35
+
36
+ $capability = apply_filters("megamenu_options_capability", "edit_theme_options");
37
+
38
+ $page = add_menu_page( __('Max Mega Menu', 'megamenu'), __('Mega Menu', 'megamenu'), $capability, 'maxmegamenu', array($this, 'page'), $icon );
39
+
40
+ $tabs = apply_filters("megamenu_menu_tabs", array());
41
+
42
+ foreach ( $tabs as $key => $title ) {
43
+ if ( $key == 'menu_locations') {
44
+ add_submenu_page( 'maxmegamenu', __('Max Mega Menu', 'megamenu') . ' - ' . $title, $title, $capability, 'maxmegamenu', array($this, 'page') );
45
+ } else {
46
+ add_submenu_page( 'maxmegamenu', __('Max Mega Menu', 'megamenu') . ' - ' . $title, $title, $capability, 'maxmegamenu_' . $key, array($this, 'page') );
47
+ }
48
+ }
49
+
50
+ }
51
+
52
+
53
+
54
+ /**
55
+ * Main settings page wrapper.
56
+ *
57
+ * @since 1.4
58
+ */
59
+ public function page() {
60
+
61
+ $tab = isset( $_GET['page'] ) ? substr( $_GET['page'], 12 ) : false;
62
+
63
+ // backwards compatibility
64
+ if ( isset ( $_GET['tab'] ) ) {
65
+ $tab = $_GET['tab'];
66
+ }
67
+
68
+ if ( ! $tab ) {
69
+ $tab = 'menu_locations';
70
+ }
71
+
72
+ $header_links = apply_filters( "megamenu_header_links", array(
73
+ 'homepage' => array(
74
+ 'url' => 'https://www.megamenu.com/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
75
+ 'target' => '_mmmpro',
76
+ 'text' => __("Homepage", "megamenu"),
77
+ 'class' => ''
78
+ ),
79
+ 'documentation' => array(
80
+ 'url' => 'https://www.megamenu.com/documentation/installation/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
81
+ 'text' => __("Documentation", "megamenu"),
82
+ 'target' => '_mmmpro',
83
+ 'class' => ''
84
+ ),
85
+ 'troubleshooting' => array(
86
+ 'url' => 'https://www.megamenu.com/articles/troubleshooting/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
87
+ 'text' => __("Troubleshooting", "megamenu"),
88
+ 'target' => '_mmmpro',
89
+ 'class' => ''
90
+ )
91
+ ) );
92
+
93
+ if ( ! is_plugin_active('megamenu-pro/megamenu-pro.php') ) {
94
+ $header_links['pro'] = array(
95
+ 'url' => 'https://www.megamenu.com/upgrade/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
96
+ 'target' => '_mmmpro',
97
+ 'text' => __("Upgrade to Pro", "megamenu"),
98
+ 'class' => 'mega-highlight'
99
+ );
100
+ }
101
+
102
+ $versions = apply_filters( "megamenu_versions", array(
103
+ 'core' => array(
104
+ 'version' => MEGAMENU_VERSION,
105
+ 'text' => __("Core version", "megamenu")
106
+ ),
107
+ 'pro' => array(
108
+ 'version' => "<a href='https://www.megamenu.com/upgrade/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro' target='_mmmpro'>not installed</a>",
109
+ 'text' => __("Pro extension", "megamenu")
110
+ )
111
+ ) );
112
+
113
+ ?>
114
+
115
+ <div class='megamenu_outer_wrap'>
116
+ <div class='megamenu_header_top'>
117
+ <ul>
118
+ <?php
119
+ foreach ( $header_links as $id => $data ) {
120
+ echo "<li class='{$data['class']}'><a href='{$data['url']}' target='{$data['target']}'>{$data['text']}";
121
+ echo "</a>";
122
+ echo "</li>";
123
+ }
124
+ ?>
125
+ </ul>
126
+ </div>
127
+ <div class='megamenu_header'>
128
+ <div class='megamenu_header_left'>
129
+ <h2><?php _e("Max Mega Menu", "megamenu"); ?></h2>
130
+ <div class='version'>
131
+ <?php
132
+
133
+ $total = count( $versions );
134
+ $count = 0;
135
+ $separator = ' - ';
136
+
137
+ foreach ( $versions as $id => $data ) {
138
+ echo $data['text'] . ": <b>" . $data['version'] . "</b>";
139
+
140
+ $count = $count + 1;
141
+
142
+ if ( $total > 0 && $count != $total ) {
143
+ echo $separator;
144
+ }
145
+ }
146
+ ?>
147
+ </div>
148
+ </div>
149
+ </div>
150
+
151
+ <div class='megamenu_wrap'>
152
+ <div class='megamenu_left'>
153
+ <ul class='mega-page-navigation'>
154
+ <?php
155
+ $tabs = apply_filters("megamenu_menu_tabs", array());
156
+
157
+ foreach ( $tabs as $key => $title ) {
158
+ $class = $tab == $key ? 'active' : '';
159
+
160
+ if ( $key == 'menu_locations' ) {
161
+ $args = array( 'page' => 'maxmegamenu' );
162
+ } else {
163
+ $args = array( 'page' => 'maxmegamenu_' . $key );
164
+ }
165
+
166
+ $url = esc_url( add_query_arg( $args, admin_url("admin.php") ) );
167
+
168
+ echo "<li class='{$key}'><a class='{$class}' href='{$url}'>{$title}</a></li>";
169
+ }
170
+ ?>
171
+ </ul>
172
+ </div>
173
+ <div class='megamenu_right'>
174
+ <?php $this->print_messages(); ?>
175
+
176
+ <?php
177
+
178
+ $saved_settings = get_option("megamenu_settings");
179
+
180
+ if ( has_action( "megamenu_page_{$tab}" ) ) {
181
+ do_action( "megamenu_page_{$tab}", $saved_settings );
182
+ } else {
183
+ do_action( "megamenu_page_menu_locations", $saved_settings );
184
+ }
185
+
186
+ ?>
187
+ </div>
188
+ </div>
189
+
190
+
191
+
192
+ </div>
193
+
194
+ <?php
195
+ }
196
+
197
+
198
+ /**
199
+ * Redirect and exit
200
+ *
201
+ * @since 1.8
202
+ */
203
+ public function redirect( $url ) {
204
+ wp_redirect( $url );
205
+ exit;
206
+ }
207
+
208
+
209
+ /**
210
+ * Display messages to the user
211
+ *
212
+ * @since 1.0
213
+ */
214
+ public function print_messages() {
215
+
216
+
217
+ if ( is_plugin_active('clearfy/clearfy.php') ) {
218
+ if ( $clearfy_options = get_option('wbcr_clearfy_cache_options') ) {
219
+ if ( $clearfy_options['disable_dashicons'] == true ) {
220
+ echo "<p class='fail'>" . __("Please enable Dashicons in the Clearfy plugin options. Max Mega Menu requires Dashicons.", "megamenu") . "</p>";
221
+ }
222
+ }
223
+ }
224
+
225
+ do_action("megamenu_print_messages");
226
+
227
+ }
228
+
229
+
230
+ /**
231
+ * Enqueue nav-menus.php scripts
232
+ *
233
+ * @since 1.8.3
234
+ */
235
+ public function enqueue_scripts() {
236
+
237
+ wp_deregister_style('select2');
238
+ wp_deregister_script('select2');
239
+
240
+ wp_enqueue_style( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.css', false, MEGAMENU_VERSION );
241
+ wp_enqueue_style( 'mega-menu-settings', MEGAMENU_BASE_URL . 'css/admin/admin.css', false, MEGAMENU_VERSION );
242
+ wp_enqueue_style( 'select2', MEGAMENU_BASE_URL . 'js/select2/select2.css', false, MEGAMENU_VERSION );
243
+
244
+ wp_enqueue_script( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.js', array( 'jquery' ), MEGAMENU_VERSION );
245
+
246
+ wp_localize_script( 'spectrum', 'megamenu_spectrum_settings',
247
+ apply_filters("megamenu_spectrum_localisation", array())
248
+ );
249
+
250
+ wp_enqueue_script( 'mega-menu-select2', MEGAMENU_BASE_URL . 'js/select2/select2.min.js', array(), MEGAMENU_VERSION );
251
+
252
+ wp_enqueue_script( 'mega-menu-theme-editor', MEGAMENU_BASE_URL . 'js/settings.js', array( 'jquery', 'spectrum', 'code-editor' ), MEGAMENU_VERSION );
253
+
254
+ wp_localize_script( 'mega-menu-theme-editor', 'megamenu_settings',
255
+ array(
256
+ 'saving' => __("Saving", "megamenu"),
257
+ 'confirm' => __("Are you sure?", "megamenu"),
258
+ "theme_save_error" => __("Error saving theme.", "megamenu"),
259
+ "theme_save_error_refresh" => __("Please try refreshing the page.", "megamenu"),
260
+ "theme_save_error_exhausted" => __("The server ran out of memory whilst trying to regenerate the menu CSS.", "megamenu"),
261
+ "theme_save_error_memory_limit" => __("Try disabling unusued plugins to increase the available memory. Alternatively, for details on how to increase your server memory limit see:", "megamenu"),
262
+ "theme_save_error_500" => __("The server returned a 500 error. The server did not provide an error message (you should find details of the error in your server error log), but this is usually due to your server memory limit being reached.", "megamenu"),
263
+ "increase_memory_limit_url" => "http://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/",
264
+ "increase_memory_limit_anchor_text" => "How to increase the WordPress memory limit"
265
+ )
266
+ );
267
+
268
+ if ( function_exists('wp_enqueue_code_editor') ) {
269
+ wp_deregister_style('codemirror');
270
+ wp_deregister_script('codemirror');
271
+
272
+ $cm_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/x-scss'));
273
+ wp_localize_script('mega-menu-theme-editor', 'cm_settings', $cm_settings);
274
+ wp_enqueue_style('wp-codemirror');
275
+ }
276
+ }
277
+
278
+ }
279
+
280
+ endif;
classes/{settings.class.php → pages/themes.php} RENAMED
@@ -4,12 +4,12 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // disable direct access
5
  }
6
 
7
- if ( ! class_exists( 'Mega_Menu_Settings' ) ) :
8
 
9
  /**
10
  * Handles all admin related functionality.
11
  */
12
- class Mega_Menu_Settings {
13
 
14
 
15
  /**
@@ -42,20 +42,40 @@ class Mega_Menu_Settings {
42
  add_action( 'admin_post_megamenu_add_theme', array( $this, 'create_theme') );
43
  add_action( 'admin_post_megamenu_delete_theme', array( $this, 'delete_theme') );
44
  add_action( 'admin_post_megamenu_revert_theme', array( $this, 'revert_theme') );
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') );
51
-
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' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
 
 
59
  }
60
 
61
  /**
@@ -87,6 +107,31 @@ class Mega_Menu_Settings {
87
 
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  /**
92
  *
@@ -189,178 +234,6 @@ class Mega_Menu_Settings {
189
  }
190
 
191
 
192
- /**
193
- * Clear the CSS cache.
194
- *
195
- * @since 1.5
196
- */
197
- public function tools_clear_css_cache() {
198
-
199
- check_admin_referer( 'megamenu_clear_css_cache' );
200
-
201
- do_action( 'megamenu_delete_cache' );
202
-
203
- $this->redirect( admin_url( 'admin.php?page=maxmegamenu_tools&clear_css_cache=true' ) );
204
-
205
- }
206
-
207
-
208
- /**
209
- * Deletes all Max Mega Menu data from the database
210
- *
211
- * @since 1.5
212
- */
213
- public function delete_data() {
214
-
215
- check_admin_referer( 'megamenu_delete_data' );
216
-
217
- do_action("megamenu_delete_cache");
218
-
219
- // delete options
220
- delete_option("megamenu_settings");
221
- delete_option("megamenu_locations");
222
- delete_option("megamenu_toggle_blocks");
223
- delete_option("megamenu_version");
224
- delete_option("megamenu_initial_version");
225
- delete_option("megamenu_themes_last_updated");
226
- delete_option("megamenu_multisite_share_themes");
227
-
228
-
229
- // delete all widgets assigned to menus
230
- $widget_manager = new Mega_Menu_Widget_Manager();
231
-
232
- if ( $mega_menu_widgets = $widget_manager->get_mega_menu_sidebar_widgets() ) {
233
-
234
- foreach ( $mega_menu_widgets as $widget_id ) {
235
-
236
- $widget_manager->delete_widget( $widget_id );
237
-
238
- }
239
-
240
- }
241
-
242
- // delete all mega menu metadata stored against menu items
243
- delete_metadata( 'post', 0, '_megamenu', '', true );
244
-
245
- // clear cache
246
- delete_transient( "megamenu_css" );
247
-
248
- // delete custom themes
249
- max_mega_menu_delete_themes();
250
-
251
- $this->redirect( admin_url( "admin.php?page=maxmegamenu_tools&delete_data=true" ) );
252
-
253
- }
254
-
255
-
256
- /**
257
- * Sanitize multidimensional array
258
- *
259
- * @since 2.7.5
260
- */
261
- public function sanitize_array( &$array ) {
262
- foreach ( $array as &$value) {
263
- if ( ! is_array( $value ) ) {
264
- $value = sanitize_textarea_field( $value );
265
- } else {
266
- $this->sanitize_array( $value );
267
- }
268
- }
269
- return $array;
270
- }
271
-
272
- /**
273
- * Save menu general settings.
274
- *
275
- * @since 1.0
276
- */
277
- public function save_settings() {
278
- check_admin_referer( 'megamenu_save_settings' );
279
-
280
- if ( isset( $_POST['settings'] ) && is_array( $_POST['settings'] ) ) {
281
- $settings = $this->sanitize_array( $_POST['settings'] );
282
-
283
- if ( ! isset( $settings['descriptions'] ) ) {
284
- $settings['descriptions'] = 'disabled';
285
- }
286
-
287
- if ( ! isset( $settings['unbind'] ) ) {
288
- $settings['unbind'] = 'disabled';
289
- }
290
-
291
- if ( ! isset( $settings['prefix'] ) ) {
292
- $settings['prefix'] = 'disabled';
293
- }
294
-
295
- $submitted_settings = apply_filters( "megamenu_submitted_settings", $settings );
296
- $existing_settings = get_option( 'megamenu_settings' );
297
- $new_settings = array_merge( (array)$existing_settings, $submitted_settings );
298
-
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");
305
- do_action("megamenu_delete_cache");
306
-
307
- $url = isset( $_POST['_wp_http_referer'] ) ? $_POST['_wp_http_referer'] : admin_url( "admin.php?page=maxmegamenu&saved=true" );
308
-
309
- $this->redirect( $url );
310
- }
311
-
312
-
313
- /**
314
- * Duplicate an existing theme.
315
- *
316
- * @since 1.8
317
- */
318
- public function import_theme() {
319
-
320
- check_admin_referer( 'megamenu_import_theme' );
321
-
322
- $this->init();
323
-
324
- $import = json_decode( stripslashes( $_POST['data'] ), true );
325
-
326
- $sanitized = array();
327
-
328
- foreach ( $import as $key => $value ) {
329
- if ( $key == 'custom_css' ) {
330
- $sanitized[$key] = sanitize_textarea_field( $value );
331
- } else {
332
- $sanitized[$key] = sanitize_text_field( $value );
333
- }
334
- }
335
-
336
- $import = $sanitized;
337
-
338
- if ( is_array( $import ) ) {
339
-
340
- $saved_themes = max_mega_menu_get_themes();
341
-
342
- $next_id = $this->get_next_theme_id();
343
-
344
- $import['title'] = $import['title'] . " " . __(' - Imported', 'megamenu');
345
-
346
- $new_theme_id = "custom_theme_" . $next_id;
347
-
348
- $saved_themes[ $new_theme_id ] = $import;
349
-
350
- max_mega_menu_save_themes( $saved_themes );
351
-
352
- do_action("megamenu_after_theme_import");
353
-
354
- $this->redirect( admin_url( "admin.php?page=maxmegamenu_theme_editor&theme=" . $new_theme_id . "&created=true" ) );
355
-
356
- } else {
357
-
358
- $this->redirect( admin_url( "admin.php?page=maxmegamenu_tools&theme_imported=false") );
359
-
360
- }
361
-
362
-
363
- }
364
 
365
  /**
366
  * Duplicate an existing theme.
@@ -465,610 +338,136 @@ class Mega_Menu_Settings {
465
  */
466
  public function create_theme() {
467
 
468
- check_admin_referer( 'megamenu_create_theme' );
469
-
470
- $this->init();
471
-
472
- $saved_themes = max_mega_menu_get_themes();
473
-
474
- $next_id = $this->get_next_theme_id();
475
-
476
- $new_theme_id = "custom_theme_" . $next_id;
477
-
478
- $style_manager = new Mega_Menu_Style_Manager();
479
- $new_theme = $style_manager->get_default_theme();
480
-
481
- $new_theme['title'] = "Custom {$next_id}";
482
-
483
- $saved_themes[$new_theme_id] = $new_theme;
484
-
485
- max_mega_menu_save_themes( $saved_themes );
486
-
487
- do_action("megamenu_after_theme_create");
488
-
489
- $this->redirect( admin_url( "admin.php?page=maxmegamenu_theme_editor&theme={$new_theme_id}&created=true") );
490
-
491
- }
492
-
493
-
494
- /**
495
- * Redirect and exit
496
- *
497
- * @since 1.8
498
- */
499
- public function redirect( $url ) {
500
-
501
- wp_redirect( $url );
502
- exit;
503
-
504
- }
505
-
506
-
507
- /**
508
- * Returns the next available custom theme ID
509
- *
510
- * @since 1.0
511
- */
512
- public function get_next_theme_id() {
513
-
514
- $last_id = 0;
515
-
516
- if ( $saved_themes = max_mega_menu_get_themes() ) {
517
-
518
- foreach ( $saved_themes as $key => $value ) {
519
-
520
- if ( strpos( $key, 'custom_theme' ) !== FALSE ) {
521
-
522
- $parts = explode( "_", $key );
523
- $theme_id = end( $parts );
524
-
525
- if ($theme_id > $last_id) {
526
- $last_id = $theme_id;
527
- }
528
-
529
- }
530
-
531
- }
532
-
533
- }
534
-
535
- $next_id = $last_id + 1;
536
-
537
- return $next_id;
538
- }
539
-
540
-
541
- /**
542
- * Checks to see if a certain theme is in use.
543
- *
544
- * @since 1.0
545
- * @param string $theme
546
- */
547
- public function theme_is_being_used_by_location( $theme ) {
548
- $settings = get_option( "megamenu_settings" );
549
-
550
- if ( ! $settings ) {
551
- return false;
552
- }
553
-
554
- $locations = get_nav_menu_locations();
555
-
556
- $menus = get_registered_nav_menus();
557
-
558
- $theme_in_use_locations = array();
559
-
560
- if ( count( $locations ) ) {
561
-
562
- foreach ( $locations as $location => $menu_id ) {
563
-
564
- if ( has_nav_menu( $location ) && max_mega_menu_is_enabled( $location ) && isset( $settings[ $location ]['theme'] ) && $settings[ $location ]['theme'] == $theme ) {
565
- $theme_in_use_locations[] = isset( $menus[ $location ] ) ? $menus[ $location ] : $location;
566
- }
567
-
568
- }
569
-
570
- if ( count( $theme_in_use_locations ) ) {
571
- return $theme_in_use_locations;
572
- }
573
-
574
- }
575
-
576
- return false;
577
- }
578
-
579
-
580
- /**
581
- * Adds the "Menu Themes" menu item and page.
582
- *
583
- * @since 1.0
584
- */
585
- public function megamenu_themes_page() {
586
-
587
- $svg = 'PHN2ZyB2ZXJzaW9uPSIxLjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEyNy4wMDAwMDBwdCIgaGVpZ2h0PSIxMjcuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCAxMjcuMDAwMDAwIDEyNy4wMDAwMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgogICAgICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDEyNy4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiIGZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0zMzAgMTEyNyBsLTI0NSAtMTQzIC03IC0xODAgYy01IC05OCAtNyAtMjUzIC01IC0zNDQgbDIgLTE2NSAxMzAKICAgICAgICAgICAgICAgICAgICAgICAgLTc2IGMyOTUgLTE3MyAzNDUgLTIwNCAzNDUgLTIxMSAwIC00IDI0IC04IDU0IC04IDQ4IDAgNjUgNyAxNjcgNjYgMjIzIDEyOQogICAgICAgICAgICAgICAgICAgICAgICAzNzYgMjI0IDM5MCAyNDAgMTggMjEgMjYgNTkzIDEwIDYzNyAtMTIgMzAgLTczIDcyIC0yNzYgMTkwIC03MSA0MiAtMTUyIDkwCiAgICAgICAgICAgICAgICAgICAgICAgIC0xNzkgMTA2IC0zNiAyMyAtNjAgMzEgLTk1IDMxIC00MSAwIC03MiAtMTYgLTI5MSAtMTQzeiBtNDEwIC03NyBjMTMxIC03NgogICAgICAgICAgICAgICAgICAgICAgICAxNDEgLTg1IDExNSAtMTA1IC00MyAtMzEgLTIyMSAtMTI1IC0yMzkgLTEyNSAtMjEgMCAtMjE3IDExMiAtMjM1IDEzNCAtOCAxMAogICAgICAgICAgICAgICAgICAgICAgICAtNiAxNyA3IDI4IDM3IDMyIDIwNyAxMjggMjI2IDEyOCAxMiAwIDY4IC0yNyAxMjYgLTYweiBtLTM2MSAtMjc5IGM4OCAtNTAKICAgICAgICAgICAgICAgICAgICAgICAgMTgxIC05OSAyMDcgLTExMCBsNDcgLTIxIDEyMSA2OSBjMTY4IDk2IDI1NSAxNDEgMjcyIDE0MSAxMiAwIDE0IC0zOCAxNCAtMjI4CiAgICAgICAgICAgICAgICAgICAgICAgIGwwIC0yMjggLTc3IC00NyAtNzggLTQ3IC03IDE0NiBjLTMgODAgLTggMTQ3IC0xMCAxNDkgLTIgMiAtNTMgLTI1IC0xMTMgLTYwCiAgICAgICAgICAgICAgICAgICAgICAgIC02MSAtMzUgLTExOSAtNjQgLTEyOSAtNjUgLTExIDAgLTcwIDI3IC0xMzIgNjAgLTYyIDMzIC0xMTUgNjAgLTExNyA2MCAtMyAwCiAgICAgICAgICAgICAgICAgICAgICAgIC04IC02MyAtMTIgLTE0MCAtNCAtNzcgLTExIC0xNDAgLTE2IC0xNDAgLTQgMCAtMzkgMTkgLTc4IDQyIGwtNzAgNDIgLTMgMTI2CiAgICAgICAgICAgICAgICAgICAgICAgIGMtNCAxODIgMSAzNDAgMTIgMzQwIDUgMCA4MSAtNDAgMTY5IC04OXogbTE5NSAtNDU4IGw1NSAtMjcgNDEgMjggYzIzIDE1IDQ4CiAgICAgICAgICAgICAgICAgICAgICAgIDI1IDU2IDIyIDE1IC02IDIwIC03OSA4IC0xMTEgLTcgLTE4IC05NCAtNjUgLTEyMSAtNjUgLTIyIDAgLTgzIDM1IC0xMDAgNTgKICAgICAgICAgICAgICAgICAgICAgICAgLTE4IDIyIC0xNSAxMjIgMyAxMjIgMiAwIDI4IC0xMiA1OCAtMjd6Ii8+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9zdmc+';
588
-
589
- $icon = "data:image/svg+xml;base64," . $svg;
590
-
591
- $capability = apply_filters("megamenu_options_capability", "edit_theme_options");
592
-
593
- $page = add_menu_page( __('Max Mega Menu', 'megamenu'), __('Mega Menu', 'megamenu'), $capability, 'maxmegamenu', array($this, 'page'), $icon );
594
-
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
-
601
- foreach ( $tabs as $key => $title ) {
602
- if ( $key == 'general_settings') {
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
-
613
- }
614
-
615
-
616
- /**
617
- * Content for 'Settings' tab
618
- *
619
- * @since 1.4
620
- */
621
- public function general_settings_page( $saved_settings ) {
622
-
623
- $css = isset( $saved_settings['css'] ) ? $saved_settings['css'] : 'fs';
624
- $mobile_second_click = isset( $saved_settings['second_click'] ) ? $saved_settings['second_click'] : 'close';
625
- $mobile_behaviour = isset( $saved_settings['mobile_behaviour'] ) ? $saved_settings['mobile_behaviour'] : 'standard';
626
- $descriptions = isset( $saved_settings['descriptions'] ) ? $saved_settings['descriptions'] : 'disabled';
627
- $unbind = isset( $saved_settings['unbind'] ) ? $saved_settings['unbind'] : 'enabled';
628
- $prefix = isset( $saved_settings['prefix'] ) ? $saved_settings['prefix'] : 'enabled';
629
-
630
- $locations = get_registered_nav_menus();
631
-
632
- ?>
633
-
634
- <div class='menu_settings menu_settings_general_settings'>
635
-
636
- <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
637
- <input type="hidden" name="action" value="megamenu_save_settings" />
638
- <?php wp_nonce_field( 'megamenu_save_settings' ); ?>
639
-
640
- <h3 class='first'><?php _e("General Settings", "megamenu"); ?></h3>
641
-
642
- <table>
643
- <tr>
644
- <td class='mega-name'>
645
- <?php _e("Click Event Behaviour", "megamenu"); ?>
646
- <div class='mega-description'>
647
- <?php _e("Define what should happen when the event is set to 'click'. This also applies to mobiles.", "megamenu"); ?>
648
- </div>
649
- </td>
650
- <td class='mega-value'>
651
- <select name='settings[second_click]'>
652
- <option value='close' <?php echo selected( $mobile_second_click == 'close'); ?>><?php _e("First click will open a sub menu, second click will close the sub menu.", "megamenu"); ?></option>
653
- <option value='go' <?php echo selected( $mobile_second_click == 'go'); ?>><?php _e("First click will open a sub menu, second click will follow the link.", "megamenu"); ?></option>
654
- <select>
655
- <div class='mega-description'>
656
- </div>
657
- </td>
658
- </tr>
659
- <tr>
660
- <td class='mega-name'>
661
- <?php _e("Mobile Menu Behaviour", "megamenu"); ?>
662
- <div class='mega-description'>
663
- <?php _e("Define the sub menu toggle behaviour for the mobile menu.", "megamenu"); ?>
664
- </div>
665
- </td>
666
- <td class='mega-value'>
667
- <select name='settings[mobile_behaviour]'>
668
- <option value='standard' <?php echo selected( $mobile_behaviour == 'standard'); ?>><?php _e("Standard - Open sub menus will remain open until closed by the user.", "megamenu"); ?></option>
669
- <option value='accordion' <?php echo selected( $mobile_behaviour == 'accordion'); ?>><?php _e("Accordion - Open sub menus will automatically close when another one is opened.", "megamenu"); ?></option>
670
- <select>
671
- <div class='mega-description'>
672
- </div>
673
- </td>
674
- </tr>
675
- <tr>
676
- <td class='mega-name'>
677
- <?php _e("CSS Output", "megamenu"); ?>
678
- <div class='mega-description'>
679
- </div>
680
- </td>
681
- <td class='mega-value'>
682
- <select name='settings[css]' id='mega_css'>
683
- <option value='fs' <?php echo selected( $css == 'fs'); ?>><?php _e("Save to filesystem", "megamenu"); ?>
684
- <?php
685
- if ( get_transient('megamenu_failed_to_write_css_to_filesystem') ) {
686
- echo " " . __("(Action required: Check upload folder permissions)", "megamenu");
687
- }
688
- ?>
689
- </option>
690
- <option value='head' <?php echo selected( $css == 'head'); ?>><?php _e("Output in &lt;head&gt;", "megamenu"); ?></option>
691
- <option value='disabled' <?php echo selected( $css == 'disabled'); ?>><?php _e("Don't output CSS", "megamenu"); ?></option>
692
- <select>
693
- <div class='mega-description'>
694
- <div class='fs' style='display: <?php echo $css == 'fs' ? 'block' : 'none' ?>'><?php _e("CSS will be saved to wp-content/uploads/maxmegamenu/style.css and enqueued from there.", "megamenu"); ?></div>
695
- <div class='head' style='display: <?php echo $css == 'head' ? 'block' : 'none' ?>'><?php _e("CSS will be loaded from the cache in a &lt;style&gt; tag in the &lt;head&gt; of the page.", "megamenu"); ?></div>
696
- <div class='disabled' style='display: <?php echo $css == 'disabled' ? 'block' : 'none' ?>'>
697
- <?php _e("CSS will not be output, you must enqueue the CSS for the menu manually.", "megamenu"); ?>
698
- <div class='fail'><?php _e("Selecting this option will effectively disable the theme editor and many of the features available in Max Mega Menu and Max Mega Menu Pro. Only enable this option if you fully understand the consequences.", "megamenu"); ?>
699
- </div>
700
- </div>
701
- </td>
702
- </tr>
703
- <tr>
704
- <td class='mega-name'>
705
- <?php _e("Menu Item Descriptions", "megamenu"); ?>
706
- <div class='mega-description'>
707
- <?php _e("Enable output of menu item descriptions", "megamenu"); ?>
708
- </div>
709
- </td>
710
- <td class='mega-value'>
711
- <input type="checkbox" name="settings[descriptions]" value="enabled" <?php checked( $descriptions, 'enabled' ); ?> />
712
- <div class='mega-description'>
713
- </div>
714
- </td>
715
- </tr>
716
- <tr>
717
- <td class='mega-name'>
718
- <?php _e("Unbind JavaScript Events", "megamenu"); ?>
719
- <div class='mega-description'>
720
- <?php _e("To avoid conflicts with theme menu systems, JavaScript events which have been added to menu items will be removed by default.", "megamenu"); ?>
721
- </div>
722
- </td>
723
- <td class='mega-value'>
724
- <input type="checkbox" name="settings[unbind]" value="enabled" <?php checked( $unbind, 'enabled' ); ?> />
725
- <div class='mega-description'>
726
- </div>
727
- </td>
728
- </tr>
729
- <tr>
730
- <td class='mega-name'>
731
- <?php _e("Prefix Menu Item Classes", "megamenu"); ?>
732
- <div class='mega-description'>
733
- <?php _e("Prefix custom menu item classes with 'mega-'?", "megamenu"); ?>
734
- </div>
735
- </td>
736
- <td class='mega-value'>
737
- <input type="checkbox" name="settings[prefix]" value="enabled" <?php checked( $prefix, 'enabled' ); ?> />
738
- <div class='mega-description'>
739
- </div>
740
- </td>
741
- </tr>
742
- <tr>
743
- <td class='mega-name'>
744
- <?php _e("Active Menu Instances", "megamenu"); ?>
745
- <div class='mega-description'>
746
- <?php _e("Some themes will output a menu location multiple times on the same page. For example, your theme may output a menu location once for the main menu, then again for the mobile menu. This setting can be used to make sure Max Mega Menu is only applied to one of those instances.", "megamenu"); ?>
747
- </div>
748
- </td>
749
- <td class='mega-value mega-instances'>
750
- <?php if (count($locations)): ?>
751
- <table>
752
- <tr>
753
- <th><?php _e("Menu Location", "megamenu"); ?></th><th><?php _e("Active Instance", "megamenu"); ?></th>
754
- </tr>
755
- <?php foreach( $locations as $location => $description ): ?>
756
- <?php if (max_mega_menu_is_enabled($location)): ?>
757
- <?php $active_instance = isset($saved_settings['instances'][$location]) ? $saved_settings['instances'][$location] : 0; ?>
758
- <tr>
759
- <td><?php echo $description; ?></td><td><input type='text' name='settings[instances][<?php echo $location ?>]' value='<?php echo esc_attr( $active_instance ); ?>' /></td>
760
- </tr>
761
- <?php endif; ?>
762
- <?php endforeach; ?>
763
- </table>
764
- <div class='mega-description'><?php _e("0: Apply to all instances. 1: Apply to first instance. 2: Apply to second instance", "megamenu"); ?>…</div>
765
- <?php endif; ?>
766
- </td>
767
- </tr>
768
- </table>
769
-
770
- <?php do_action( "megamenu_general_settings", $saved_settings ); ?>
771
-
772
- <?php submit_button(); ?>
773
- </form>
774
- </div>
775
-
776
- <?php
777
- }
778
-
779
- /**
780
- * Content for 'Tools' tab
781
- *
782
- * @since 1.4
783
- */
784
- public function tools_page( $saved_settings ) {
785
-
786
- ?>
787
-
788
- <div class='menu_settings menu_settings_tools'>
789
-
790
- <h3 class='first'><?php _e("Tools", "megamenu"); ?></h3>
791
-
792
- <table>
793
- <tr>
794
- <td class='mega-name'>
795
- <?php _e("Cache", "megamenu"); ?>
796
- <div class='mega-description'><?php _e("The CSS for your menu is updated each time a menu or a menu theme is changed. You can force the menu CSS to be updated using this tool.", "megamenu"); ?></div>
797
- </td>
798
- <td class='mega-value'>
799
- <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
800
- <?php wp_nonce_field( 'megamenu_clear_css_cache' ); ?>
801
- <input type="hidden" name="action" value="megamenu_clear_css_cache" />
802
-
803
- <input type='submit' class='button button-primary' value='<?php _e("Clear CSS Cache", "megamenu"); ?>' />
804
-
805
- <?php if ( get_transient( 'megamenu_css_last_updated' ) ): ?>
806
- <p><em><small><?php echo sprintf(__("The menu CSS was last updated on %s", "megamenu"), date('l jS F Y H:i:s', get_transient('megamenu_css_last_updated') ) ); ?><small><em></p>
807
- <?php endif; ?>
808
- </form>
809
- </td>
810
- </tr>
811
- <tr>
812
- <td class='mega-name'>
813
- <?php _e("Export Theme", "megamenu"); ?>
814
- <div class='mega-description'><?php _e("Export a menu theme", "megamenu"); ?></div>
815
- </td>
816
- <td class='mega-value'>
817
- <form method="post" action="<?php echo admin_url( "admin.php?page=maxmegamenu_tools") ?>">
818
-
819
- <?php
820
-
821
- if ( isset( $_POST['theme_export'] ) ) {
822
-
823
- $style_manager = new Mega_Menu_Style_Manager();
824
-
825
- $default_theme = $style_manager->get_default_theme();
826
-
827
- $theme_to_export = $_POST['theme_export'];
828
-
829
- if ( isset( $this->themes[ $theme_to_export ] ) ) {
830
-
831
- $theme_to_export = $this->themes[ $theme_to_export ];
832
-
833
- $diff = array();
834
-
835
- foreach ( $default_theme as $key => $value ) {
836
- if ( isset( $theme_to_export[$key] ) && $theme_to_export[$key] != $value || $key == 'title') {
837
- $diff[$key] = $theme_to_export[$key];
838
- }
839
- }
840
-
841
- if ( isset( $_POST['format'] ) && $_POST['format'] == 'json' ) {
842
-
843
- echo "<p>" . __("Log into the site you wish to import the theme to. Go to Mega Menu > Tools and paste this into the 'Import Theme' text area:", "megamenu") . "</p>";
844
-
845
- echo "<textarea>" . sanitize_textarea_field( htmlentities( json_encode( $diff ) ) ) . "</textarea>";
846
-
847
- } else {
848
- $key = strtolower( str_replace(" ", "_", $theme_to_export['title'] ) );
849
-
850
- $key .= "_" . time();
851
-
852
- echo "<p>" . __("Paste this code into your themes functions.php file:", "megamenu") . "</p>";
853
-
854
- echo '<textarea>';
855
- echo 'function megamenu_add_theme_' . $key . '($themes) {';
856
- echo "\n" . ' $themes["' . $key .'"] = array(';
857
 
858
- foreach ($diff as $theme_key => $value) {
859
- echo "\n '" . $theme_key . "' => '" . $value . "',";
860
- }
861
 
862
- echo "\n" . ' );';
863
- echo "\n" . ' return $themes;';
864
- echo "\n" . '}';
865
- echo "\n" . 'add_filter("megamenu_themes", "megamenu_add_theme_' . $key . '");';
866
- echo '</textarea>';
867
 
868
- }
869
 
870
- }
871
- } else {
872
 
873
- echo "<select name='theme_export'>";
874
- foreach ( $this->themes as $id => $theme ) {
875
- echo "<option value='{$id}'>" . esc_html( $theme['title'] ) . "</option>";
876
- }
877
- echo "</select>";
878
 
879
- echo "<h4>" . __("Export Format", "megamenu") . "</h4>";
880
- echo "<label><input value='json' type='radio' checked='checked' name='format'>" . __("JSON - I want to import this theme into another site I'm developing", "megamenu") . "</label>";
881
- echo "<label><input value='php' type='radio' name='format'>" . __("PHP - I want to distribute this Menu Theme in a WordPress Theme I'm developing", "megamenu") . "<label>";
882
 
883
- echo "<input type='submit' name='export' class='button button-primary' value='" . __("Export Theme", "megamenu") . "' />";
884
 
885
- }
886
 
887
- ?>
888
- </form>
889
- </td>
890
- </tr>
891
- <tr>
892
- <td class='mega-name'>
893
- <?php _e("Import Theme", "megamenu"); ?>
894
- <div class='mega-description'><?php _e("Import a menu theme in JSON format", "megamenu"); ?></div>
895
- </td>
896
- <td class='mega-value'>
897
- <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
898
- <?php wp_nonce_field( 'megamenu_import_theme' ); ?>
899
- <input type="hidden" name="action" value="megamenu_import_theme" />
900
- <textarea name='data'></textarea>
901
- <input type='submit' class='button button-primary' value='<?php _e("Import Theme", "megamenu"); ?>' />
902
- </form>
903
- </td>
904
- </tr>
905
- <tr>
906
- <td class='mega-name'>
907
- <?php _e("Plugin Data", "megamenu"); ?>
908
- <div class='mega-description'><?php _e("Delete all saved Max Mega Menu plugin data from the database. Use with caution!", "megamenu"); ?></div>
909
- </td>
910
- <td class='mega-value'>
911
- <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
912
- <?php wp_nonce_field( 'megamenu_delete_data' ); ?>
913
- <input type="hidden" name="action" value="megamenu_delete_data" />
914
 
915
- <input type='submit' class='button button-secondary confirm' value='<?php _e("Delete Data", "megamenu"); ?>' />
916
- </form>
917
- </td>
918
- </tr>
919
- </table>
920
- </div>
921
 
922
- <?php
923
  }
924
 
925
-
926
  /**
927
- * Main settings page wrapper.
928
- *
929
- * @since 1.4
930
- */
931
- public function page() {
 
932
 
933
- $tab = isset( $_GET['page'] ) ? substr( $_GET['page'], 12 ) : false;
934
 
935
- // backwards compatibility
936
- if ( isset ( $_GET['tab'] ) ) {
937
- $tab = $_GET['tab'];
938
- }
939
 
940
- if ( ! $tab ) {
941
- $tab = 'general_settings';
 
 
 
 
942
  }
943
 
944
- $header_links = apply_filters( "megamenu_header_links", array(
945
- 'homepage' => array(
946
- 'url' => 'https://www.megamenu.com/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
947
- 'target' => '_mmmpro',
948
- 'text' => __("Homepage", "megamenu"),
949
- 'class' => ''
950
- ),
951
- 'documentation' => array(
952
- 'url' => 'https://www.megamenu.com/documentation/installation/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
953
- 'text' => __("Documentation", "megamenu"),
954
- 'target' => '_mmmpro',
955
- 'class' => ''
956
- ),
957
- 'troubleshooting' => array(
958
- 'url' => 'https://www.megamenu.com/articles/troubleshooting/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
959
- 'text' => __("Troubleshooting", "megamenu"),
960
- 'target' => '_mmmpro',
961
- 'class' => ''
962
- )
963
- ) );
964
 
965
- if ( ! is_plugin_active('megamenu-pro/megamenu-pro.php') ) {
966
- $header_links['pro'] = array(
967
- 'url' => 'https://www.megamenu.com/upgrade/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro',
968
- 'target' => '_mmmpro',
969
- 'text' => __("Upgrade to Pro", "megamenu"),
970
- 'class' => 'mega-highlight'
 
 
 
 
 
 
 
 
 
 
971
  );
972
- }
973
 
974
- $versions = apply_filters( "megamenu_versions", array(
975
- 'core' => array(
976
- 'version' => MEGAMENU_VERSION,
977
- 'text' => __("Core version", "megamenu")
978
- ),
979
- 'pro' => array(
980
- 'version' => "<a href='https://www.megamenu.com/upgrade/?utm_source=free&amp;utm_medium=settings&amp;utm_campaign=pro' target='_mmmpro'>not installed</a>",
981
- 'text' => __("Pro extension", "megamenu")
982
- )
983
- ) );
984
 
985
- ?>
986
 
987
- <div class='megamenu_outer_wrap'>
988
- <div class='megamenu_header_top'>
989
- <ul>
990
- <?php
991
- foreach ( $header_links as $id => $data ) {
992
- echo "<li class='{$data['class']}'><a href='{$data['url']}' target='{$data['target']}'>{$data['text']}";
993
- echo "</a>";
994
- echo "</li>";
995
- }
996
- ?>
997
- </ul>
998
- </div>
999
- <div class='megamenu_header'>
1000
- <div class='megamenu_header_left'>
1001
- <h2><?php _e("Max Mega Menu", "megamenu"); ?></h2>
1002
- <div class='version'>
1003
- <?php
1004
 
1005
- $total = count( $versions );
1006
- $count = 0;
1007
- $separator = ' - ';
1008
 
1009
- foreach ( $versions as $id => $data ) {
1010
- echo $data['text'] . ": <b>" . $data['version'] . "</b>";
 
 
 
 
1011
 
1012
- $count = $count + 1;
 
1013
 
1014
- if ( $total > 0 && $count != $total ) {
1015
- echo $separator;
1016
- }
1017
- }
1018
- ?>
1019
- </div>
1020
- </div>
1021
- </div>
1022
- <div class='megamenu_wrap'>
1023
- <div class='megamenu_right'>
1024
- <?php $this->print_messages(); ?>
1025
 
1026
- <?php
1027
 
1028
- $saved_settings = get_option("megamenu_settings");
1029
 
1030
- if ( has_action( "megamenu_page_{$tab}" ) ) {
1031
- do_action( "megamenu_page_{$tab}", $saved_settings );
1032
- } else {
1033
- do_action( "megamenu_page_general_settings", $saved_settings );
1034
- }
 
 
 
1035
 
1036
- ?>
1037
- </div>
1038
- </div>
1039
 
1040
- <div class='megamenu_left'>
1041
- <ul>
1042
- <?php
1043
 
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
 
1050
- foreach ( $tabs as $key => $title ) {
1051
- $class = $tab == $key ? 'active' : '';
1052
 
 
1053
 
1054
- if ( $key == 'general_settings' ) {
1055
- $args = array( 'page' => 'maxmegamenu' );
1056
- } else {
1057
- $args = array( 'page' => 'maxmegamenu_' . $key );
1058
- }
1059
 
1060
- $url = esc_url( add_query_arg( $args, admin_url("admin.php") ) );
 
 
1061
 
1062
- echo "<li><a class='{$class}' href='{$url}'>{$title}</a></li>";
1063
- }
1064
 
1065
- ?>
1066
- </ul>
1067
- </div>
1068
 
1069
- </div>
1070
 
1071
- <?php
1072
  }
1073
 
1074
 
@@ -1093,24 +492,6 @@ class Mega_Menu_Settings {
1093
  echo "<p class='fail'>" . __("Failed to delete theme. The theme is in use by a menu.", "megamenu") . "</p>";
1094
  }
1095
 
1096
- if ( isset( $_GET['clear_css_cache'] ) && $_GET['clear_css_cache'] == 'true' ) {
1097
- echo "<p class='success'>";
1098
- echo __("The cache has been cleared and the menu CSS has been regenerated.", "megamenu");
1099
-
1100
- $active_plugins = max_mega_menu_get_active_caching_plugins();
1101
-
1102
- if ( count( $active_plugins ) ) {
1103
- echo "<br /><br />";
1104
- echo __("You may also need to clear the cache for any Caching, Minification or CDN plugin you have installed.", "megamenu");
1105
- }
1106
-
1107
- echo "</p>";
1108
- }
1109
-
1110
- if ( isset( $_GET['delete_data'] ) && $_GET['delete_data'] == 'true' ) {
1111
- echo "<p class='success'>" . __("All plugin data removed", "megamenu") . "</p>";
1112
- }
1113
-
1114
  if ( isset( $_GET['deleted'] ) && $_GET['deleted'] == 'true' ) {
1115
  echo "<p class='success'>" . __("Theme Deleted", "megamenu") . "</p>";
1116
  }
@@ -1119,10 +500,6 @@ class Mega_Menu_Settings {
1119
  echo "<p class='success'>" . __("Theme Duplicated", "megamenu") . "</p>";
1120
  }
1121
 
1122
- if ( isset( $_GET['saved'] ) ) {
1123
- echo "<p class='success'>" . __("Changes Saved", "megamenu") . "</p>";
1124
- }
1125
-
1126
  if ( isset( $_GET['reverted'] ) ) {
1127
  echo "<p class='success'>" . __("Theme Reverted", "megamenu") . "</p>";
1128
  }
@@ -1131,22 +508,6 @@ class Mega_Menu_Settings {
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
- }
1137
-
1138
- if ( isset( $_POST['theme_export'] ) ) {
1139
- echo "<p class='success'>" . __("Theme Exported", "megamenu") . "</p>";
1140
- }
1141
-
1142
- if ( is_plugin_active('clearfy/clearfy.php') ) {
1143
- if ( $clearfy_options = get_option('wbcr_clearfy_cache_options') ) {
1144
- if ( $clearfy_options['disable_dashicons'] == true ) {
1145
- echo "<p class='fail'>" . __("Please enable Dashicons in the Clearfy plugin options. Max Mega Menu requires Dashicons.", "megamenu") . "</p>";
1146
- }
1147
- }
1148
- }
1149
-
1150
  do_action("megamenu_print_messages");
1151
 
1152
  }
@@ -1205,6 +566,98 @@ class Mega_Menu_Settings {
1205
  }
1206
 
1207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1208
  /**
1209
  * Displays the theme editor form.
1210
  *
@@ -1212,8 +665,20 @@ class Mega_Menu_Settings {
1212
  */
1213
  public function theme_editor_page( $saved_settings ) {
1214
 
 
 
1215
  $this->init();
1216
 
 
 
 
 
 
 
 
 
 
 
1217
  $create_url = esc_url( add_query_arg(
1218
  array(
1219
  'action'=>'megamenu_add_theme'
@@ -1245,18 +710,54 @@ class Mega_Menu_Settings {
1245
  wp_nonce_url( admin_url("admin-post.php"), 'megamenu_revert_theme' )
1246
  ) );
1247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1248
  ?>
1249
 
 
 
1250
  <div class='menu_settings menu_settings_menu_themes'>
1251
 
1252
  <div class='theme_selector'>
1253
- <?php _e("Select theme to edit", "megamenu"); ?> <?php echo $this->theme_selector(); ?> <?php _e("or", "megamenu"); ?>
1254
- <a href='<?php echo $create_url ?>'><?php _e("create a new theme", "megamenu"); ?></a> <?php _e("or", "megamenu"); ?>
1255
- <a href='<?php echo $duplicate_url ?>'><?php _e("duplicate this theme", "megamenu"); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1256
  </div>
1257
 
1258
  <h3 class='editing_theme'><?php echo __("Editing theme", "megamenu") . ": " . esc_html( $this->active_theme['title'] ); ?></h3>
1259
 
 
 
1260
  <?php
1261
 
1262
  $saved_settings = get_option("megamenu_settings");
@@ -3325,14 +2826,9 @@ class Mega_Menu_Settings {
3325
 
3326
  <div class='megamenu_submit'>
3327
  <div class='mega_left'>
3328
- <?php submit_button(); ?><span class='spinner'></span>
3329
  </div>
3330
  <div class='mega_right'>
3331
- <?php if ( $this->string_contains( $this->id, array("custom") ) ) : ?>
3332
- <a class='delete confirm' href='<?php echo $delete_url; ?>'><?php _e("Delete Theme", "megamenu"); ?></a>
3333
- <?php else : ?>
3334
- <a class='confirm' href='<?php echo $revert_url; ?>'><?php _e("Revert Theme", "megamenu"); ?></a>
3335
- <?php endif; ?>
3336
  </div>
3337
  </div>
3338
 
@@ -3781,56 +3277,6 @@ class Mega_Menu_Settings {
3781
 
3782
  }
3783
 
3784
-
3785
-
3786
- /**
3787
- * Enqueue nav-menus.php scripts
3788
- *
3789
- * @since 1.8.3
3790
- */
3791
- public function enqueue_scripts() {
3792
-
3793
- wp_deregister_style('select2');
3794
- wp_deregister_script('select2');
3795
-
3796
- wp_enqueue_style( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.css', false, MEGAMENU_VERSION );
3797
- wp_enqueue_style( 'mega-menu-settings', MEGAMENU_BASE_URL . 'css/admin/admin.css', false, MEGAMENU_VERSION );
3798
- wp_enqueue_style( 'select2', MEGAMENU_BASE_URL . 'js/select2/select2.css', false, MEGAMENU_VERSION );
3799
-
3800
- wp_enqueue_script( 'accordion' );
3801
- wp_enqueue_script( 'spectrum', MEGAMENU_BASE_URL . 'js/spectrum/spectrum.js', array( 'jquery' ), MEGAMENU_VERSION );
3802
-
3803
- wp_localize_script( 'spectrum', 'megamenu_spectrum_settings',
3804
- apply_filters("megamenu_spectrum_localisation", array())
3805
- );
3806
-
3807
- wp_enqueue_script( 'mega-menu-select2', MEGAMENU_BASE_URL . 'js/select2/select2.min.js', array(), MEGAMENU_VERSION );
3808
-
3809
- wp_enqueue_script( 'mega-menu-theme-editor', MEGAMENU_BASE_URL . 'js/settings.js', array( 'jquery', 'spectrum', 'code-editor' ), MEGAMENU_VERSION );
3810
-
3811
- wp_localize_script( 'mega-menu-theme-editor', 'megamenu_settings',
3812
- array(
3813
- 'confirm' => __("Are you sure?", "megamenu"),
3814
- "theme_save_error" => __("Error saving theme.", "megamenu"),
3815
- "theme_save_error_refresh" => __("Please try refreshing the page.", "megamenu"),
3816
- "theme_save_error_exhausted" => __("The server ran out of memory whilst trying to regenerate the menu CSS.", "megamenu"),
3817
- "theme_save_error_memory_limit" => __("Try disabling unusued plugins to increase the available memory. Alternatively, for details on how to increase your server memory limit see:", "megamenu"),
3818
- "theme_save_error_500" => __("The server returned a 500 error. The server did not provide an error message (you should find details of the error in your server error log), but this is usually due to your server memory limit being reached.", "megamenu"),
3819
- "increase_memory_limit_url" => "http://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/",
3820
- "increase_memory_limit_anchor_text" => "How to increase the WordPress memory limit"
3821
- )
3822
- );
3823
-
3824
- if ( function_exists('wp_enqueue_code_editor') ) {
3825
- wp_deregister_style('codemirror');
3826
- wp_deregister_script('codemirror');
3827
-
3828
- $cm_settings['codeEditor'] = wp_enqueue_code_editor(array('type' => 'text/x-scss'));
3829
- wp_localize_script('mega-menu-theme-editor', 'cm_settings', $cm_settings);
3830
- wp_enqueue_style('wp-codemirror');
3831
- }
3832
- }
3833
-
3834
  }
3835
 
3836
  endif;
4
  exit; // disable direct access
5
  }
6
 
7
+ if ( ! class_exists( 'Mega_Menu_Themes' ) ) :
8
 
9
  /**
10
  * Handles all admin related functionality.
11
  */
12
+ class Mega_Menu_Themes {
13
 
14
 
15
  /**
42
  add_action( 'admin_post_megamenu_add_theme', array( $this, 'create_theme') );
43
  add_action( 'admin_post_megamenu_delete_theme', array( $this, 'delete_theme') );
44
  add_action( 'admin_post_megamenu_revert_theme', array( $this, 'revert_theme') );
 
45
  add_action( 'admin_post_megamenu_duplicate_theme', array( $this, 'duplicate_theme') );
46
+ add_action( 'admin_post_megamenu_import_theme', array( $this, 'import_theme') );
47
 
48
+ add_filter( 'megamenu_menu_tabs', array( $this, 'add_themes_tab' ), 2 );
 
 
 
49
  add_action( 'megamenu_page_theme_editor', array( $this, 'theme_editor_page'));
 
 
50
 
51
+ add_filter( 'wp_code_editor_settings', array( $this, 'codemirror_disable_lint'), 99 );
52
+ }
53
+
54
+
55
+ /**
56
+ * Divi turns on code linting. This turns it off.
57
+ *
58
+ * @since 2.8
59
+ */
60
+ function codemirror_disable_lint( $settings ) {
61
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'maxmegamenu_theme_editor' ) {
62
+ $settings['codemirror']['lint'] = false;
63
+ $settings['codemirror']['gutters'] = array();
64
+ return $settings;
65
+ }
66
+ }
67
+
68
+
69
+ /**
70
+ * Add the Menu Locations tab to our available tabs
71
+ *
72
+ * @param array $tabs
73
+ * @since 2.8
74
+ */
75
+ public function add_themes_tab($tabs) {
76
 
77
+ $tabs['theme_editor'] = __("Menu Themes", "megamenu");
78
+ return $tabs;
79
  }
80
 
81
  /**
107
 
108
  }
109
 
110
+ /**
111
+ * Returns the next available custom theme ID
112
+ *
113
+ * @since 1.0
114
+ */
115
+ public function get_next_theme_id() {
116
+ $last_id = 0;
117
+
118
+ if ( $saved_themes = max_mega_menu_get_themes() ) {
119
+ foreach ( $saved_themes as $key => $value ) {
120
+ if ( strpos( $key, 'custom_theme' ) !== FALSE ) {
121
+ $parts = explode( "_", $key );
122
+ $theme_id = end( $parts );
123
+
124
+ if ($theme_id > $last_id) {
125
+ $last_id = $theme_id;
126
+ }
127
+ }
128
+ }
129
+ }
130
+
131
+ $next_id = $last_id + 1;
132
+
133
+ return $next_id;
134
+ }
135
 
136
  /**
137
  *
234
  }
235
 
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
  /**
239
  * Duplicate an existing theme.
338
  */
339
  public function create_theme() {
340
 
341
+ check_admin_referer( 'megamenu_create_theme' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
 
343
+ $this->init();
 
 
344
 
345
+ $saved_themes = max_mega_menu_get_themes();
 
 
 
 
346
 
347
+ $next_id = $this->get_next_theme_id();
348
 
349
+ $new_theme_id = "custom_theme_" . $next_id;
 
350
 
351
+ $style_manager = new Mega_Menu_Style_Manager();
352
+ $new_theme = $style_manager->get_default_theme();
 
 
 
353
 
354
+ $new_theme['title'] = "Custom {$next_id}";
 
 
355
 
356
+ $saved_themes[$new_theme_id] = $new_theme;
357
 
358
+ max_mega_menu_save_themes( $saved_themes );
359
 
360
+ do_action("megamenu_after_theme_create");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
 
362
+ $this->redirect( admin_url( "admin.php?page=maxmegamenu_theme_editor&theme={$new_theme_id}&created=true") );
 
 
 
 
 
363
 
 
364
  }
365
 
 
366
  /**
367
+ * Duplicate an existing theme.
368
+ *
369
+ * @since 1.8
370
+ */
371
+ public function import_theme() {
372
+ check_admin_referer( 'megamenu_import_theme' );
373
 
374
+ $import = json_decode( stripslashes( $_POST['data'] ), true );
375
 
376
+ $sanitized = array();
 
 
 
377
 
378
+ foreach ( $import as $key => $value ) {
379
+ if ( $key == 'custom_css' ) {
380
+ $sanitized[$key] = sanitize_textarea_field( $value );
381
+ } else {
382
+ $sanitized[$key] = sanitize_text_field( $value );
383
+ }
384
  }
385
 
386
+ $import = $sanitized;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
 
388
+ if ( is_array( $import ) ) {
389
+ $saved_themes = max_mega_menu_get_themes();
390
+ $next_id = $this->get_next_theme_id();
391
+ $import['title'] = $import['title'] . " " . __(' - Imported', 'megamenu');
392
+ $new_theme_id = "custom_theme_" . $next_id;
393
+ $saved_themes[ $new_theme_id ] = $import;
394
+ max_mega_menu_save_themes( $saved_themes );
395
+ do_action("megamenu_after_theme_import");
396
+
397
+ $url = add_query_arg(
398
+ array(
399
+ 'page' => 'maxmegamenu_theme_editor',
400
+ 'theme' => $new_theme_id,
401
+ 'imported' => 'true'
402
+ ),
403
+ admin_url("admin.php")
404
  );
 
405
 
406
+ } else {
407
+ $url = add_query_arg(
408
+ array(
409
+ 'page' => 'maxmegamenu_theme_editor',
410
+ 'imported' => 'false'
411
+ ),
412
+ admin_url("admin.php")
413
+ );
414
+ }
 
415
 
416
+ $this->redirect( $url );
417
 
418
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
 
 
 
 
420
 
421
+ /**
422
+ * Redirect and exit
423
+ *
424
+ * @since 1.8
425
+ */
426
+ public function redirect( $url ) {
427
 
428
+ wp_redirect( $url );
429
+ exit;
430
 
431
+ }
 
 
 
 
 
 
 
 
 
 
432
 
 
433
 
 
434
 
435
+ /**
436
+ * Checks to see if a certain theme is in use.
437
+ *
438
+ * @since 1.0
439
+ * @param string $theme
440
+ */
441
+ public function theme_is_being_used_by_location( $theme ) {
442
+ $settings = get_option( "megamenu_settings" );
443
 
444
+ if ( ! $settings ) {
445
+ return false;
446
+ }
447
 
448
+ $locations = get_nav_menu_locations();
 
 
449
 
450
+ $menus = get_registered_nav_menus();
 
 
 
 
451
 
452
+ $theme_in_use_locations = array();
 
453
 
454
+ if ( count( $locations ) ) {
455
 
456
+ foreach ( $locations as $location => $menu_id ) {
 
 
 
 
457
 
458
+ if ( has_nav_menu( $location ) && max_mega_menu_is_enabled( $location ) && isset( $settings[ $location ]['theme'] ) && $settings[ $location ]['theme'] == $theme ) {
459
+ $theme_in_use_locations[] = isset( $menus[ $location ] ) ? $menus[ $location ] : $location;
460
+ }
461
 
462
+ }
 
463
 
464
+ if ( count( $theme_in_use_locations ) ) {
465
+ return $theme_in_use_locations;
466
+ }
467
 
468
+ }
469
 
470
+ return false;
471
  }
472
 
473
 
492
  echo "<p class='fail'>" . __("Failed to delete theme. The theme is in use by a menu.", "megamenu") . "</p>";
493
  }
494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  if ( isset( $_GET['deleted'] ) && $_GET['deleted'] == 'true' ) {
496
  echo "<p class='success'>" . __("Theme Deleted", "megamenu") . "</p>";
497
  }
500
  echo "<p class='success'>" . __("Theme Duplicated", "megamenu") . "</p>";
501
  }
502
 
 
 
 
 
503
  if ( isset( $_GET['reverted'] ) ) {
504
  echo "<p class='success'>" . __("Theme Reverted", "megamenu") . "</p>";
505
  }
508
  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>";
509
  }
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  do_action("megamenu_print_messages");
512
 
513
  }
566
  }
567
 
568
 
569
+
570
+ /**
571
+ *
572
+ * @since 2.9
573
+ */
574
+ public function export_theme() {
575
+ $style_manager = new Mega_Menu_Style_Manager();
576
+ $default_theme = $style_manager->get_default_theme();
577
+
578
+ $theme_to_export = $this->active_theme;
579
+
580
+ $diff = array();
581
+
582
+ foreach ( $default_theme as $key => $value ) {
583
+ if ( isset( $theme_to_export[$key] ) && $theme_to_export[$key] != $value || $key == 'title') {
584
+ $diff[$key] = $theme_to_export[$key];
585
+ }
586
+ }
587
+
588
+ ?>
589
+
590
+ <div class='menu_settings menu_settings_menu_themes'>
591
+ <h3 class='first'><?php _e("Export Theme", "megamenu"); ?></h3>
592
+ <table>
593
+ <tr>
594
+ <td class='mega-name'>
595
+ <?php _e("JSON Format", "megamenu"); ?>
596
+ <div class='mega-description'><?php _e("Log into the site you wish to import the theme to. Go to Mega Menu > Tools and paste this into the 'Import Theme' text area:", "megamenu"); ?></div>
597
+ </td>
598
+ <td class='mega-value'>
599
+ <?php echo "<textarea class='mega-export'>" . sanitize_textarea_field( htmlentities( json_encode( $diff ) ) ) . "</textarea>"; ?>
600
+ </td>
601
+ </tr>
602
+ <tr>
603
+ <td class='mega-name'>
604
+ <?php _e("PHP Format", "megamenu"); ?>
605
+ <div class='mega-description'><?php _e("Paste this code into your themes functions.php file:", "megamenu"); ?></div>
606
+ </td>
607
+ <td class='mega-value'>
608
+ <?php
609
+ $key = strtolower( str_replace(" ", "_", $theme_to_export['title'] ) );
610
+ $key .= "_" . time();
611
+ echo "<textarea class='mega-export'>";
612
+ echo 'function megamenu_add_theme_' . $key . '($themes) {';
613
+ echo "\n" . ' $themes["' . $key .'"] = array(';
614
+
615
+ foreach ($diff as $theme_key => $value) {
616
+ echo "\n '" . $theme_key . "' => '" . $value . "',";
617
+ }
618
+
619
+ echo "\n" . ' );';
620
+ echo "\n" . ' return $themes;';
621
+ echo "\n" . '}';
622
+ echo "\n" . 'add_filter("megamenu_themes", "megamenu_add_theme_' . $key . '");';
623
+ echo '</textarea>';
624
+ ?>
625
+ </td>
626
+ </tr>
627
+ </table>
628
+ </div>
629
+
630
+ <?php
631
+ }
632
+
633
+ public function import_theme_page() {
634
+
635
+ ?>
636
+
637
+ <div class='menu_settings menu_settings_menu_themes'>
638
+ <h3 class='first'><?php _e("Import Theme", "megamenu"); ?></h3>
639
+ <table>
640
+ <tr>
641
+ <td class='mega-name'>
642
+ <?php _e("Import Theme", "megamenu"); ?>
643
+ <div class='mega-description'><?php _e("Import a menu theme in JSON format", "megamenu"); ?></div>
644
+ </td>
645
+ <td class='mega-value'>
646
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
647
+ <?php wp_nonce_field( 'megamenu_import_theme' ); ?>
648
+ <input type="hidden" name="action" value="megamenu_import_theme" />
649
+ <textarea name='data'></textarea>
650
+ <input type='submit' class='button button-primary' value='<?php _e("Import Theme", "megamenu"); ?>' />
651
+ </form>
652
+ </td>
653
+ </tr>
654
+ </table>
655
+ </div>
656
+
657
+ <?php
658
+ }
659
+
660
+
661
  /**
662
  * Displays the theme editor form.
663
  *
665
  */
666
  public function theme_editor_page( $saved_settings ) {
667
 
668
+
669
+
670
  $this->init();
671
 
672
+ if ( isset($_GET['export'] )) {
673
+ $this->export_theme();
674
+ return;
675
+ }
676
+
677
+ if ( isset($_GET['import'] )) {
678
+ $this->import_theme_page();
679
+ return;
680
+ }
681
+
682
  $create_url = esc_url( add_query_arg(
683
  array(
684
  'action'=>'megamenu_add_theme'
710
  wp_nonce_url( admin_url("admin-post.php"), 'megamenu_revert_theme' )
711
  ) );
712
 
713
+ $export_url = esc_url( add_query_arg(
714
+ array(
715
+ 'page'=>'maxmegamenu_theme_editor',
716
+ 'theme_id' => $this->id,
717
+ 'export' => 'true'
718
+ ),
719
+ admin_url("admin.php")
720
+ ) );
721
+
722
+ $import_url = esc_url( add_query_arg(
723
+ array(
724
+ 'page'=>'maxmegamenu_theme_editor',
725
+ 'import' => 'true'
726
+ ),
727
+ admin_url("admin.php")
728
+ ) );
729
+
730
  ?>
731
 
732
+ <?php $this->print_messages() ?>
733
+
734
  <div class='menu_settings menu_settings_menu_themes'>
735
 
736
  <div class='theme_selector'>
737
+ <?php _e("Select theme to edit", "megamenu"); ?> <?php echo $this->theme_selector(); ?>
738
+ </div>
739
+
740
+ <div class='mega-ellipsis'>
741
+ <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false">
742
+ <path d="M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"></path>
743
+ </svg>
744
+ <ul class='mega-ellipsis-content'>
745
+ <li class='mega-create-theme'><a href='<?php echo $create_url ?>'><span class='dashicons dashicons-welcome-add-page'></span><?php _e("Add new theme", "megamenu"); ?></a></li>
746
+ <li class='mega-duplicate-theme'><a href='<?php echo $duplicate_url ?>'><span class='dashicons dashicons-images-alt2'></span><?php _e("Duplicate theme", "megamenu"); ?></a></li>
747
+ <li class='mega-export-theme'><a href='<?php echo $export_url ?>'><span class='dashicons dashicons-upload'></span><?php _e("Export theme", "megamenu"); ?></a></li>
748
+ <li class='mega-import-theme'><a href='<?php echo $import_url ?>'><span class='dashicons dashicons-download'></span><?php _e("Import a theme", "megamenu"); ?></a></li>
749
+ <?php if ( $this->string_contains( $this->id, array("custom") ) ) : ?>
750
+ <li class='mega-delete-theme'><a class='delete confirm' href='<?php echo $delete_url; ?>'><span class='dashicons dashicons-trash'></span><?php _e("Delete theme", "megamenu"); ?></a></li>
751
+ <?php else : ?>
752
+ <li class='mega-revert-theme'><a class='confirm' href='<?php echo $revert_url; ?>'><span class='dashicons dashicons-update-alt'></span><?php _e("Revert theme", "megamenu"); ?></a></li>
753
+ <?php endif; ?>
754
+ </ul>
755
  </div>
756
 
757
  <h3 class='editing_theme'><?php echo __("Editing theme", "megamenu") . ": " . esc_html( $this->active_theme['title'] ); ?></h3>
758
 
759
+
760
+
761
  <?php
762
 
763
  $saved_settings = get_option("megamenu_settings");
2826
 
2827
  <div class='megamenu_submit'>
2828
  <div class='mega_left'>
2829
+ <?php submit_button(); ?>
2830
  </div>
2831
  <div class='mega_right'>
 
 
 
 
 
2832
  </div>
2833
  </div>
2834
 
3277
 
3278
  }
3279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3280
  }
3281
 
3282
  endif;
classes/pages/tools.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // disable direct access
5
+ }
6
+
7
+ if ( ! class_exists( 'Mega_Menu_Tools' ) ) :
8
+
9
+ /**
10
+ * Handles all admin related functionality.
11
+ */
12
+ class Mega_Menu_Tools {
13
+
14
+
15
+ /**
16
+ * Constructor
17
+ *
18
+ * @since 1.0
19
+ */
20
+ public function __construct() {
21
+ add_action( 'admin_post_megamenu_clear_css_cache', array( $this, 'tools_clear_css_cache') );
22
+ add_action( 'admin_post_megamenu_delete_data', array( $this, 'delete_data') );
23
+
24
+ add_filter( 'megamenu_menu_tabs', array( $this, 'add_tools_tab' ), 4 );
25
+ add_action( 'megamenu_page_tools', array( $this, 'tools_page'));
26
+ }
27
+
28
+ /**
29
+ * Add the Menu Locations tab to our available tabs
30
+ *
31
+ * @param array $tabs
32
+ * @since 2.8
33
+ */
34
+ public function add_tools_tab( $tabs ) {
35
+ $tabs['tools'] = __("Tools", "megamenu");
36
+ return $tabs;
37
+ }
38
+
39
+
40
+ /**
41
+ * Clear the CSS cache.
42
+ *
43
+ * @since 1.5
44
+ */
45
+ public function tools_clear_css_cache() {
46
+ check_admin_referer( 'megamenu_clear_css_cache' );
47
+ do_action( 'megamenu_delete_cache' );
48
+ $this->redirect( admin_url( 'admin.php?page=maxmegamenu_tools&clear_css_cache=true' ) );
49
+ }
50
+
51
+
52
+ /**
53
+ * Deletes all Max Mega Menu data from the database
54
+ *
55
+ * @since 1.5
56
+ */
57
+ public function delete_data() {
58
+
59
+ check_admin_referer( 'megamenu_delete_data' );
60
+
61
+ do_action("megamenu_delete_cache");
62
+
63
+ // delete options
64
+ delete_option("megamenu_settings");
65
+ delete_option("megamenu_locations");
66
+ delete_option("megamenu_toggle_blocks");
67
+ delete_option("megamenu_version");
68
+ delete_option("megamenu_initial_version");
69
+ delete_option("megamenu_themes_last_updated");
70
+ delete_option("megamenu_multisite_share_themes");
71
+
72
+
73
+ // delete all widgets assigned to menus
74
+ $widget_manager = new Mega_Menu_Widget_Manager();
75
+
76
+ if ( $mega_menu_widgets = $widget_manager->get_mega_menu_sidebar_widgets() ) {
77
+ foreach ( $mega_menu_widgets as $widget_id ) {
78
+ $widget_manager->delete_widget( $widget_id );
79
+ }
80
+ }
81
+
82
+ // delete all mega menu metadata stored against menu items
83
+ delete_metadata( 'post', 0, '_megamenu', '', true );
84
+
85
+ // clear cache
86
+ delete_transient( "megamenu_css" );
87
+
88
+ // delete custom themes
89
+ max_mega_menu_delete_themes();
90
+
91
+ $this->redirect( admin_url( "admin.php?page=maxmegamenu_tools&delete_data=true" ) );
92
+ }
93
+
94
+
95
+ /**
96
+ * Redirect and exit
97
+ *
98
+ * @since 1.8
99
+ */
100
+ public function redirect( $url ) {
101
+ wp_redirect( $url );
102
+ exit;
103
+ }
104
+
105
+
106
+ /**
107
+ * Content for 'Tools' tab
108
+ *
109
+ * @since 1.4
110
+ */
111
+ public function tools_page( $saved_settings ) {
112
+ $this->print_messages();
113
+
114
+ ?>
115
+
116
+ <div class='menu_settings menu_settings_tools'>
117
+ <h3 class='first'><?php _e("Tools", "megamenu"); ?></h3>
118
+ <table>
119
+ <tr>
120
+ <td class='mega-name'>
121
+ <?php _e("Cache", "megamenu"); ?>
122
+ <div class='mega-description'><?php _e("The CSS for your menu is updated each time a menu or a menu theme is changed. You can force the menu CSS to be updated using this tool.", "megamenu"); ?></div>
123
+ </td>
124
+ <td class='mega-value'>
125
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
126
+ <?php wp_nonce_field( 'megamenu_clear_css_cache' ); ?>
127
+ <input type="hidden" name="action" value="megamenu_clear_css_cache" />
128
+
129
+ <input type='submit' class='button button-primary' value='<?php _e("Clear CSS Cache", "megamenu"); ?>' />
130
+
131
+ <?php if ( get_transient( 'megamenu_css_last_updated' ) ): ?>
132
+ <p><em><small><?php echo sprintf(__("The menu CSS was last updated on %s", "megamenu"), date('l jS F Y H:i:s', get_transient('megamenu_css_last_updated') ) ); ?><small><em></p>
133
+ <?php endif; ?>
134
+ </form>
135
+ </td>
136
+ </tr>
137
+ <tr>
138
+ <td class='mega-name'>
139
+ <?php _e("Plugin Data", "megamenu"); ?>
140
+ <div class='mega-description'><?php _e("Delete all saved Max Mega Menu plugin data from the database. Use with caution!", "megamenu"); ?></div>
141
+ </td>
142
+ <td class='mega-value'>
143
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
144
+ <?php wp_nonce_field( 'megamenu_delete_data' ); ?>
145
+ <input type="hidden" name="action" value="megamenu_delete_data" />
146
+
147
+ <input type='submit' class='button button-secondary confirm' value='<?php _e("Delete Data", "megamenu"); ?>' />
148
+ </form>
149
+ </td>
150
+ </tr>
151
+ </table>
152
+ </div>
153
+
154
+ <?php
155
+ }
156
+
157
+
158
+ /**
159
+ * Display messages to the user
160
+ *
161
+ * @since 1.0
162
+ */
163
+ public function print_messages() {
164
+ if ( isset( $_GET['clear_css_cache'] ) && $_GET['clear_css_cache'] == 'true' ) {
165
+ echo "<p class='success'>";
166
+ echo __("The cache has been cleared and the menu CSS has been regenerated.", "megamenu");
167
+
168
+ $active_plugins = max_mega_menu_get_active_caching_plugins();
169
+
170
+ if ( count( $active_plugins ) ) {
171
+ echo "<br /><br />";
172
+ echo __("You may also need to clear the cache for any Caching, Minification or CDN plugin you have installed.", "megamenu");
173
+ }
174
+
175
+ echo "</p>";
176
+ }
177
+
178
+ if ( isset( $_GET['delete_data'] ) && $_GET['delete_data'] == 'true' ) {
179
+ echo "<p class='success'>" . __("All plugin data removed", "megamenu") . "</p>";
180
+ }
181
+ }
182
+ }
183
+
184
+ endif;
classes/style-manager.class.php CHANGED
@@ -33,6 +33,9 @@ final class Mega_Menu_Style_Manager {
33
  * @since 1.0
34
  */
35
  public function setup_actions() {
 
 
 
36
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
37
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 999 );
38
  add_action( 'wp_head', array( $this, 'head_css' ), 9999 );
@@ -40,6 +43,8 @@ final class Mega_Menu_Style_Manager {
40
  add_action( 'megamenu_delete_cache', array( $this, 'clear_external_caches' ) );
41
  add_action( 'after_switch_theme', array( $this, 'delete_cache') );
42
 
 
 
43
  // PolyLang
44
  if ( function_exists( 'pll_current_language' ) ) {
45
  add_filter( 'megamenu_css_transient_key', array( $this, 'polylang_transient_key') );
@@ -50,6 +55,23 @@ final class Mega_Menu_Style_Manager {
50
  add_filter( 'megamenu_css_filename', array( $this, 'wpml_css_filename') );
51
  add_action( 'megamenu_after_delete_cache', array( $this, 'wpml_delete_cache') );
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
 
@@ -57,11 +79,11 @@ final class Mega_Menu_Style_Manager {
57
  * Clear plugin caches when CSS is updated or menu settings are changed
58
  */
59
  public function clear_external_caches() {
60
-
61
  // Breeze: https://wordpress.org/plugins/breeze/
62
  do_action('breeze_clear_all_cache');
63
  }
64
 
 
65
  /**
66
  * Return the default menu theme
67
  */
@@ -253,7 +275,7 @@ final class Mega_Menu_Style_Manager {
253
  'flyout_link_color_hover' => 'font_color',
254
  'flyout_link_family' => 'font_family',
255
  'flyout_link_text_transform' => 'none',
256
- 'responsive_breakpoint' => '600px',
257
  'responsive_text' => 'MENU', // deprecated
258
  'line_height' => '1.7',
259
  'z_index' => '999',
@@ -319,9 +341,7 @@ final class Mega_Menu_Style_Manager {
319
  private function merge_in_saved_themes( $all_themes ) {
320
 
321
  if ( $saved_themes = max_mega_menu_get_themes() ) {
322
-
323
  foreach ( $saved_themes as $key => $settings ) {
324
-
325
  if ( isset( $all_themes[ $key ] ) ) {
326
  // merge modifications to default themes
327
  $all_themes[ $key ] = array_merge( $all_themes[ $key ], $saved_themes[ $key ] );
@@ -329,12 +349,10 @@ final class Mega_Menu_Style_Manager {
329
  // add in new themes
330
  $all_themes[ $key ] = $settings;
331
  }
332
-
333
  }
334
  }
335
 
336
  return $all_themes;
337
-
338
  }
339
 
340
 
@@ -365,18 +383,12 @@ final class Mega_Menu_Style_Manager {
365
  private function process_theme_replacements( $all_themes ) {
366
 
367
  foreach ( $all_themes as $key => $settings ) {
368
-
369
  // process replacements
370
  foreach ( $settings as $var => $val ) {
371
-
372
  if ( ! is_array( $val ) && isset( $all_themes[$key][$val] ) ) {
373
-
374
  $all_themes[$key][$var] = $all_themes[$key][$val];
375
-
376
  }
377
-
378
  }
379
-
380
  }
381
 
382
  return $all_themes;
@@ -394,15 +406,12 @@ final class Mega_Menu_Style_Manager {
394
  $default_themes = $this->default_themes();
395
 
396
  $all_themes = $this->merge_in_saved_themes( $default_themes );
397
-
398
  $all_themes = $this->ensure_all_themes_have_all_default_theme_settings( $all_themes );
399
-
400
  $all_themes = $this->process_theme_replacements( $all_themes );
401
 
402
  uasort( $all_themes, array( $this, 'sort_by_title' ) );
403
 
404
  return $all_themes;
405
-
406
  }
407
 
408
 
@@ -414,21 +423,18 @@ final class Mega_Menu_Style_Manager {
414
  * @param array $b
415
  */
416
  private function sort_by_title( $a, $b ) {
417
-
418
  return strcmp( $a['title'], $b['title'] );
419
-
420
  }
421
 
422
 
423
  /**
424
- *
425
  *
426
  * @since 1.3.1
 
427
  */
428
  private function is_debug_mode() {
429
-
430
- return ( defined( 'MEGAMENU_DEBUG' ) && MEGAMENU_DEBUG === true ) || ( current_user_can('edit_theme_options') && isset( $_GET['nocache'] ) );
431
-
432
  }
433
 
434
 
@@ -440,15 +446,10 @@ final class Mega_Menu_Style_Manager {
440
  public function get_css() {
441
 
442
  if ( ( $css = $this->get_cached_css() ) && ! $this->is_debug_mode() ) {
443
-
444
  return $css;
445
-
446
  } else {
447
-
448
  return $this->generate_css();
449
-
450
  }
451
-
452
  }
453
 
454
 
@@ -514,6 +515,7 @@ final class Mega_Menu_Style_Manager {
514
 
515
 
516
  /**
 
517
  *
518
  * @since 1.6.1
519
  */
@@ -623,7 +625,12 @@ final class Mega_Menu_Style_Manager {
623
 
624
  }
625
 
626
- public function test_theme_compilation($theme) {
 
 
 
 
 
627
  $menu_id = 0;
628
 
629
  $menus = get_registered_nav_menus();
@@ -643,6 +650,7 @@ final class Mega_Menu_Style_Manager {
643
 
644
  }
645
 
 
646
  /**
647
  * Compiles raw SCSS into CSS for a particular menu location.
648
  *
@@ -783,13 +791,10 @@ final class Mega_Menu_Style_Manager {
783
  }
784
 
785
  if ( in_array( $name, array( 'panel_width', 'panel_inner_width', 'mobile_menu_force_width_selector' ) ) ) {
786
-
787
  if ( preg_match('/^\d/', $value) !== 1 ) { // doesn't start with number (jQuery selector)
788
  $vars[$name] = '100%';
789
-
790
  continue;
791
  }
792
-
793
  }
794
 
795
  if ( $name != 'custom_css' ) {
@@ -826,13 +831,10 @@ final class Mega_Menu_Style_Manager {
826
  * @since 1.3
827
  */
828
  private function get_menu_id_for_location( $location ) {
829
-
830
  $locations = get_nav_menu_locations();
831
-
832
  $menu_id = isset( $locations[ $location ] ) ? $locations[ $location ] : 0;
833
 
834
  return $menu_id;
835
-
836
  }
837
 
838
 
@@ -842,13 +844,10 @@ final class Mega_Menu_Style_Manager {
842
  * @since 2.1
843
  */
844
  private function get_theme_id_for_location( $location ) {
845
-
846
  $settings = $this->settings;
847
-
848
  $theme_id = isset( $settings[ $location ]['theme'] ) ? $settings[ $location ]['theme'] : 'default';
849
 
850
  return $theme_id;
851
-
852
  }
853
 
854
 
@@ -858,25 +857,31 @@ final class Mega_Menu_Style_Manager {
858
  * @since 1.3
859
  */
860
  private function get_theme_settings_for_location( $location ) {
861
-
862
  $theme_id = $this->get_theme_id_for_location( $location );
863
-
864
  $all_themes = $this->get_themes();
865
-
866
  $theme_settings = isset( $all_themes[ $theme_id ] ) ? $all_themes[ $theme_id ] : $all_themes[ 'default' ];
867
 
868
  return $theme_settings;
869
-
870
  }
871
 
872
 
 
 
 
 
 
 
 
 
 
 
 
873
  /**
874
  * Enqueue public CSS and JS files required by Mega Menu
875
  *
876
  * @since 1.0
877
  */
878
  public function enqueue_styles() {
879
-
880
  if ( $this->get_css_output_method() == 'fs' ) {
881
  $this->enqueue_fs_style();
882
  }
@@ -900,7 +905,11 @@ final class Mega_Menu_Style_Manager {
900
 
901
  $dependencies = apply_filters("megamenu_javascript_dependencies", array('jquery', 'hoverIntent'));
902
 
903
- $scripts_in_footer = defined( 'MEGAMENU_SCRIPTS_IN_FOOTER' ) ? MEGAMENU_SCRIPTS_IN_FOOTER : true;
 
 
 
 
904
 
905
  ///** change the script handle to prevent conflict with theme files */
906
  //function megamenu_script_handle() {
@@ -923,20 +932,7 @@ final class Mega_Menu_Style_Manager {
923
  wp_localize_script( $handle, 'megamenu', $params );
924
  }
925
 
926
- /**
927
- * Returns the menu settings for a specified location.
928
- *
929
- * @since 2.2
930
- */
931
- private function get_menu_settings_for_location( $location ) {
932
 
933
- $settings = $this->settings;
934
-
935
- $location_settings = isset( $settings[ $location ] ) ? $settings[ $location ] : array();
936
-
937
- return $location_settings;
938
-
939
- }
940
 
941
  /**
942
  * Enqueue the stylesheet held on the filesystem.
@@ -979,14 +975,12 @@ final class Mega_Menu_Style_Manager {
979
  * @since 1.6.1
980
  */
981
  private function set_cached_css( $css ) {
982
-
983
  // set a far expiration date to prevent transient from being autoloaded
984
  $hundred_years_in_seconds = 3153600000;
985
 
986
  set_transient( $this->get_transient_key(), $css, $hundred_years_in_seconds );
987
  set_transient( 'megamenu_css_version', MEGAMENU_VERSION, $hundred_years_in_seconds );
988
  set_transient( 'megamenu_css_last_updated', time(), $hundred_years_in_seconds );
989
-
990
  }
991
 
992
 
@@ -997,9 +991,7 @@ final class Mega_Menu_Style_Manager {
997
  * @return mixed
998
  */
999
  private function get_cached_css() {
1000
-
1001
  return get_transient( $this->get_transient_key() );
1002
-
1003
  }
1004
 
1005
 
@@ -1041,9 +1033,7 @@ final class Mega_Menu_Style_Manager {
1041
  * @return string
1042
  */
1043
  private function get_transient_key() {
1044
-
1045
  return apply_filters( 'megamenu_css_transient_key', 'megamenu_css' );
1046
-
1047
  }
1048
 
1049
 
@@ -1054,9 +1044,7 @@ final class Mega_Menu_Style_Manager {
1054
  * @since 1.6.1
1055
  */
1056
  private function get_css_filename() {
1057
-
1058
  return apply_filters( "megamenu_css_filename", 'style' ) . '.css';
1059
-
1060
  }
1061
 
1062
 
@@ -1066,9 +1054,7 @@ final class Mega_Menu_Style_Manager {
1066
  * @return string
1067
  */
1068
  private function get_css_output_method() {
1069
-
1070
  return isset( $this->settings['css'] ) ? $this->settings['css'] : 'fs';
1071
-
1072
  }
1073
 
1074
 
@@ -1122,7 +1108,6 @@ final class Mega_Menu_Style_Manager {
1122
  }
1123
 
1124
  return $key;
1125
-
1126
  }
1127
 
1128
 
@@ -1141,7 +1126,6 @@ final class Mega_Menu_Style_Manager {
1141
  }
1142
 
1143
  return $filename;
1144
-
1145
  }
1146
 
1147
 
@@ -1157,7 +1141,6 @@ final class Mega_Menu_Style_Manager {
1157
  foreach ( $languages as $language ) {
1158
  delete_transient( 'megamenu_css_' . $language['language_code'] );
1159
  }
1160
-
1161
  }
1162
 
1163
 
@@ -1168,11 +1151,9 @@ final class Mega_Menu_Style_Manager {
1168
  * @return string
1169
  */
1170
  public function wpml_transient_key( $key ) {
1171
-
1172
  $key .= "_" . ICL_LANGUAGE_CODE;
1173
 
1174
  return $key;
1175
-
1176
  }
1177
 
1178
 
@@ -1183,14 +1164,10 @@ final class Mega_Menu_Style_Manager {
1183
  * @return string
1184
  */
1185
  public function wpml_css_filename( $filename ) {
1186
-
1187
  $filename .= "_" . ICL_LANGUAGE_CODE;
1188
 
1189
  return $filename;
1190
-
1191
  }
1192
-
1193
-
1194
  }
1195
 
1196
  endif;
33
  * @since 1.0
34
  */
35
  public function setup_actions() {
36
+ add_action( 'megamenu_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
37
+ add_action( 'megamenu_enqueue_styles', array( $this, 'enqueue_styles' ) );
38
+
39
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
40
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 999 );
41
  add_action( 'wp_head', array( $this, 'head_css' ), 9999 );
43
  add_action( 'megamenu_delete_cache', array( $this, 'clear_external_caches' ) );
44
  add_action( 'after_switch_theme', array( $this, 'delete_cache') );
45
 
46
+ add_action( 'megamenu_head_css', array( $this, 'head_css' ), 999 );
47
+
48
  // PolyLang
49
  if ( function_exists( 'pll_current_language' ) ) {
50
  add_filter( 'megamenu_css_transient_key', array( $this, 'polylang_transient_key') );
55
  add_filter( 'megamenu_css_filename', array( $this, 'wpml_css_filename') );
56
  add_action( 'megamenu_after_delete_cache', array( $this, 'wpml_delete_cache') );
57
  }
58
+
59
+ add_filter('megamenu_scripts_in_footer', array($this, 'scripts_in_footer') );
60
+ }
61
+
62
+
63
+ /**
64
+ * Determines whether to load JavaScript in footer or not, based on the configured option.
65
+ *
66
+ * @since 2.9
67
+ * @return bool
68
+ */
69
+ function scripts_in_footer() {
70
+ if ( isset( $this->settings['js'] ) && $this->settings['js'] == 'head' ) {
71
+ return false;
72
+ }
73
+
74
+ return true;
75
  }
76
 
77
 
79
  * Clear plugin caches when CSS is updated or menu settings are changed
80
  */
81
  public function clear_external_caches() {
 
82
  // Breeze: https://wordpress.org/plugins/breeze/
83
  do_action('breeze_clear_all_cache');
84
  }
85
 
86
+
87
  /**
88
  * Return the default menu theme
89
  */
275
  'flyout_link_color_hover' => 'font_color',
276
  'flyout_link_family' => 'font_family',
277
  'flyout_link_text_transform' => 'none',
278
+ 'responsive_breakpoint' => '768px',
279
  'responsive_text' => 'MENU', // deprecated
280
  'line_height' => '1.7',
281
  'z_index' => '999',
341
  private function merge_in_saved_themes( $all_themes ) {
342
 
343
  if ( $saved_themes = max_mega_menu_get_themes() ) {
 
344
  foreach ( $saved_themes as $key => $settings ) {
 
345
  if ( isset( $all_themes[ $key ] ) ) {
346
  // merge modifications to default themes
347
  $all_themes[ $key ] = array_merge( $all_themes[ $key ], $saved_themes[ $key ] );
349
  // add in new themes
350
  $all_themes[ $key ] = $settings;
351
  }
 
352
  }
353
  }
354
 
355
  return $all_themes;
 
356
  }
357
 
358
 
383
  private function process_theme_replacements( $all_themes ) {
384
 
385
  foreach ( $all_themes as $key => $settings ) {
 
386
  // process replacements
387
  foreach ( $settings as $var => $val ) {
 
388
  if ( ! is_array( $val ) && isset( $all_themes[$key][$val] ) ) {
 
389
  $all_themes[$key][$var] = $all_themes[$key][$val];
 
390
  }
 
391
  }
 
392
  }
393
 
394
  return $all_themes;
406
  $default_themes = $this->default_themes();
407
 
408
  $all_themes = $this->merge_in_saved_themes( $default_themes );
 
409
  $all_themes = $this->ensure_all_themes_have_all_default_theme_settings( $all_themes );
 
410
  $all_themes = $this->process_theme_replacements( $all_themes );
411
 
412
  uasort( $all_themes, array( $this, 'sort_by_title' ) );
413
 
414
  return $all_themes;
 
415
  }
416
 
417
 
423
  * @param array $b
424
  */
425
  private function sort_by_title( $a, $b ) {
 
426
  return strcmp( $a['title'], $b['title'] );
 
427
  }
428
 
429
 
430
  /**
431
+ *
432
  *
433
  * @since 1.3.1
434
+ * @return bool
435
  */
436
  private function is_debug_mode() {
437
+ return ( defined( 'MEGAMENU_DEBUG' ) && MEGAMENU_DEBUG === true );
 
 
438
  }
439
 
440
 
446
  public function get_css() {
447
 
448
  if ( ( $css = $this->get_cached_css() ) && ! $this->is_debug_mode() ) {
 
449
  return $css;
 
450
  } else {
 
451
  return $this->generate_css();
 
452
  }
 
453
  }
454
 
455
 
515
 
516
 
517
  /**
518
+ * Saves the generated CSS to the uploads folder
519
  *
520
  * @since 1.6.1
521
  */
625
 
626
  }
627
 
628
+ /**
629
+ * Before a theme is saved, attempt to generate the CSS to ensure it passes as valid SCSS
630
+ *
631
+ * @param array $theme
632
+ */
633
+ public function test_theme_compilation( $theme ) {
634
  $menu_id = 0;
635
 
636
  $menus = get_registered_nav_menus();
650
 
651
  }
652
 
653
+
654
  /**
655
  * Compiles raw SCSS into CSS for a particular menu location.
656
  *
791
  }
792
 
793
  if ( in_array( $name, array( 'panel_width', 'panel_inner_width', 'mobile_menu_force_width_selector' ) ) ) {
 
794
  if ( preg_match('/^\d/', $value) !== 1 ) { // doesn't start with number (jQuery selector)
795
  $vars[$name] = '100%';
 
796
  continue;
797
  }
 
798
  }
799
 
800
  if ( $name != 'custom_css' ) {
831
  * @since 1.3
832
  */
833
  private function get_menu_id_for_location( $location ) {
 
834
  $locations = get_nav_menu_locations();
 
835
  $menu_id = isset( $locations[ $location ] ) ? $locations[ $location ] : 0;
836
 
837
  return $menu_id;
 
838
  }
839
 
840
 
844
  * @since 2.1
845
  */
846
  private function get_theme_id_for_location( $location ) {
 
847
  $settings = $this->settings;
 
848
  $theme_id = isset( $settings[ $location ]['theme'] ) ? $settings[ $location ]['theme'] : 'default';
849
 
850
  return $theme_id;
 
851
  }
852
 
853
 
857
  * @since 1.3
858
  */
859
  private function get_theme_settings_for_location( $location ) {
 
860
  $theme_id = $this->get_theme_id_for_location( $location );
 
861
  $all_themes = $this->get_themes();
 
862
  $theme_settings = isset( $all_themes[ $theme_id ] ) ? $all_themes[ $theme_id ] : $all_themes[ 'default' ];
863
 
864
  return $theme_settings;
 
865
  }
866
 
867
 
868
+ /**
869
+ * Returns the menu settings for a specified location.
870
+ *
871
+ * @since 2.2
872
+ */
873
+ private function get_menu_settings_for_location( $location ) {
874
+ $settings = $this->settings;
875
+ $location_settings = isset( $settings[ $location ] ) ? $settings[ $location ] : array();
876
+ return $location_settings;
877
+ }
878
+
879
  /**
880
  * Enqueue public CSS and JS files required by Mega Menu
881
  *
882
  * @since 1.0
883
  */
884
  public function enqueue_styles() {
 
885
  if ( $this->get_css_output_method() == 'fs' ) {
886
  $this->enqueue_fs_style();
887
  }
905
 
906
  $dependencies = apply_filters("megamenu_javascript_dependencies", array('jquery', 'hoverIntent'));
907
 
908
+ $scripts_in_footer = apply_filters( "megamenu_scripts_in_footer", true );
909
+
910
+ if ( defined( 'MEGAMENU_SCRIPTS_IN_FOOTER' ) ) {
911
+ $scripts_in_footer = MEGAMENU_SCRIPTS_IN_FOOTER;
912
+ }
913
 
914
  ///** change the script handle to prevent conflict with theme files */
915
  //function megamenu_script_handle() {
932
  wp_localize_script( $handle, 'megamenu', $params );
933
  }
934
 
 
 
 
 
 
 
935
 
 
 
 
 
 
 
 
936
 
937
  /**
938
  * Enqueue the stylesheet held on the filesystem.
975
  * @since 1.6.1
976
  */
977
  private function set_cached_css( $css ) {
 
978
  // set a far expiration date to prevent transient from being autoloaded
979
  $hundred_years_in_seconds = 3153600000;
980
 
981
  set_transient( $this->get_transient_key(), $css, $hundred_years_in_seconds );
982
  set_transient( 'megamenu_css_version', MEGAMENU_VERSION, $hundred_years_in_seconds );
983
  set_transient( 'megamenu_css_last_updated', time(), $hundred_years_in_seconds );
 
984
  }
985
 
986
 
991
  * @return mixed
992
  */
993
  private function get_cached_css() {
 
994
  return get_transient( $this->get_transient_key() );
 
995
  }
996
 
997
 
1033
  * @return string
1034
  */
1035
  private function get_transient_key() {
 
1036
  return apply_filters( 'megamenu_css_transient_key', 'megamenu_css' );
 
1037
  }
1038
 
1039
 
1044
  * @since 1.6.1
1045
  */
1046
  private function get_css_filename() {
 
1047
  return apply_filters( "megamenu_css_filename", 'style' ) . '.css';
 
1048
  }
1049
 
1050
 
1054
  * @return string
1055
  */
1056
  private function get_css_output_method() {
 
1057
  return isset( $this->settings['css'] ) ? $this->settings['css'] : 'fs';
 
1058
  }
1059
 
1060
 
1108
  }
1109
 
1110
  return $key;
 
1111
  }
1112
 
1113
 
1126
  }
1127
 
1128
  return $filename;
 
1129
  }
1130
 
1131
 
1141
  foreach ( $languages as $language ) {
1142
  delete_transient( 'megamenu_css_' . $language['language_code'] );
1143
  }
 
1144
  }
1145
 
1146
 
1151
  * @return string
1152
  */
1153
  public function wpml_transient_key( $key ) {
 
1154
  $key .= "_" . ICL_LANGUAGE_CODE;
1155
 
1156
  return $key;
 
1157
  }
1158
 
1159
 
1164
  * @return string
1165
  */
1166
  public function wpml_css_filename( $filename ) {
 
1167
  $filename .= "_" . ICL_LANGUAGE_CODE;
1168
 
1169
  return $filename;
 
1170
  }
 
 
1171
  }
1172
 
1173
  endif;
classes/toggle-blocks.class.php CHANGED
@@ -29,12 +29,10 @@ class Mega_Menu_Toggle_Blocks {
29
  add_action( 'megamenu_output_admin_toggle_block_menu_toggle', array( $this, 'output_menu_toggle_block_html'), 10, 2 );
30
  add_action( 'megamenu_output_public_toggle_block_menu_toggle', array( $this, 'output_menu_public_toggle_block_html'), 10, 2 );
31
 
32
-
33
  add_action( 'wp_ajax_mm_get_toggle_block_menu_toggle_animated', array( $this, 'output_menu_toggle_block_animated_html' ) );
34
  add_action( 'megamenu_output_admin_toggle_block_menu_toggle_animated', array( $this, 'output_menu_toggle_block_animated_html'), 10, 2 );
35
  add_action( 'megamenu_output_public_toggle_block_menu_toggle_animated', array( $this, 'output_menu_public_toggle_block_animated_html'), 10, 2 );
36
 
37
-
38
  add_action( 'wp_ajax_mm_get_toggle_block_spacer', array( $this, 'output_spacer_block_html' ) );
39
  add_action( 'megamenu_output_admin_toggle_block_spacer', array( $this, 'output_spacer_block_html'), 10, 2 );
40
 
@@ -91,13 +89,14 @@ class Mega_Menu_Toggle_Blocks {
91
  return $blocks[ $theme_id ];
92
  }
93
 
94
- // backwards compatibility
95
- // default to right aligned menu toggle using existing theme settings
96
- $default_blocks = array(
97
- 1 => $this->get_default_menu_toggle_block( $theme_id )
 
98
  );
99
 
100
- return $default_blocks;
101
 
102
  }
103
 
@@ -653,20 +652,23 @@ class Mega_Menu_Toggle_Blocks {
653
  $toggle_blocks = $this->get_toggle_blocks_for_theme( $theme_id );
654
 
655
  $block_types = apply_filters("megamenu_registered_toggle_blocks", array(
656
- 'title' => __("Add block to toggle bar", "megamenu"),
657
- 'menu_toggle' => __("Menu Toggle", "megamenu"),
658
- 'menu_toggle_animated' => __("Menu Toggle Animated", "megamenu"),
659
  'spacer' => __("Spacer", "megamenu")
660
  ));
661
 
 
662
  ?>
663
 
664
  <select id='toggle-block-selector'>
 
 
665
  <?php foreach( $block_types as $block_id => $block_name ) : ?>
666
  <option value='<?php echo $block_id; ?>'><?php echo $block_name ?></option>
667
  <?php endforeach; ?>
668
 
669
  <?php if ( ! is_plugin_active('megamenu-pro/megamenu-pro.php') ): ?>
 
670
  <option disabled="disabled">Search (Pro)</option>
671
  <option disabled="disabled">Logo (Pro)</option>
672
  <option disabled="disabled">Icon (Pro)</option>
29
  add_action( 'megamenu_output_admin_toggle_block_menu_toggle', array( $this, 'output_menu_toggle_block_html'), 10, 2 );
30
  add_action( 'megamenu_output_public_toggle_block_menu_toggle', array( $this, 'output_menu_public_toggle_block_html'), 10, 2 );
31
 
 
32
  add_action( 'wp_ajax_mm_get_toggle_block_menu_toggle_animated', array( $this, 'output_menu_toggle_block_animated_html' ) );
33
  add_action( 'megamenu_output_admin_toggle_block_menu_toggle_animated', array( $this, 'output_menu_toggle_block_animated_html'), 10, 2 );
34
  add_action( 'megamenu_output_public_toggle_block_menu_toggle_animated', array( $this, 'output_menu_public_toggle_block_animated_html'), 10, 2 );
35
 
 
36
  add_action( 'wp_ajax_mm_get_toggle_block_spacer', array( $this, 'output_spacer_block_html' ) );
37
  add_action( 'megamenu_output_admin_toggle_block_spacer', array( $this, 'output_spacer_block_html'), 10, 2 );
38
 
89
  return $blocks[ $theme_id ];
90
  }
91
 
92
+ $defaults[] = array(
93
+ 'type' => 'menu_toggle_animated',
94
+ 'align' => 'right',
95
+ 'icon_scale' => isset($settings['icon_scale']) && strlen($settings['icon_scale']) ? $settings['icon_scale'] : "0.8",
96
+ 'icon_color' => isset($settings['icon_color']) ? $settings['icon_color'] : 'rgb(221, 221, 221)'
97
  );
98
 
99
+ return $defaults;
100
 
101
  }
102
 
652
  $toggle_blocks = $this->get_toggle_blocks_for_theme( $theme_id );
653
 
654
  $block_types = apply_filters("megamenu_registered_toggle_blocks", array(
655
+ 'menu_toggle_animated' => __("Menu Toggle (Animated)", "megamenu"),
656
+ 'menu_toggle' => __("Menu Toggle (Standard)", "megamenu"),
 
657
  'spacer' => __("Spacer", "megamenu")
658
  ));
659
 
660
+ ksort( $block_types );
661
  ?>
662
 
663
  <select id='toggle-block-selector'>
664
+ <option value='title'><?php echo __("Add block to toggle bar", "megamenu") ?></option>
665
+
666
  <?php foreach( $block_types as $block_id => $block_name ) : ?>
667
  <option value='<?php echo $block_id; ?>'><?php echo $block_name ?></option>
668
  <?php endforeach; ?>
669
 
670
  <?php if ( ! is_plugin_active('megamenu-pro/megamenu-pro.php') ): ?>
671
+ <option disabled="disabled">Menu Toggle (Custom) (Pro)</option>
672
  <option disabled="disabled">Search (Pro)</option>
673
  <option disabled="disabled">Logo (Pro)</option>
674
  <option disabled="disabled">Icon (Pro)</option>
classes/{widget-elementor-template.class.php → widgets/widget-elementor-template.class.php} RENAMED
File without changes
classes/{widget-reusable-block.class.php → widgets/widget-reusable-block.class.php} RENAMED
File without changes
classes/{widget.class.php → widgets/widget.class.php} RENAMED
File without changes
css/admin/admin.css CHANGED
@@ -31,6 +31,144 @@
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
 
@@ -50,63 +188,28 @@
50
  margin: 10px 0 0 0; }
51
  .nav-menus-php #cboxContent .notice .notice-dismiss:focus {
52
  box-shadow: none; }
53
- .nav-menus-php #cboxContent .mega-tooltip {
54
- position: relative; }
55
- .nav-menus-php #cboxContent .mega-tooltip.mega-enabled:before {
56
- content: attr(data-tooltip-enabled); }
57
- .nav-menus-php #cboxContent .mega-tooltip.mega-disabled:before {
58
- content: attr(data-tooltip-disabled); }
59
- .nav-menus-php #cboxContent .mega-tooltip:before {
60
- position: absolute;
61
- content: attr(data-tooltip);
62
- top: -32px;
63
- background: #000;
64
- color: #fff;
65
- padding: 3px 0;
66
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
67
- font-size: 10px;
68
- border-radius: 3px;
69
- margin-left: -10px;
70
- width: 160px;
71
- z-index: 2; }
72
- .nav-menus-php #cboxContent .mega-tooltip:after {
73
- top: -8px;
74
- left: 8px;
75
- border: solid transparent;
76
- content: " ";
77
- height: 0;
78
- width: 0;
79
- position: absolute;
80
- border-color: transparent;
81
- border-top-color: #000;
82
- border-width: 4px;
83
- margin-left: -4px; }
84
- .nav-menus-php #cboxContent .mega-tooltip:before, .nav-menus-php #cboxContent .mega-tooltip:after {
85
- opacity: 0;
86
- pointer-events: none;
87
- text-align: center;
88
- transition: all 0.3s;
89
- transition-delay: 0.3s; }
90
- .nav-menus-php #cboxContent .mega-tooltip:focus:before, .nav-menus-php #cboxContent .mega-tooltip:focus:after, .nav-menus-php #cboxContent .mega-tooltip:hover:before, .nav-menus-php #cboxContent .mega-tooltip:hover:after {
91
- opacity: 1; }
92
  .nav-menus-php #cboxContent .mm_tabs li.mm_tab_horizontal {
93
  float: left;
94
- margin-right: 10px;
95
  cursor: pointer;
 
 
96
  padding: 3px 5px;
97
- font-size: 0.9em;
 
 
98
  color: #444;
99
- transition: all 0.05s linear; }
100
- .nav-menus-php #cboxContent .mm_tabs li.mm_tab_horizontal:hover {
 
 
101
  background: #0073aa;
 
102
  color: white; }
103
- .nav-menus-php #cboxContent .mm_tabs li.mm_tab_horizontal.active {
104
- background: #0073aa;
105
- color: white; }
106
  .nav-menus-php #cboxContent .mm_tabs.horizontal {
107
  width: 85%;
108
  float: left;
109
- margin-top: 0; }
 
110
  .nav-menus-php #cboxContent .filter_icons {
111
  width: 14%;
112
  float: right;
@@ -115,8 +218,8 @@
115
  .nav-menus-php #cboxContent .mm_header_container {
116
  float: left;
117
  width: 100%;
118
- border-bottom: 1px solid #eee;
119
- background: #eee; }
120
  .nav-menus-php #cboxContent .mm_header_container .mm_title {
121
  padding: 0 20px;
122
  font-size: 1.3em;
@@ -637,7 +740,7 @@
637
  float: left; }
638
  .nav-menus-php #cboxContent .mm_content.mega_menu #widgets .drop-area {
639
  display: block;
640
- border: 1px solid #eee;
641
  float: left;
642
  -webkit-box-sizing: border-box;
643
  -moz-box-sizing: border-box;
@@ -1045,6 +1148,8 @@
1045
  font-size: 0.9em;
1046
  color: #999;
1047
  line-height: 1.5em; }
 
 
1048
  .nav-menus-php #cboxContent table td.mega-value {
1049
  font-size: 12px; }
1050
  .nav-menus-php #cboxContent table td.mega-value select {
@@ -1067,6 +1172,8 @@
1067
  line-height: 1.5em;
1068
  text-indent: 2px;
1069
  margin-top: 5px; }
 
 
1070
  .nav-menus-php #cboxContent table .mega-menu-item-align td.mega-value select {
1071
  float: left; }
1072
  .nav-menus-php #cboxContent table .mega-menu-item-align td.mega-value .mega-description {
@@ -1090,7 +1197,7 @@
1090
  margin-right: 10px;
1091
  vertical-align: middle; }
1092
  .nav-menus-php #cboxContent .general_settings table td {
1093
- padding-bottom: 5px; }
1094
  .nav-menus-php #cboxContent form > h4.first {
1095
  margin: 0em 0 0.7em 0; }
1096
  .nav-menus-php #cboxContent form > h4 {
@@ -1177,28 +1284,22 @@
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%;
@@ -1315,25 +1416,88 @@ body.toplevel_page_maxmegamenu .select2-result-label i {
1315
  -webkit-font-smoothing: antialiased;
1316
  -moz-osx-font-smoothing: grayscale; }
1317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1318
  body[class*='_page_maxmegamenu_'] .megamenu_wrap,
1319
  body.toplevel_page_maxmegamenu .megamenu_wrap {
1320
  width: 100%;
1321
  float: left;
 
 
1322
  background: white; }
 
 
 
 
1323
 
1324
  body[class*='_page_maxmegamenu_'] .megamenu_left,
1325
  body.toplevel_page_maxmegamenu .megamenu_left {
1326
- float: left;
1327
- width: 190px;
1328
- margin-left: -100%; }
1329
- body[class*='_page_maxmegamenu_'] .megamenu_left ul li a:hover,
1330
- body[class*='_page_maxmegamenu_'] .megamenu_left ul li a.active,
1331
- body.toplevel_page_maxmegamenu .megamenu_left ul li a:hover,
1332
- body.toplevel_page_maxmegamenu .megamenu_left ul li a.active {
1333
- border-left: 2px solid #0074a2;
1334
- color: #0074a2; }
1335
- body[class*='_page_maxmegamenu_'] .megamenu_left ul li a,
1336
- body.toplevel_page_maxmegamenu .megamenu_left ul li a {
 
 
 
 
 
 
 
 
 
1337
  text-decoration: none;
1338
  color: #444;
1339
  width: 100%;
@@ -1342,29 +1506,36 @@ body.toplevel_page_maxmegamenu .megamenu_left {
1342
  box-sizing: border-box;
1343
  border-left: 2px solid white;
1344
  outline: 0; }
1345
- body[class*='_page_maxmegamenu_'] .megamenu_left ul li.error,
1346
- body.toplevel_page_maxmegamenu .megamenu_left ul li.error {
1347
- border-left: 3px solid #D0011B; }
1348
- body[class*='_page_maxmegamenu_'] .megamenu_left ul li.mega_active,
1349
- body.toplevel_page_maxmegamenu .megamenu_left ul li.mega_active {
1350
- font-weight: bold; }
1351
- body[class*='_page_maxmegamenu_'] .megamenu_left ul li.mega_active a:after,
1352
- body.toplevel_page_maxmegamenu .megamenu_left ul li.mega_active a:after {
1353
- right: 0;
1354
- content: '\f139';
1355
- border: 0;
1356
- background: 0 0;
1357
- font: 400 20px/1 dashicons;
1358
- speak: none;
1359
- float: right;
1360
- padding: 0;
1361
- text-indent: 0;
1362
- text-align: center;
1363
- position: relative;
1364
- -webkit-font-smoothing: antialiased;
1365
- -moz-osx-font-smoothing: grayscale;
1366
- text-decoration: none !important;
1367
- margin-right: 0; }
 
 
 
 
 
 
 
1368
 
1369
  body[class*='_page_maxmegamenu_'] h3.first,
1370
  body.toplevel_page_maxmegamenu h3.first {
@@ -1416,49 +1587,6 @@ body.toplevel_page_maxmegamenu .megamenu_submit {
1416
  body.toplevel_page_maxmegamenu .megamenu_submit .mega_right a {
1417
  color: #D0011B; }
1418
 
1419
- body[class*='_page_maxmegamenu_'] .megamenu_header,
1420
- body.toplevel_page_maxmegamenu .megamenu_header {
1421
- background: white;
1422
- padding: 10px 17px;
1423
- border-bottom: 1px solid #eee;
1424
- float: left;
1425
- width: 100%;
1426
- box-sizing: border-box; }
1427
- body[class*='_page_maxmegamenu_'] .megamenu_header .version,
1428
- body.toplevel_page_maxmegamenu .megamenu_header .version {
1429
- font-style: italic;
1430
- color: #999;
1431
- margin-bottom: 15px; }
1432
-
1433
- body[class*='_page_maxmegamenu_'] .megamenu_header_top,
1434
- body.toplevel_page_maxmegamenu .megamenu_header_top {
1435
- font-size: 0.9em;
1436
- display: block;
1437
- width: 100%;
1438
- height: 30px;
1439
- line-height: 30px;
1440
- margin-bottom: 10px;
1441
- box-sizing: border-box; }
1442
- body[class*='_page_maxmegamenu_'] .megamenu_header_top ul,
1443
- body.toplevel_page_maxmegamenu .megamenu_header_top ul {
1444
- margin: 0;
1445
- float: right;
1446
- position: relative; }
1447
- body[class*='_page_maxmegamenu_'] .megamenu_header_top ul li,
1448
- body.toplevel_page_maxmegamenu .megamenu_header_top ul li {
1449
- display: inline-block;
1450
- margin: 0 0 0 14px;
1451
- line-height: 30px; }
1452
- body[class*='_page_maxmegamenu_'] .megamenu_header_top ul li.mega-highlight,
1453
- body.toplevel_page_maxmegamenu .megamenu_header_top ul li.mega-highlight {
1454
- background: #35b1df;
1455
- border-radius: 5px; }
1456
- body[class*='_page_maxmegamenu_'] .megamenu_header_top ul li.mega-highlight a,
1457
- body.toplevel_page_maxmegamenu .megamenu_header_top ul li.mega-highlight a {
1458
- color: white;
1459
- line-height: 30px;
1460
- padding: 0 10px; }
1461
-
1462
  body[class*='_page_maxmegamenu_'] .megamenu_wrap .megamenu_submit .saved,
1463
  body.toplevel_page_maxmegamenu .megamenu_wrap .megamenu_submit .saved {
1464
  background: transparent;
@@ -1485,9 +1613,9 @@ body.toplevel_page_maxmegamenu .megamenu_wrap .warning,
1485
  body.toplevel_page_maxmegamenu .megamenu_wrap .fail {
1486
  background: #fff;
1487
  border-left: 4px solid #46b450;
1488
- border-top: 1px solid #eee;
1489
- border-bottom: 1px solid #eee;
1490
- border-right: 1px solid #eee;
1491
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
1492
  padding: 10px;
1493
  margin: 5px 0 30px;
@@ -1548,23 +1676,27 @@ body.toplevel_page_maxmegamenu .block .mm-picker-container {
1548
 
1549
  body[class*='_page_maxmegamenu_'] .megamenu_right,
1550
  body.toplevel_page_maxmegamenu .megamenu_right {
1551
- margin-left: 190px;
1552
  padding: 20px;
1553
  box-sizing: border-box;
1554
- border-left: 1px solid #eee;
1555
  min-height: 400px; }
1556
- body[class*='_page_maxmegamenu_'] .megamenu_right .theme_selector,
1557
- body.toplevel_page_maxmegamenu .megamenu_right .theme_selector {
1558
- margin-bottom: 20px; }
1559
- body[class*='_page_maxmegamenu_'] .megamenu_right .theme_selector select,
1560
- body.toplevel_page_maxmegamenu .megamenu_right .theme_selector select {
1561
- max-width: 500px; }
 
1562
  body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper,
1563
  body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper {
1564
  margin: 0; }
1565
  body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper a.nav-tab,
1566
  body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper a.nav-tab {
1567
  cursor: pointer; }
 
 
 
 
1568
  body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper a.nav-tab-active,
1569
  body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper a.nav-tab-active {
1570
  background: white;
@@ -1578,9 +1710,23 @@ body.toplevel_page_maxmegamenu .megamenu_right {
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; }
@@ -1591,24 +1737,24 @@ body.toplevel_page_maxmegamenu .megamenu_right {
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%; }
@@ -1617,16 +1763,49 @@ body.toplevel_page_maxmegamenu .megamenu_right {
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;
@@ -1641,37 +1820,53 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1641
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_tools label {
1642
  clear: both;
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; }
@@ -1683,6 +1878,9 @@ body.toplevel_page_maxmegamenu .megamenu_right {
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; }
@@ -1711,6 +1909,15 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1711
  float: left;
1712
  margin-right: 10px;
1713
  margin-bottom: 10px; }
 
 
 
 
 
 
 
 
 
1714
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table textarea,
1715
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=text],
1716
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=number],
@@ -1719,7 +1926,7 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1719
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=text],
1720
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=number],
1721
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table select {
1722
- font-size: 0.9em;
1723
  min-height: 28px; }
1724
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table textarea,
1725
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table textarea {
@@ -1738,6 +1945,9 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1738
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=text],
1739
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=text] {
1740
  width: 70px; }
 
 
 
1741
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=submit],
1742
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=submit] {
1743
  width: auto; }
@@ -1780,7 +1990,7 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1780
  position: relative;
1781
  padding-bottom: 25px;
1782
  padding-top: 15px;
1783
- border-top: 1px solid #eee; }
1784
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-name,
1785
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-name {
1786
  width: 33%;
@@ -1834,9 +2044,14 @@ body.toplevel_page_maxmegamenu .megamenu_right {
1834
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-value .mega-description,
1835
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-name .mega-description,
1836
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-value .mega-description {
1837
- font-size: 0.9em;
1838
  color: #777;
1839
  line-height: 1.5em; }
 
 
 
 
 
1840
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table ul.custom_styling_tips,
1841
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table ul.custom_styling_tips {
1842
  list-style-type: disc;
@@ -2040,7 +2255,7 @@ body.toplevel_page_maxmegamenu .megamenu_right {
2040
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-toggle-disabled .mega-toggle_bar_height td:after,
2041
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-toggle-disabled .mega-mobile_menu_overlay td:after,
2042
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-toggle-disabled .mega-mobile_menu_force_width td:after {
2043
- background: #eee;
2044
  display: block;
2045
  position: absolute;
2046
  top: 0;
@@ -2055,7 +2270,7 @@ body.toplevel_page_maxmegamenu .megamenu_right {
2055
  display: table-row; }
2056
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings div.mega-tab-content.mega-mobile-disabled tr:not(.mega-responsive_breakpoint):not(.mega-responsive_breakpoint_disabled) td:after,
2057
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-mobile-disabled tr:not(.mega-responsive_breakpoint):not(.mega-responsive_breakpoint_disabled) td:after {
2058
- background: #eee;
2059
  display: block;
2060
  position: absolute;
2061
  top: 0;
@@ -2104,6 +2319,96 @@ body.toplevel_page_maxmegamenu .mega-delete {
2104
  margin-bottom: 15px;
2105
  cursor: pointer; }
2106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2107
  @keyframes "rotation" {
2108
  0% {
2109
  -webkit-transform: rotate(0deg);
@@ -2111,3 +2416,7 @@ body.toplevel_page_maxmegamenu .mega-delete {
2111
  100% {
2112
  -webkit-transform: rotate(359deg);
2113
  transform: rotate(359deg); } }
 
 
 
 
31
  .rtl.nav-menus-php .mega_menu_meta_box div table td:nth-child(2) {
32
  text-align: left; }
33
 
34
+ body[class*='_page_maxmegamenu_'] input.button-primary.is-busy,
35
+ body.toplevel_page_maxmegamenu input.button-primary.is-busy,
36
+ .nav-menus-php #cboxContent input.button-primary.is-busy {
37
+ pointer-events: none;
38
+ background-size: 100px 100% !important;
39
+ background-image: linear-gradient(-45deg, #007cba 28%, #006395 0, #006395 72%, #007cba 0) !important;
40
+ border-color: #007cba !important;
41
+ animation: busy-animation 2.5s linear infinite; }
42
+
43
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip],
44
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled],
45
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled],
46
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip],
47
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled],
48
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled],
49
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip],
50
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled],
51
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled] {
52
+ position: relative; }
53
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip].mega-enabled:before,
54
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled].mega-enabled:before,
55
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled].mega-enabled:before,
56
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip].mega-enabled:before,
57
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled].mega-enabled:before,
58
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled].mega-enabled:before,
59
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip].mega-enabled:before,
60
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled].mega-enabled:before,
61
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled].mega-enabled:before {
62
+ content: attr(data-tooltip-enabled); }
63
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip].mega-disabled:before,
64
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled].mega-disabled:before,
65
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled].mega-disabled:before,
66
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip].mega-disabled:before,
67
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled].mega-disabled:before,
68
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled].mega-disabled:before,
69
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip].mega-disabled:before,
70
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled].mega-disabled:before,
71
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled].mega-disabled:before {
72
+ content: attr(data-tooltip-disabled); }
73
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:before,
74
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:before,
75
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:before,
76
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:before,
77
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:before,
78
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:before,
79
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:before,
80
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:before,
81
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:before {
82
+ position: absolute;
83
+ content: attr(data-tooltip);
84
+ top: -32px;
85
+ background: #000;
86
+ color: #fff;
87
+ padding: 3px 0;
88
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
89
+ font-size: 10px;
90
+ font-weight: normal;
91
+ border-radius: 3px;
92
+ margin-left: -10px;
93
+ width: 160px;
94
+ z-index: 2; }
95
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:after,
96
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:after,
97
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:after,
98
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:after,
99
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:after,
100
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:after,
101
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:after,
102
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:after,
103
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:after {
104
+ top: -8px;
105
+ left: 8px;
106
+ border: solid transparent;
107
+ content: " ";
108
+ height: 0;
109
+ width: 0;
110
+ position: absolute;
111
+ border-color: transparent;
112
+ border-top-color: #000;
113
+ border-width: 4px;
114
+ margin-left: -4px; }
115
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:before, body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:after,
116
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:before,
117
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:after,
118
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:before,
119
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:after,
120
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:before,
121
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:after,
122
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:before,
123
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:after,
124
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:before,
125
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:after,
126
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:before,
127
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:after,
128
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:before,
129
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:after,
130
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:before,
131
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:after {
132
+ opacity: 0;
133
+ pointer-events: none;
134
+ text-align: center;
135
+ transition: all 0.3s;
136
+ transition-delay: 0.3s; }
137
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:focus:before, body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:focus:after, body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:hover:before, body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip]:hover:after,
138
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:focus:before,
139
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:focus:after,
140
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:hover:before,
141
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-enabled]:hover:after,
142
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:focus:before,
143
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:focus:after,
144
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:hover:before,
145
+ body[class*='_page_maxmegamenu_'] .mega-tooltip[data-tooltip-disabled]:hover:after,
146
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:focus:before,
147
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:focus:after,
148
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:hover:before,
149
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip]:hover:after,
150
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:focus:before,
151
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:focus:after,
152
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:hover:before,
153
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-enabled]:hover:after,
154
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:focus:before,
155
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:focus:after,
156
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:hover:before,
157
+ body.toplevel_page_maxmegamenu .mega-tooltip[data-tooltip-disabled]:hover:after,
158
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:focus:before,
159
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:focus:after,
160
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:hover:before,
161
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip]:hover:after,
162
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:focus:before,
163
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:focus:after,
164
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:hover:before,
165
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-enabled]:hover:after,
166
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:focus:before,
167
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:focus:after,
168
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:hover:before,
169
+ .nav-menus-php #cboxContent .mega-tooltip[data-tooltip-disabled]:hover:after {
170
+ opacity: 1; }
171
+
172
  .nav-menus-php #cboxOverlay {
173
  left: 160px; }
174
 
188
  margin: 10px 0 0 0; }
189
  .nav-menus-php #cboxContent .notice .notice-dismiss:focus {
190
  box-shadow: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  .nav-menus-php #cboxContent .mm_tabs li.mm_tab_horizontal {
192
  float: left;
 
193
  cursor: pointer;
194
+ font-size: 12px;
195
+ font-weight: normal;
196
  padding: 3px 5px;
197
+ border: 0;
198
+ margin: 0 15px 0 0;
199
+ background: white;
200
  color: #444;
201
+ border-radius: 3px;
202
+ background: #f7f7f7;
203
+ border: 1px solid #DFDFDF; }
204
+ .nav-menus-php #cboxContent .mm_tabs li.mm_tab_horizontal.active, .nav-menus-php #cboxContent .mm_tabs li.mm_tab_horizontal:hover {
205
  background: #0073aa;
206
+ border-color: #0073aa;
207
  color: white; }
 
 
 
208
  .nav-menus-php #cboxContent .mm_tabs.horizontal {
209
  width: 85%;
210
  float: left;
211
+ margin-top: 10px;
212
+ margin-bottom: 20px; }
213
  .nav-menus-php #cboxContent .filter_icons {
214
  width: 14%;
215
  float: right;
218
  .nav-menus-php #cboxContent .mm_header_container {
219
  float: left;
220
  width: 100%;
221
+ border-bottom: 1px solid #f1f1f1;
222
+ background: #f1f1f1; }
223
  .nav-menus-php #cboxContent .mm_header_container .mm_title {
224
  padding: 0 20px;
225
  font-size: 1.3em;
740
  float: left; }
741
  .nav-menus-php #cboxContent .mm_content.mega_menu #widgets .drop-area {
742
  display: block;
743
+ border: 1px solid #f1f1f1;
744
  float: left;
745
  -webkit-box-sizing: border-box;
746
  -moz-box-sizing: border-box;
1148
  font-size: 0.9em;
1149
  color: #999;
1150
  line-height: 1.5em; }
1151
+ .nav-menus-php #cboxContent table td.mega-name .mega-description p {
1152
+ font-size: 0.9em; }
1153
  .nav-menus-php #cboxContent table td.mega-value {
1154
  font-size: 12px; }
1155
  .nav-menus-php #cboxContent table td.mega-value select {
1172
  line-height: 1.5em;
1173
  text-indent: 2px;
1174
  margin-top: 5px; }
1175
+ .nav-menus-php #cboxContent table td.mega-value .mega-description p {
1176
+ font-size: 0.9em; }
1177
  .nav-menus-php #cboxContent table .mega-menu-item-align td.mega-value select {
1178
  float: left; }
1179
  .nav-menus-php #cboxContent table .mega-menu-item-align td.mega-value .mega-description {
1197
  margin-right: 10px;
1198
  vertical-align: middle; }
1199
  .nav-menus-php #cboxContent .general_settings table td {
1200
+ padding-bottom: 3px; }
1201
  .nav-menus-php #cboxContent form > h4.first {
1202
  margin: 0em 0 0.7em 0; }
1203
  .nav-menus-php #cboxContent form > h4 {
1284
 
1285
  .nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content {
1286
  padding: 0 10px; }
1287
+ .nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content .mega-accordion {
1288
+ float: left;
1289
+ width: 100%; }
1290
+ .nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content .mega-accordion-title {
1291
+ margin-bottom: 10px; }
1292
  .nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content h4 {
1293
  outline: none;
1294
  float: left;
 
1295
  border: 0;
1296
+ margin: 0;
1297
+ padding: 0;
1298
  white-space: nowrap;
1299
  overflow: hidden;
1300
  text-overflow: ellipsis; }
1301
  .nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content h4 .dashicons {
1302
  margin-right: 6px; }
 
 
 
 
 
 
 
 
 
 
1303
  .nav-menus-php #nav-menu-meta .mega_menu_meta_box div.accordion-section-content table {
1304
  font-size: 0.9em;
1305
  width: 100%;
1416
  -webkit-font-smoothing: antialiased;
1417
  -moz-osx-font-smoothing: grayscale; }
1418
 
1419
+ body[class*='_page_maxmegamenu_'] .megamenu_header_top,
1420
+ body.toplevel_page_maxmegamenu .megamenu_header_top {
1421
+ font-size: 0.9em;
1422
+ display: block;
1423
+ width: 100%;
1424
+ height: 30px;
1425
+ line-height: 30px;
1426
+ margin-bottom: 10px;
1427
+ box-sizing: border-box; }
1428
+ body[class*='_page_maxmegamenu_'] .megamenu_header_top ul,
1429
+ body.toplevel_page_maxmegamenu .megamenu_header_top ul {
1430
+ margin: 0;
1431
+ float: right;
1432
+ position: relative; }
1433
+ body[class*='_page_maxmegamenu_'] .megamenu_header_top ul li,
1434
+ body.toplevel_page_maxmegamenu .megamenu_header_top ul li {
1435
+ display: inline-block;
1436
+ margin: 0 0 0 14px;
1437
+ line-height: 30px; }
1438
+ body[class*='_page_maxmegamenu_'] .megamenu_header_top ul li.mega-highlight,
1439
+ body.toplevel_page_maxmegamenu .megamenu_header_top ul li.mega-highlight {
1440
+ background: #35b1df;
1441
+ border-radius: 5px; }
1442
+ body[class*='_page_maxmegamenu_'] .megamenu_header_top ul li.mega-highlight a,
1443
+ body.toplevel_page_maxmegamenu .megamenu_header_top ul li.mega-highlight a {
1444
+ color: white;
1445
+ line-height: 30px;
1446
+ padding: 0 10px; }
1447
+
1448
+ body[class*='_page_maxmegamenu_'] .megamenu_header,
1449
+ body.toplevel_page_maxmegamenu .megamenu_header {
1450
+ background: white;
1451
+ padding: 10px 17px;
1452
+ border-bottom: 1px solid #f1f1f1;
1453
+ float: left;
1454
+ width: 100%;
1455
+ box-sizing: border-box; }
1456
+ body[class*='_page_maxmegamenu_'] .megamenu_header .version,
1457
+ body.toplevel_page_maxmegamenu .megamenu_header .version {
1458
+ color: #999;
1459
+ margin-bottom: 15px;
1460
+ font-size: 12px; }
1461
+ @media only screen and (max-width: 1200px) {
1462
+ body[class*='_page_maxmegamenu_'] .megamenu_header,
1463
+ body.toplevel_page_maxmegamenu .megamenu_header {
1464
+ text-align: center;
1465
+ border-bottom: 0; } }
1466
+
1467
  body[class*='_page_maxmegamenu_'] .megamenu_wrap,
1468
  body.toplevel_page_maxmegamenu .megamenu_wrap {
1469
  width: 100%;
1470
  float: left;
1471
+ display: flex;
1472
+ flex-wrap: wrap;
1473
  background: white; }
1474
+ @media only screen and (max-width: 1200px) {
1475
+ body[class*='_page_maxmegamenu_'] .megamenu_wrap,
1476
+ body.toplevel_page_maxmegamenu .megamenu_wrap {
1477
+ flex-direction: column; } }
1478
 
1479
  body[class*='_page_maxmegamenu_'] .megamenu_left,
1480
  body.toplevel_page_maxmegamenu .megamenu_left {
1481
+ flex-basis: 190px;
1482
+ flex-grow: 1; }
1483
+ @media only screen and (max-width: 1200px) {
1484
+ body[class*='_page_maxmegamenu_'] .megamenu_left,
1485
+ body.toplevel_page_maxmegamenu .megamenu_left {
1486
+ flex-basis: auto;
1487
+ border-bottom: 0;
1488
+ margin-bottom: 20px; } }
1489
+ @media only screen and (max-width: 1200px) {
1490
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation,
1491
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation {
1492
+ text-align: center;
1493
+ margin: 0; } }
1494
+ @media only screen and (max-width: 1200px) {
1495
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li,
1496
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li {
1497
+ display: inline-flex;
1498
+ margin-bottom: 0; } }
1499
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li a,
1500
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li a {
1501
  text-decoration: none;
1502
  color: #444;
1503
  width: 100%;
1506
  box-sizing: border-box;
1507
  border-left: 2px solid white;
1508
  outline: 0; }
1509
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li a:hover, body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li a.active,
1510
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li a:hover,
1511
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li a.active {
1512
+ border-left: 2px solid #0073aa;
1513
+ color: #0074a2; }
1514
+ @media only screen and (max-width: 1200px) {
1515
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li a,
1516
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li a {
1517
+ border-left: 0;
1518
+ padding: 1rem;
1519
+ margin: 0;
1520
+ margin-left: 1rem;
1521
+ margin-right: 1rem; }
1522
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li a.active,
1523
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li a.active {
1524
+ border-left: 0;
1525
+ box-shadow: inset 0 -3px #0073aa;
1526
+ font-weight: 600; }
1527
+ body[class*='_page_maxmegamenu_'] .megamenu_left ul.mega-page-navigation li a:hover,
1528
+ body.toplevel_page_maxmegamenu .megamenu_left ul.mega-page-navigation li a:hover {
1529
+ border-left: 0; } }
1530
+
1531
+ body[class*='_page_maxmegamenu_'] .megamenu_right,
1532
+ body.toplevel_page_maxmegamenu .megamenu_right {
1533
+ flex-basis: 0;
1534
+ flex-grow: 999; }
1535
+ @media only screen and (max-width: 1200px) {
1536
+ body[class*='_page_maxmegamenu_'] .megamenu_right,
1537
+ body.toplevel_page_maxmegamenu .megamenu_right {
1538
+ flex-basis: auto; } }
1539
 
1540
  body[class*='_page_maxmegamenu_'] h3.first,
1541
  body.toplevel_page_maxmegamenu h3.first {
1587
  body.toplevel_page_maxmegamenu .megamenu_submit .mega_right a {
1588
  color: #D0011B; }
1589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1590
  body[class*='_page_maxmegamenu_'] .megamenu_wrap .megamenu_submit .saved,
1591
  body.toplevel_page_maxmegamenu .megamenu_wrap .megamenu_submit .saved {
1592
  background: transparent;
1613
  body.toplevel_page_maxmegamenu .megamenu_wrap .fail {
1614
  background: #fff;
1615
  border-left: 4px solid #46b450;
1616
+ border-top: 1px solid #DFDFDF;
1617
+ border-bottom: 1px solid #DFDFDF;
1618
+ border-right: 1px solid #DFDFDF;
1619
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
1620
  padding: 10px;
1621
  margin: 5px 0 30px;
1676
 
1677
  body[class*='_page_maxmegamenu_'] .megamenu_right,
1678
  body.toplevel_page_maxmegamenu .megamenu_right {
 
1679
  padding: 20px;
1680
  box-sizing: border-box;
1681
+ border-left: 1px solid #f1f1f1;
1682
  min-height: 400px; }
1683
+ body[class*='_page_maxmegamenu_'] .megamenu_right textarea.mega-export,
1684
+ body.toplevel_page_maxmegamenu .megamenu_right textarea.mega-export {
1685
+ width: 100%;
1686
+ height: 150px;
1687
+ font-family: monospace;
1688
+ margin-bottom: 10px;
1689
+ font-size: 0.9em; }
1690
  body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper,
1691
  body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper {
1692
  margin: 0; }
1693
  body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper a.nav-tab,
1694
  body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper a.nav-tab {
1695
  cursor: pointer; }
1696
+ @media only screen and (max-width: 1200px) {
1697
+ body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper a.nav-tab,
1698
+ body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper a.nav-tab {
1699
+ font-size: 12px; } }
1700
  body[class*='_page_maxmegamenu_'] .megamenu_right h2.nav-tab-wrapper a.nav-tab-active,
1701
  body.toplevel_page_maxmegamenu .megamenu_right h2.nav-tab-wrapper a.nav-tab-active {
1702
  background: white;
1710
  border: 0;
1711
  float: left;
1712
  width: 100%; }
1713
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings .mega-tooltip:before,
1714
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings .mega-tooltip:before {
1715
+ top: -29px;
1716
+ margin-left: -5px; }
1717
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings .mega-tooltip:after,
1718
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings .mega-tooltip:after {
1719
+ margin-left: 2px; }
1720
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_general_settings .mega-inner-table,
1721
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_general_settings .mega-inner-table {
1722
+ width: auto; }
1723
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_general_settings .mega-inner-table td,
1724
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_general_settings .mega-inner-table td {
1725
+ padding-top: 3px;
1726
+ padding-bottom: 3px; }
1727
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-add-location,
1728
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-add-location {
1729
+ margin-top: 20px; }
1730
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations div.mega-tab-content,
1731
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations div.mega-tab-content {
1732
  border: 0; }
1737
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active,
1738
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab,
1739
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active {
1740
+ font-size: 12px;
1741
  font-weight: normal;
1742
  padding: 3px 5px;
1743
  border: 0;
1744
+ margin: 0 15px 0 0;
1745
  background: white;
1746
  color: #444;
1747
+ border-radius: 3px;
1748
+ background: #f7f7f7;
1749
+ border: 1px solid #DFDFDF; }
1750
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active,
1751
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .nav-tab-wrapper a.nav-tab-active {
1752
  background: #0073aa;
1753
+ border-color: #0073aa;
1754
  color: white; }
1755
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table td,
1756
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table td {
1757
  padding-bottom: 0; }
 
 
 
1758
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table.output_options td.mega-value textarea,
1759
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table.output_options td.mega-value textarea {
1760
  width: 100%; }
1763
  float: none; }
1764
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations table.sticky_settings tr td:first-child,
1765
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations table.sticky_settings tr td:first-child {
1766
+ width: 40%; }
1767
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td:first-child,
1768
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td:first-child {
1769
+ width: 40%;
1770
+ font-size: 13px; }
1771
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td:first-child .mega-description,
1772
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td:first-child .mega-description {
1773
+ margin-top: 0; }
1774
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td:first-child .dashicons,
1775
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-tab-content table td:first-child .dashicons {
1776
+ margin-right: 6px;
1777
+ font-size: 14px;
1778
+ vertical-align: middle; }
1779
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-vartical-align-top,
1780
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-vartical-align-top {
1781
+ vertical-align: top; }
1782
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .megamenu_submit,
1783
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .megamenu_submit {
1784
  margin-bottom: 0; }
1785
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes .theme_selector,
1786
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes .theme_selector {
1787
+ margin-bottom: 20px;
1788
+ float: left;
1789
+ font-size: 12px; }
1790
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes .theme_selector select,
1791
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes .theme_selector select {
1792
+ max-width: 500px; }
1793
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis,
1794
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis {
1795
+ float: left;
1796
+ height: 30px;
1797
+ margin-left: 6px; }
1798
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis svg,
1799
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis svg {
1800
+ height: 30px;
1801
+ border: 1px solid #7e8993;
1802
+ border-radius: 3px;
1803
+ box-sizing: border-box; }
1804
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis .mega-export-theme .dashicons,
1805
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis .mega-import-theme .dashicons,
1806
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis .mega-export-theme .dashicons,
1807
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes .mega-ellipsis .mega-import-theme .dashicons {
1808
+ transform: rotate(90deg); }
1809
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_themes td.mega-name,
1810
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_themes td.mega-name {
1811
  padding-left: 10px;
1820
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_tools label {
1821
  clear: both;
1822
  width: 100%; }
1823
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location-disabled-assign-menu .mega-accordion-content,
1824
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location-disabled-assign-menu .mega-accordion-content {
1825
+ padding: 10px 20px; }
1826
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location,
1827
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location {
1828
  font-size: 14px;
1829
+ border: 0;
1830
+ border: 1px solid #DFDFDF;
1831
+ margin-bottom: 10px;
1832
+ float: left;
1833
+ width: 100%; }
1834
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title.mega-accordion-open,
1835
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title:hover,
1836
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title.mega-accordion-open,
1837
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title:hover {
1838
+ background: #f7f7f7; }
1839
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title,
1840
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title {
1841
+ padding: 8px;
 
 
 
 
 
 
 
 
 
 
 
1842
  font-size: 0.9em; }
1843
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title .dashicons-yes,
1844
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-title .dashicons-yes {
1845
+ color: transparent;
1846
+ display: none; }
1847
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location.mega-location-enabled .mega-accordion-title .dashicons-yes,
1848
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location.mega-location-enabled .mega-accordion-title .dashicons-yes {
1849
+ color: #46b450;
1850
+ margin-left: 4px;
1851
+ display: inline-block; }
1852
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location.mega-location-enabled.mega-has-active-location .mega-accordion-title .dashicons-yes,
1853
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location.mega-location-enabled.mega-has-active-location .mega-accordion-title .dashicons-yes {
1854
+ color: #F56E28; }
1855
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-content,
1856
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-content {
1857
+ border-top: 1px solid #DFDFDF; }
1858
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-content .megamenu_submit,
1859
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-content .megamenu_submit {
1860
+ background: #f7f7f7;
1861
+ padding: 20px 10px;
1862
+ margin-top: 20px;
1863
+ box-sizing: border-box; }
1864
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-content .mega-accordion-content-wrapper,
1865
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .mega-location .mega-accordion-content .mega-accordion-content-wrapper {
1866
+ padding: 10px 15px;
1867
+ float: left;
1868
+ width: 100%;
1869
+ box-sizing: border-box; }
1870
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations .warning,
1871
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations .warning {
1872
  margin: 10px; }
1878
  height: 40px;
1879
  width: 500px;
1880
  padding: 10px; }
1881
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations > table td:first-child,
1882
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations > table td:first-child {
1883
+ width: 25%; }
1884
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings.menu_settings_menu_locations h5,
1885
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings.menu_settings_menu_locations h5 {
1886
  font-size: 12px; }
1909
  float: left;
1910
  margin-right: 10px;
1911
  margin-bottom: 10px; }
1912
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table .mega-radio-row,
1913
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table .mega-radio-row {
1914
+ margin-bottom: 3px; }
1915
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table .mega-radio-row label,
1916
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table .mega-radio-row label {
1917
+ float: none;
1918
+ top: -3px;
1919
+ position: relative;
1920
+ font-size: 1em; }
1921
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table textarea,
1922
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=text],
1923
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=number],
1926
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=text],
1927
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=number],
1928
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table select {
1929
+ font-size: 11px;
1930
  min-height: 28px; }
1931
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table textarea,
1932
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table textarea {
1945
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=text],
1946
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=text] {
1947
  width: 70px; }
1948
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=text].wide,
1949
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=text].wide {
1950
+ width: 300px; }
1951
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table input[type=submit],
1952
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table input[type=submit] {
1953
  width: auto; }
1990
  position: relative;
1991
  padding-bottom: 25px;
1992
  padding-top: 15px;
1993
+ border-top: 1px solid #DFDFDF; }
1994
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-name,
1995
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-name {
1996
  width: 33%;
2044
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-value .mega-description,
2045
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-name .mega-description,
2046
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-value .mega-description {
2047
+ font-size: 12px;
2048
  color: #777;
2049
  line-height: 1.5em; }
2050
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-name .mega-description p,
2051
+ body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table td.mega-value .mega-description p,
2052
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-name .mega-description p,
2053
+ body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table td.mega-value .mega-description p {
2054
+ font-size: 12px; }
2055
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings table ul.custom_styling_tips,
2056
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings table ul.custom_styling_tips {
2057
  list-style-type: disc;
2255
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-toggle-disabled .mega-toggle_bar_height td:after,
2256
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-toggle-disabled .mega-mobile_menu_overlay td:after,
2257
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-toggle-disabled .mega-mobile_menu_force_width td:after {
2258
+ background: #f1f1f1;
2259
  display: block;
2260
  position: absolute;
2261
  top: 0;
2270
  display: table-row; }
2271
  body[class*='_page_maxmegamenu_'] .megamenu_right .menu_settings div.mega-tab-content.mega-mobile-disabled tr:not(.mega-responsive_breakpoint):not(.mega-responsive_breakpoint_disabled) td:after,
2272
  body.toplevel_page_maxmegamenu .megamenu_right .menu_settings div.mega-tab-content.mega-mobile-disabled tr:not(.mega-responsive_breakpoint):not(.mega-responsive_breakpoint_disabled) td:after {
2273
+ background: #f1f1f1;
2274
  display: block;
2275
  position: absolute;
2276
  top: 0;
2319
  margin-bottom: 15px;
2320
  cursor: pointer; }
2321
 
2322
+ .mega-accordion-title {
2323
+ transition: all .1s ease-in;
2324
+ margin: 0;
2325
+ color: #444;
2326
+ cursor: pointer;
2327
+ float: left;
2328
+ width: 100%;
2329
+ box-sizing: border-box;
2330
+ line-height: 24px; }
2331
+ .mega-accordion-title h4 {
2332
+ display: inline; }
2333
+ .mega-accordion-title .dashicons {
2334
+ font-size: 18px;
2335
+ vertical-align: middle;
2336
+ margin-right: 6px;
2337
+ transition: none; }
2338
+ .mega-accordion-title.mega-accordion-open + .mega-accordion-content {
2339
+ display: block; }
2340
+
2341
+ .mega-ellipsis {
2342
+ float: right;
2343
+ position: relative;
2344
+ height: 26px; }
2345
+ .mega-ellipsis svg {
2346
+ cursor: pointer;
2347
+ fill: black;
2348
+ height: 26px;
2349
+ width: 26px; }
2350
+ .mega-ellipsis.mega-ellipsis-open ul.mega-ellipsis-content {
2351
+ display: block; }
2352
+ .mega-ellipsis ul.mega-ellipsis-content {
2353
+ display: none;
2354
+ position: absolute;
2355
+ width: 170px;
2356
+ background: white;
2357
+ left: -141px;
2358
+ top: 33px;
2359
+ z-index: 9;
2360
+ border: 1px solid #999;
2361
+ margin: 0;
2362
+ box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
2363
+ border-radius: 3px; }
2364
+ .mega-ellipsis ul.mega-ellipsis-content:after {
2365
+ top: -14px;
2366
+ right: 10px;
2367
+ left: auto;
2368
+ border: 7px solid transparent;
2369
+ border-bottom-color: #fff;
2370
+ position: absolute;
2371
+ display: inline-block;
2372
+ content: ""; }
2373
+ .mega-ellipsis ul.mega-ellipsis-content:before {
2374
+ top: -16px;
2375
+ right: 9px;
2376
+ left: auto;
2377
+ border: 8px solid transparent;
2378
+ border-bottom-color: #999;
2379
+ position: absolute;
2380
+ display: inline-block;
2381
+ content: ""; }
2382
+ .mega-ellipsis ul.mega-ellipsis-content li {
2383
+ font-size: 12px;
2384
+ margin-bottom: 0; }
2385
+ .mega-ellipsis ul.mega-ellipsis-content li a {
2386
+ display: block;
2387
+ text-decoration: none;
2388
+ line-height: 40px;
2389
+ padding-left: 10px;
2390
+ color: #444;
2391
+ transition: all 0.2s; }
2392
+ .mega-ellipsis ul.mega-ellipsis-content li a:hover {
2393
+ background: #f7f7f7;
2394
+ color: #0073aa; }
2395
+ .mega-ellipsis ul.mega-ellipsis-content li a .dashicons {
2396
+ font-size: 18px;
2397
+ vertical-align: middle;
2398
+ margin-right: 6px;
2399
+ transition: none; }
2400
+
2401
+ .mega-accordion-content {
2402
+ display: none;
2403
+ float: left;
2404
+ width: 100%;
2405
+ box-sizing: border-box; }
2406
+
2407
+ .mega-warning {
2408
+ padding: 10px 0; }
2409
+ .mega-warning .dashicons {
2410
+ margin-right: 6px; }
2411
+
2412
  @keyframes "rotation" {
2413
  0% {
2414
  -webkit-transform: rotate(0deg);
2416
  100% {
2417
  -webkit-transform: rotate(359deg);
2418
  transform: rotate(359deg); } }
2419
+
2420
+ @keyframes busy-animation {
2421
+ 0% {
2422
+ background-position: 200px 0; } }
css/admin/admin.scss CHANGED
@@ -1,6 +1,6 @@
1
  $light_blue: #0073aa;
2
  $light_grey: #f7f7f7;
3
- $mid_grey: #eee;
4
  $grey: #DFDFDF;
5
  $dark_grey: #999;
6
  $text_grey: #444;
@@ -11,6 +11,12 @@ $orange: #ffb900;
11
  $green: #46b450;
12
  $header_height: 75px;
13
 
 
 
 
 
 
 
14
  .rtl.nav-menus-php {
15
  .mm_launch {
16
  margin-left: 0;
@@ -49,6 +55,79 @@ $header_height: 75px;
49
  }
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  .nav-menus-php {
53
  #cboxOverlay {
54
  left: 160px;
@@ -81,90 +160,34 @@ $header_height: 75px;
81
  }
82
  }
83
 
84
- .mega-tooltip {
85
- position: relative;
86
-
87
-
88
- &.mega-enabled:before {
89
- content: attr(data-tooltip-enabled);
90
- }
91
-
92
- &.mega-disabled:before {
93
- content: attr(data-tooltip-disabled);
94
- }
95
-
96
- &:before {
97
- position: absolute;
98
- content: attr(data-tooltip);
99
- top: -32px;
100
- background: $black;
101
- color: $white;
102
- padding: 3px 0;
103
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
104
- font-size: 10px;
105
- border-radius: 3px;
106
- margin-left: -10px;
107
- width: 160px;
108
- z-index: 2;
109
- }
110
-
111
- &:after {
112
- top: -8px;
113
- left: 8px;
114
- border: solid transparent;
115
- content: " ";
116
- height: 0;
117
- width: 0;
118
- position: absolute;
119
- border-color: transparent;
120
- border-top-color: $black;
121
- border-width: 4px;
122
- margin-left: -4px;
123
- }
124
-
125
- &:before,
126
- &:after {
127
- opacity: 0;
128
- pointer-events: none;
129
- text-align: center;
130
- transition: all 0.3s;
131
- transition-delay: 0.3s;
132
- }
133
-
134
- &:focus:before,
135
- &:focus:after,
136
- &:hover:before,
137
- &:hover:after {
138
- opacity: 1;
139
- }
140
-
141
- }
142
-
143
  .mm_tabs {
144
  li.mm_tab_horizontal {
145
  float: left;
146
- margin-right: 10px;
147
  cursor: pointer;
 
 
148
  padding: 3px 5px;
149
- font-size: 0.9em;
150
- color: $text_grey;
151
- transition: all 0.05s linear;
 
 
 
 
152
 
 
153
  &:hover {
154
  background: $light_blue;
 
155
  color: white;
156
  }
157
  }
158
 
159
- li.mm_tab_horizontal.active {
160
- background: $light_blue;
161
- color: white;
162
- }
163
-
164
  &.horizontal {
165
  width: 85%;
166
  float: left;
167
- margin-top: 0;
 
168
  }
169
  }
170
 
@@ -1180,6 +1203,10 @@ $header_height: 75px;
1180
  font-size: 0.9em;
1181
  color: $dark_grey;
1182
  line-height: 1.5em;
 
 
 
 
1183
  }
1184
  }
1185
 
@@ -1210,6 +1237,10 @@ $header_height: 75px;
1210
  line-height: 1.5em;
1211
  text-indent: 2px;
1212
  margin-top: 5px;
 
 
 
 
1213
  }
1214
  }
1215
 
@@ -1261,7 +1292,7 @@ $header_height: 75px;
1261
  .general_settings {
1262
  table {
1263
  td {
1264
- padding-bottom: 5px;
1265
  }
1266
  }
1267
  }
@@ -1270,7 +1301,7 @@ $header_height: 75px;
1270
  > h4.first {
1271
  margin: 0em 0 0.7em 0;
1272
  }
1273
- >h4 {
1274
  clear: both;
1275
  border-bottom: 1px solid $grey;
1276
  padding: 0 0 10px 0;
@@ -1280,10 +1311,10 @@ $header_height: 75px;
1280
  }
1281
 
1282
  .mm_content {
1283
- >h4.first {
1284
  margin: 0em 0 0.7em 0;
1285
  }
1286
- >h4 {
1287
  clear: both;
1288
  border-bottom: 1px solid $grey;
1289
  padding: 0 0 10px 0;
@@ -1390,13 +1421,21 @@ $header_height: 75px;
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;
@@ -1406,22 +1445,6 @@ $header_height: 75px;
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%;
@@ -1575,60 +1598,139 @@ body.toplevel_page_maxmegamenu {
1575
  -moz-osx-font-smoothing: grayscale;
1576
  }
1577
 
1578
- .megamenu_wrap {
 
 
1579
  width: 100%;
1580
- float: left;
1581
- background: white;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1582
  }
1583
 
1584
- .megamenu_left {
 
 
 
1585
  float: left;
1586
- width: 190px;
1587
- margin-left: -100%;
1588
 
1589
- ul li a:hover,
1590
- ul li a.active {
1591
- border-left: 2px solid #0074a2;
1592
- color: #0074a2;
1593
  }
1594
 
1595
- ul li a {
1596
- text-decoration: none;
1597
- color: $text_grey;
1598
- width: 100%;
1599
- display: block;
1600
- padding: 5px 0px 5px 17px;
1601
- box-sizing: border-box;
1602
- border-left: 2px solid white;
1603
- outline: 0;
1604
  }
 
 
 
 
 
 
 
 
1605
 
1606
- ul li.error {
1607
- border-left: 3px solid $red;
1608
  }
 
 
1609
 
1610
- ul li.mega_active {
1611
- font-weight: bold;
 
 
 
 
 
 
1612
  }
1613
 
1614
- ul li.mega_active a:after {
1615
- right: 0;
1616
- content: '\f139';
1617
- border: 0;
1618
- background: 0 0;
1619
- font: 400 20px/1 dashicons;
1620
- speak: none;
1621
- float: right;
1622
- padding: 0;
1623
- text-indent: 0;
1624
- text-align: center;
1625
- position: relative;
1626
- -webkit-font-smoothing: antialiased;
1627
- -moz-osx-font-smoothing: grayscale;
1628
- text-decoration: none!important;
1629
- margin-right: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1630
  }
 
 
 
 
 
1631
 
 
 
 
1632
  }
1633
 
1634
  h3.first {
@@ -1685,53 +1787,9 @@ body.toplevel_page_maxmegamenu {
1685
  }
1686
  }
1687
 
1688
- .megamenu_header {
1689
- background: white;
1690
- padding: 10px 17px;
1691
- border-bottom: 1px solid $mid_grey;
1692
- float: left;
1693
- width: 100%;
1694
- box-sizing: border-box;
1695
 
1696
- .version {
1697
- font-style: italic;
1698
- color: $dark_grey;
1699
- margin-bottom: 15px;
1700
- }
1701
- }
1702
 
1703
- .megamenu_header_top {
1704
- font-size: 0.9em;
1705
- display: block;
1706
- width: 100%;
1707
- height: 30px;
1708
- line-height: 30px;
1709
- margin-bottom: 10px;
1710
- box-sizing: border-box;
1711
 
1712
- ul {
1713
- margin: 0;
1714
- float: right;
1715
- position: relative;
1716
-
1717
- li {
1718
- display: inline-block;
1719
- margin: 0 0 0 14px;
1720
- line-height: 30px;
1721
-
1722
- &.mega-highlight {
1723
- background: #35b1df;
1724
- border-radius: 5px;
1725
-
1726
- a {
1727
- color: white;
1728
- line-height: 30px;
1729
- padding: 0 10px;
1730
- }
1731
- }
1732
- }
1733
- }
1734
- }
1735
 
1736
  .megamenu_wrap .megamenu_submit .saved {
1737
  background: transparent;
@@ -1756,9 +1814,9 @@ body.toplevel_page_maxmegamenu {
1756
  .megamenu_wrap .fail {
1757
  background: $white;
1758
  border-left: 4px solid $green;
1759
- border-top: 1px solid $mid_grey;
1760
- border-bottom: 1px solid $mid_grey;
1761
- border-right: 1px solid $mid_grey;
1762
  box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
1763
  padding: 10px;
1764
  margin: 5px 0 30px;
@@ -1823,18 +1881,17 @@ body.toplevel_page_maxmegamenu {
1823
  }
1824
 
1825
  .megamenu_right {
1826
- margin-left: 190px;
1827
  padding: 20px;
1828
  box-sizing: border-box;
1829
  border-left: 1px solid $mid_grey;
1830
  min-height: 400px;
1831
 
1832
- .theme_selector {
1833
- margin-bottom: 20px;
1834
-
1835
- select {
1836
- max-width: 500px;
1837
- }
1838
  }
1839
 
1840
  h2.nav-tab-wrapper {
@@ -1842,6 +1899,10 @@ body.toplevel_page_maxmegamenu {
1842
 
1843
  a.nav-tab {
1844
  cursor: pointer;
 
 
 
 
1845
  }
1846
 
1847
  a.nav-tab-active {
@@ -1862,10 +1923,32 @@ body.toplevel_page_maxmegamenu {
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;
@@ -1875,28 +1958,27 @@ body.toplevel_page_maxmegamenu {
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 {
@@ -1909,23 +1991,62 @@ body.toplevel_page_maxmegamenu {
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 {
1930
  padding-left: 10px;
1931
  font-size: 14px;
@@ -1948,44 +2069,61 @@ body.toplevel_page_maxmegamenu {
1948
 
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
  }
@@ -2005,6 +2143,10 @@ body.toplevel_page_maxmegamenu {
2005
  padding: 10px;
2006
  }
2007
 
 
 
 
 
2008
  h5 {
2009
  font-size: 12px;
2010
  }
@@ -2039,12 +2181,22 @@ body.toplevel_page_maxmegamenu {
2039
  margin-bottom: 10px;
2040
  }
2041
 
 
 
 
 
 
 
 
 
 
 
2042
 
2043
  textarea,
2044
  input[type=text],
2045
  input[type=number],
2046
  select {
2047
- font-size: 0.9em;
2048
  min-height: 28px;
2049
  }
2050
 
@@ -2069,6 +2221,10 @@ body.toplevel_page_maxmegamenu {
2069
  width: 70px;
2070
  }
2071
 
 
 
 
 
2072
  input[type=submit] {
2073
  width: auto;
2074
  }
@@ -2118,7 +2274,7 @@ body.toplevel_page_maxmegamenu {
2118
  position: relative;
2119
  padding-bottom: 25px;
2120
  padding-top: 15px;
2121
- border-top: 1px solid $mid_grey;
2122
 
2123
  &.mega-name {
2124
  width: 33%;
@@ -2182,9 +2338,13 @@ body.toplevel_page_maxmegamenu {
2182
 
2183
  td.mega-name .mega-description,
2184
  td.mega-value .mega-description {
2185
- font-size: 0.9em;
2186
  color: #777;
2187
  line-height: 1.5em;
 
 
 
 
2188
  }
2189
 
2190
  ul.custom_styling_tips {
@@ -2494,6 +2654,128 @@ body.toplevel_page_maxmegamenu {
2494
 
2495
  }
2496
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2497
  @keyframes "rotation" {
2498
  0% {
2499
  -webkit-transform: rotate(0deg);
@@ -2503,4 +2785,9 @@ body.toplevel_page_maxmegamenu {
2503
  -webkit-transform: rotate(359deg);
2504
  transform: rotate(359deg);
2505
  }
2506
- }
 
 
 
 
 
1
  $light_blue: #0073aa;
2
  $light_grey: #f7f7f7;
3
+ $mid_grey: #f1f1f1;
4
  $grey: #DFDFDF;
5
  $dark_grey: #999;
6
  $text_grey: #444;
11
  $green: #46b450;
12
  $header_height: 75px;
13
 
14
+ @mixin tablet {
15
+ @media only screen and (max-width : 1200px) {
16
+ @content;
17
+ }
18
+ }
19
+
20
  .rtl.nav-menus-php {
21
  .mm_launch {
22
  margin-left: 0;
55
  }
56
  }
57
 
58
+ body[class*='_page_maxmegamenu_'],
59
+ body.toplevel_page_maxmegamenu,
60
+ .nav-menus-php #cboxContent {
61
+ input.button-primary.is-busy {
62
+ pointer-events: none;
63
+ background-size: 100px 100% !important;
64
+ background-image: linear-gradient(-45deg,#007cba 28%,#006395 0,#006395 72%,#007cba 0) !important;
65
+ border-color: #007cba !important;
66
+ animation: busy-animation 2.5s linear infinite;
67
+ }
68
+
69
+ .mega-tooltip[data-tooltip],
70
+ .mega-tooltip[data-tooltip-enabled],
71
+ .mega-tooltip[data-tooltip-disabled] {
72
+ position: relative;
73
+
74
+ &.mega-enabled:before {
75
+ content: attr(data-tooltip-enabled);
76
+ }
77
+
78
+ &.mega-disabled:before {
79
+ content: attr(data-tooltip-disabled);
80
+ }
81
+
82
+ &:before {
83
+ position: absolute;
84
+ content: attr(data-tooltip);
85
+ top: -32px;
86
+ background: $black;
87
+ color: $white;
88
+ padding: 3px 0;
89
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
90
+ font-size: 10px;
91
+ font-weight: normal;
92
+ border-radius: 3px;
93
+ margin-left: -10px;
94
+ width: 160px;
95
+ z-index: 2;
96
+ }
97
+
98
+ &:after {
99
+ top: -8px;
100
+ left: 8px;
101
+ border: solid transparent;
102
+ content: " ";
103
+ height: 0;
104
+ width: 0;
105
+ position: absolute;
106
+ border-color: transparent;
107
+ border-top-color: $black;
108
+ border-width: 4px;
109
+ margin-left: -4px;
110
+ }
111
+
112
+ &:before,
113
+ &:after {
114
+ opacity: 0;
115
+ pointer-events: none;
116
+ text-align: center;
117
+ transition: all 0.3s;
118
+ transition-delay: 0.3s;
119
+ }
120
+
121
+ &:focus:before,
122
+ &:focus:after,
123
+ &:hover:before,
124
+ &:hover:after {
125
+ opacity: 1;
126
+ }
127
+
128
+ }
129
+ }
130
+
131
  .nav-menus-php {
132
  #cboxOverlay {
133
  left: 160px;
160
  }
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  .mm_tabs {
164
  li.mm_tab_horizontal {
165
  float: left;
 
166
  cursor: pointer;
167
+ font-size: 12px;
168
+ font-weight: normal;
169
  padding: 3px 5px;
170
+ border: 0;
171
+ margin: 0 15px 0 0;
172
+ background: white;
173
+ color: #444;
174
+ border-radius: 3px;
175
+ background: #f7f7f7;
176
+ border: 1px solid #DFDFDF;
177
 
178
+ &.active,
179
  &:hover {
180
  background: $light_blue;
181
+ border-color: $light_blue;
182
  color: white;
183
  }
184
  }
185
 
 
 
 
 
 
186
  &.horizontal {
187
  width: 85%;
188
  float: left;
189
+ margin-top: 10px;
190
+ margin-bottom: 20px;
191
  }
192
  }
193
 
1203
  font-size: 0.9em;
1204
  color: $dark_grey;
1205
  line-height: 1.5em;
1206
+
1207
+ p {
1208
+ font-size: 0.9em;
1209
+ }
1210
  }
1211
  }
1212
 
1237
  line-height: 1.5em;
1238
  text-indent: 2px;
1239
  margin-top: 5px;
1240
+
1241
+ p {
1242
+ font-size: 0.9em;
1243
+ }
1244
  }
1245
  }
1246
 
1292
  .general_settings {
1293
  table {
1294
  td {
1295
+ padding-bottom: 3px;
1296
  }
1297
  }
1298
  }
1301
  > h4.first {
1302
  margin: 0em 0 0.7em 0;
1303
  }
1304
+ > h4 {
1305
  clear: both;
1306
  border-bottom: 1px solid $grey;
1307
  padding: 0 0 10px 0;
1311
  }
1312
 
1313
  .mm_content {
1314
+ > h4.first {
1315
  margin: 0em 0 0.7em 0;
1316
  }
1317
+ > h4 {
1318
  clear: both;
1319
  border-bottom: 1px solid $grey;
1320
  padding: 0 0 10px 0;
1421
  div.accordion-section-content {
1422
  padding: 0 10px;
1423
 
1424
+ .mega-accordion {
1425
+ float: left;
1426
+ width: 100%;
1427
+ }
1428
+
1429
+ .mega-accordion-title {
1430
+ margin-bottom: 10px;
1431
+ }
1432
+
1433
  h4 {
1434
  outline: none;
1435
  float: left;
 
1436
  border: 0;
1437
+ margin: 0;
1438
+ padding: 0;
1439
  white-space: nowrap;
1440
  overflow: hidden;
1441
  text-overflow: ellipsis;
1445
  }
1446
  }
1447
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1448
  table {
1449
  font-size: 0.9em;
1450
  width: 100%;
1598
  -moz-osx-font-smoothing: grayscale;
1599
  }
1600
 
1601
+ .megamenu_header_top {
1602
+ font-size: 0.9em;
1603
+ display: block;
1604
  width: 100%;
1605
+ height: 30px;
1606
+ line-height: 30px;
1607
+ margin-bottom: 10px;
1608
+ box-sizing: border-box;
1609
+
1610
+ ul {
1611
+ margin: 0;
1612
+ float: right;
1613
+ position: relative;
1614
+
1615
+ li {
1616
+ display: inline-block;
1617
+ margin: 0 0 0 14px;
1618
+ line-height: 30px;
1619
+
1620
+ &.mega-highlight {
1621
+ background: #35b1df;
1622
+ border-radius: 5px;
1623
+
1624
+ a {
1625
+ color: white;
1626
+ line-height: 30px;
1627
+ padding: 0 10px;
1628
+ }
1629
+ }
1630
+ }
1631
+ }
1632
  }
1633
 
1634
+ .megamenu_header {
1635
+ background: white;
1636
+ padding: 10px 17px;
1637
+ border-bottom: 1px solid $mid_grey;
1638
  float: left;
1639
+ width: 100%;
1640
+ box-sizing: border-box;
1641
 
1642
+ .version {
1643
+ color: $dark_grey;
1644
+ margin-bottom: 15px;
1645
+ font-size: 12px;
1646
  }
1647
 
1648
+ @include tablet {
1649
+ text-align: center;
1650
+ border-bottom: 0;
 
 
 
 
 
 
1651
  }
1652
+ }
1653
+
1654
+ .megamenu_wrap {
1655
+ width: 100%;
1656
+ float: left;
1657
+ display: flex;
1658
+ flex-wrap: wrap;
1659
+ background: white;
1660
 
1661
+ @include tablet {
1662
+ flex-direction: column;
1663
  }
1664
+ }
1665
+
1666
 
1667
+ .megamenu_left {
1668
+ flex-basis: 190px;
1669
+ flex-grow: 1;
1670
+
1671
+ @include tablet {
1672
+ flex-basis: auto;
1673
+ border-bottom: 0;
1674
+ margin-bottom: 20px;
1675
  }
1676
 
1677
+ ul.mega-page-navigation {
1678
+ @include tablet {
1679
+ text-align: center;
1680
+ margin: 0;
1681
+ }
1682
+
1683
+ li {
1684
+ @include tablet {
1685
+ display: inline-flex;
1686
+ margin-bottom: 0;
1687
+ }
1688
+
1689
+ a {
1690
+ text-decoration: none;
1691
+ color: $text_grey;
1692
+ width: 100%;
1693
+ display: block;
1694
+ padding: 5px 0px 5px 17px;
1695
+ box-sizing: border-box;
1696
+ border-left: 2px solid white;
1697
+ outline: 0;
1698
+
1699
+ &:hover,
1700
+ &.active {
1701
+ border-left: 2px solid $light_blue;
1702
+ color: #0074a2;
1703
+ }
1704
+
1705
+ @include tablet {
1706
+ border-left: 0;
1707
+ padding: 1rem;
1708
+ margin: 0;
1709
+ margin-left: 1rem;
1710
+ margin-right: 1rem;
1711
+
1712
+ &.active {
1713
+ border-left: 0;
1714
+ box-shadow: inset 0 -3px $light_blue;
1715
+ font-weight: 600;
1716
+ }
1717
+
1718
+ &:hover {
1719
+ border-left: 0;
1720
+ }
1721
+ }
1722
+ }
1723
+ }
1724
  }
1725
+ }
1726
+
1727
+ .megamenu_right {
1728
+ flex-basis: 0;
1729
+ flex-grow: 999;
1730
 
1731
+ @include tablet {
1732
+ flex-basis: auto;
1733
+ }
1734
  }
1735
 
1736
  h3.first {
1787
  }
1788
  }
1789
 
 
 
 
 
 
 
 
1790
 
 
 
 
 
 
 
1791
 
 
 
 
 
 
 
 
 
1792
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1793
 
1794
  .megamenu_wrap .megamenu_submit .saved {
1795
  background: transparent;
1814
  .megamenu_wrap .fail {
1815
  background: $white;
1816
  border-left: 4px solid $green;
1817
+ border-top: 1px solid $grey;
1818
+ border-bottom: 1px solid $grey;
1819
+ border-right: 1px solid $grey;
1820
  box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
1821
  padding: 10px;
1822
  margin: 5px 0 30px;
1881
  }
1882
 
1883
  .megamenu_right {
 
1884
  padding: 20px;
1885
  box-sizing: border-box;
1886
  border-left: 1px solid $mid_grey;
1887
  min-height: 400px;
1888
 
1889
+ textarea.mega-export {
1890
+ width: 100%;
1891
+ height: 150px;
1892
+ font-family: monospace;
1893
+ margin-bottom: 10px;
1894
+ font-size: 0.9em;
1895
  }
1896
 
1897
  h2.nav-tab-wrapper {
1899
 
1900
  a.nav-tab {
1901
  cursor: pointer;
1902
+
1903
+ @include tablet {
1904
+ font-size: 12px;
1905
+ }
1906
  }
1907
 
1908
  a.nav-tab-active {
1923
 
1924
  .menu_settings {
1925
 
1926
+ .mega-tooltip {
1927
+ &:before {
1928
+ top: -29px;
1929
+ margin-left: -5px;
1930
+ }
1931
+
1932
+ &:after {
1933
+ margin-left: 2px;
1934
+ }
1935
+ }
1936
+
1937
+ &.menu_settings_general_settings {
1938
+ .mega-inner-table {
1939
+ width: auto;
1940
+
1941
+ td {
1942
+ padding-top: 3px;
1943
+ padding-bottom: 3px;
1944
+ }
1945
+ }
1946
+ }
1947
+
1948
  &.menu_settings_menu_locations {
1949
 
1950
  .mega-add-location {
1951
+ margin-top: 20px;
1952
  }
1953
  div.mega-tab-content {
1954
  border: 0;
1958
 
1959
  a.nav-tab,
1960
  a.nav-tab-active {
1961
+ font-size: 12px;
1962
  font-weight: normal;
1963
  padding: 3px 5px;
1964
  border: 0;
1965
+ margin: 0 15px 0 0;
1966
  background: white;
1967
  color: $text_grey;
1968
  border-radius: 3px;
1969
+ background: $light_grey;
1970
+ border: 1px solid $grey;
1971
  }
1972
 
1973
  a.nav-tab-active {
1974
  background: $light_blue;
1975
+ border-color: $light_blue;
1976
  color: white;
1977
  }
1978
  }
1979
 
1980
  table td {
1981
  padding-bottom: 0;
 
 
 
 
1982
  }
1983
 
1984
  table.output_options td.mega-value {
1991
  }
1992
 
1993
  table.sticky_settings tr td:first-child {
1994
+ width: 40%;
1995
+ }
1996
+
1997
+ .mega-tab-content table td:first-child {
1998
+ width: 40%;
1999
+ font-size: 13px;
2000
+
2001
+ .mega-description {
2002
+ margin-top: 0;
2003
+ }
2004
+ .dashicons {
2005
+ margin-right: 6px;
2006
+ font-size: 14px;
2007
+ vertical-align: middle;
2008
+ }
2009
  }
2010
 
2011
+ .mega-vartical-align-top {
2012
+ vertical-align: top;
2013
  }
2014
 
2015
  .megamenu_submit {
2016
  margin-bottom: 0;
2017
  }
 
 
 
2018
  }
2019
 
2020
  &.menu_settings_menu_themes {
2021
 
2022
+ .theme_selector {
2023
+ margin-bottom: 20px;
2024
+ float: left;
2025
+ font-size: 12px;
2026
+
2027
+ select {
2028
+ max-width: 500px;
2029
+ }
2030
+ }
2031
+
2032
+ .mega-ellipsis {
2033
+ float: left;
2034
+ height: 30px;
2035
+ margin-left: 6px;
2036
+
2037
+ svg {
2038
+ height: 30px;
2039
+ border: 1px solid #7e8993;
2040
+ border-radius: 3px;
2041
+ box-sizing: border-box;
2042
+ }
2043
+
2044
+ .mega-export-theme .dashicons,
2045
+ .mega-import-theme .dashicons {
2046
+ transform: rotate(90deg);
2047
+ }
2048
+ }
2049
+
2050
  td.mega-name {
2051
  padding-left: 10px;
2052
  font-size: 14px;
2069
 
2070
  &.menu_settings_menu_locations {
2071
 
2072
+ .mega-location-disabled-assign-menu .mega-accordion-content {
2073
+ padding: 10px 20px;
2074
+ }
2075
+ .mega-location {
2076
  font-size: 14px;
2077
+ border: 0;
2078
  border: 1px solid $grey;
2079
+ margin-bottom: 10px;
2080
+ float: left;
2081
+ width: 100%;
2082
 
2083
+ .mega-accordion-title.mega-accordion-open,
2084
+ .mega-accordion-title:hover {
2085
+ background: $light_grey;
2086
+ }
2087
 
2088
+ .mega-accordion-title {
2089
+ padding: 8px;
2090
+ font-size: 0.9em;
2091
 
 
 
 
 
 
2092
  .dashicons-yes {
2093
+ color: transparent;
2094
  display: none;
2095
  }
2096
+ }
2097
+
2098
+ &.mega-location-enabled {
2099
+ .mega-accordion-title .dashicons-yes {
2100
  color: $green;
2101
+ margin-left: 4px;
2102
+ display: inline-block;
2103
  }
2104
 
2105
+ &.mega-has-active-location {
2106
+ .mega-accordion-title .dashicons-yes {
2107
+ color: #F56E28;
2108
+ }
2109
  }
2110
+ }
2111
 
2112
+ .mega-accordion-content {
2113
+ border-top: 1px solid $grey;
 
 
2114
 
2115
+ .megamenu_submit {
2116
+ background: $light_grey;
2117
+ padding: 20px 10px;
2118
+ margin-top: 20px;
2119
+ box-sizing: border-box;
2120
+ }
2121
+
2122
+ .mega-accordion-content-wrapper {
2123
+ padding: 10px 15px;
2124
+ float: left;
2125
+ width: 100%;
2126
+ box-sizing: border-box;
2127
  }
2128
  }
2129
  }
2143
  padding: 10px;
2144
  }
2145
 
2146
+ > table td:first-child {
2147
+ width: 25%;
2148
+ }
2149
+
2150
  h5 {
2151
  font-size: 12px;
2152
  }
2181
  margin-bottom: 10px;
2182
  }
2183
 
2184
+ .mega-radio-row {
2185
+ margin-bottom: 3px;
2186
+
2187
+ label {
2188
+ float: none;
2189
+ top: -3px;
2190
+ position: relative;
2191
+ font-size: 1em;
2192
+ }
2193
+ }
2194
 
2195
  textarea,
2196
  input[type=text],
2197
  input[type=number],
2198
  select {
2199
+ font-size: 11px;
2200
  min-height: 28px;
2201
  }
2202
 
2221
  width: 70px;
2222
  }
2223
 
2224
+ input[type=text].wide {
2225
+ width: 300px;
2226
+ }
2227
+
2228
  input[type=submit] {
2229
  width: auto;
2230
  }
2274
  position: relative;
2275
  padding-bottom: 25px;
2276
  padding-top: 15px;
2277
+ border-top: 1px solid $grey;
2278
 
2279
  &.mega-name {
2280
  width: 33%;
2338
 
2339
  td.mega-name .mega-description,
2340
  td.mega-value .mega-description {
2341
+ font-size: 12px;
2342
  color: #777;
2343
  line-height: 1.5em;
2344
+
2345
+ p {
2346
+ font-size: 12px;
2347
+ }
2348
  }
2349
 
2350
  ul.custom_styling_tips {
2654
 
2655
  }
2656
 
2657
+
2658
+ .mega-accordion-title {
2659
+ transition: all .1s ease-in;
2660
+ margin: 0;
2661
+ color: $text_grey;
2662
+ cursor: pointer;
2663
+ float: left;
2664
+ width: 100%;
2665
+ box-sizing: border-box;
2666
+ line-height: 24px;
2667
+
2668
+ h4 {
2669
+ display: inline;
2670
+ }
2671
+
2672
+ .dashicons {
2673
+ font-size: 18px;
2674
+ vertical-align: middle;
2675
+ margin-right: 6px;
2676
+ transition: none;
2677
+ }
2678
+
2679
+ &.mega-accordion-open + .mega-accordion-content {
2680
+ display: block;
2681
+ }
2682
+ }
2683
+
2684
+ .mega-ellipsis {
2685
+ float: right;
2686
+ position: relative;
2687
+ height: 26px;
2688
+
2689
+ svg {
2690
+ cursor: pointer;
2691
+ fill: black;
2692
+ height: 26px;
2693
+ width: 26px;
2694
+ }
2695
+
2696
+ &.mega-ellipsis-open {
2697
+ ul.mega-ellipsis-content {
2698
+ display: block;
2699
+ }
2700
+ }
2701
+
2702
+ ul.mega-ellipsis-content {
2703
+ display: none;
2704
+ position: absolute;
2705
+ width: 170px;
2706
+ background: white;
2707
+ left: -141px;
2708
+ top: 33px;
2709
+ z-index: 9;
2710
+ border: 1px solid $dark_grey;
2711
+ margin: 0;
2712
+ box-shadow: 0 8px 24px rgba(149,157,165,.2);
2713
+ border-radius: 3px;
2714
+
2715
+ &:after {
2716
+ top: -14px;
2717
+ right: 10px;
2718
+ left: auto;
2719
+ border: 7px solid transparent;
2720
+ border-bottom-color: #fff;
2721
+ position: absolute;
2722
+ display: inline-block;
2723
+ content: "";
2724
+ }
2725
+
2726
+ &:before {
2727
+ top: -16px;
2728
+ right: 9px;
2729
+ left: auto;
2730
+ border: 8px solid transparent;
2731
+ border-bottom-color: $dark_grey;
2732
+ position: absolute;
2733
+ display: inline-block;
2734
+ content: "";
2735
+ }
2736
+ li {
2737
+ font-size: 12px;
2738
+ margin-bottom: 0;
2739
+
2740
+ a {
2741
+ display: block;
2742
+ text-decoration: none;
2743
+ line-height: 40px;
2744
+ padding-left: 10px;
2745
+ color: $text_grey;
2746
+ transition: all 0.2s;
2747
+
2748
+ &:hover {
2749
+ background: $light_grey;
2750
+ color: $light_blue;
2751
+ }
2752
+
2753
+ .dashicons {
2754
+ font-size: 18px;
2755
+ vertical-align: middle;
2756
+ margin-right: 6px;
2757
+ transition: none;
2758
+ }
2759
+ }
2760
+ }
2761
+ }
2762
+ }
2763
+
2764
+ .mega-accordion-content {
2765
+ display: none;
2766
+ float: left;
2767
+ width: 100%;
2768
+ box-sizing: border-box;
2769
+ }
2770
+
2771
+ .mega-warning {
2772
+ padding: 10px 0;
2773
+
2774
+ .dashicons {
2775
+ margin-right: 6px;
2776
+ }
2777
+ }
2778
+
2779
  @keyframes "rotation" {
2780
  0% {
2781
  -webkit-transform: rotate(0deg);
2785
  -webkit-transform: rotate(359deg);
2786
  transform: rotate(359deg);
2787
  }
2788
+ }
2789
+ @keyframes busy-animation {
2790
+ 0% {
2791
+ background-position: 200px 0;
2792
+ }
2793
+ }
css/megamenu.scss CHANGED
@@ -38,6 +38,8 @@
38
  margin: 0;
39
  min-height: auto;
40
  max-height: none;
 
 
41
  opacity: 1;
42
  outline: none;
43
  overflow: visible;
@@ -877,6 +879,10 @@
877
  a.mega-menu-link {
878
  padding-left: 20px;
879
  }
 
 
 
 
880
  }
881
  }
882
  }
@@ -1039,11 +1045,7 @@
1039
  line-height: $toggle_bar_height;
1040
  height: $toggle_bar_height;
1041
  text-align: left;
1042
- -webkit-touch-callout: none;
1043
- -webkit-user-select: none;
1044
- -khtml-user-select: none;
1045
- -moz-user-select: none;
1046
- -ms-user-select: none;
1047
  -webkit-tap-highlight-color: transparent;
1048
  outline: none;
1049
  white-space: nowrap;
@@ -1090,6 +1092,10 @@
1090
 
1091
  .mega-toggle-block {
1092
  margin-left: 6px;
 
 
 
 
1093
  }
1094
  }
1095
 
@@ -1117,6 +1123,10 @@
1117
 
1118
  .mega-toggle-block {
1119
  margin-right: 6px;
 
 
 
 
1120
  }
1121
  }
1122
 
@@ -1178,6 +1188,7 @@
1178
  transition: left $effect_speed_mobile ease-in-out, right $effect_speed_mobile ease-in-out;
1179
  overflow: auto;
1180
  z-index: 9999999999;
 
1181
  }
1182
 
1183
  @if ($effect_mobile == slide_right ) {
38
  margin: 0;
39
  min-height: auto;
40
  max-height: none;
41
+ min-width: auto;
42
+ max-width: auto;
43
  opacity: 1;
44
  outline: none;
45
  overflow: visible;
879
  a.mega-menu-link {
880
  padding-left: 20px;
881
  }
882
+
883
+ ul.mega-sub-menu a.mega-menu-link {
884
+ padding-left: 30px;
885
+ }
886
  }
887
  }
888
  }
1045
  line-height: $toggle_bar_height;
1046
  height: $toggle_bar_height;
1047
  text-align: left;
1048
+ user-select: none;
 
 
 
 
1049
  -webkit-tap-highlight-color: transparent;
1050
  outline: none;
1051
  white-space: nowrap;
1092
 
1093
  .mega-toggle-block {
1094
  margin-left: 6px;
1095
+
1096
+ &:only-child {
1097
+ margin-right: 6px;
1098
+ }
1099
  }
1100
  }
1101
 
1123
 
1124
  .mega-toggle-block {
1125
  margin-right: 6px;
1126
+
1127
+ &:only-child {
1128
+ margin-left: 6px;
1129
+ }
1130
  }
1131
  }
1132
 
1188
  transition: left $effect_speed_mobile ease-in-out, right $effect_speed_mobile ease-in-out;
1189
  overflow: auto;
1190
  z-index: 9999999999;
1191
+ overscroll-behavior: contain;
1192
  }
1193
 
1194
  @if ($effect_mobile == slide_right ) {
js/admin.js CHANGED
@@ -1131,10 +1131,14 @@
1131
  }
1132
 
1133
  var start_saving = function() {
 
 
1134
  $(".mm_saving").show();
1135
  }
1136
 
1137
  var end_saving = function() {
 
 
1138
  $(".mm_saving").fadeOut("fast");
1139
  }
1140
 
@@ -1150,13 +1154,6 @@
1150
  jQuery(function($) {
1151
  "use strict";
1152
 
1153
- $("#megamenu_accordion").accordion({
1154
- heightStyle: "content",
1155
- collapsible: true,
1156
- active: false,
1157
- animate: 200
1158
- });
1159
-
1160
  var apply_megamenu_enabled_class = function() {
1161
  if ($("input.megamenu_enabled:checked") && $("input.megamenu_enabled:checked").length) {
1162
  $("body").addClass("megamenu_enabled");
@@ -1242,4 +1239,39 @@ jQuery(function($) {
1242
  });
1243
  });
1244
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1245
  });
1131
  }
1132
 
1133
  var start_saving = function() {
1134
+ var original_value = $(".mm_content:visible p.submit input.button-primary").attr('value');
1135
+ $(".mm_content:visible p.submit input.button-primary").addClass('is-busy').attr('value', megamenu.saving + "…").attr('data-orig-value', original_value);
1136
  $(".mm_saving").show();
1137
  }
1138
 
1139
  var end_saving = function() {
1140
+ var original_value = $(".mm_content:visible p.submit input.button-primary").attr('data-orig-value');
1141
+ $(".mm_content:visible p.submit input.button-primary").removeClass("is-busy").attr('value', original_value);
1142
  $(".mm_saving").fadeOut("fast");
1143
  }
1144
 
1154
  jQuery(function($) {
1155
  "use strict";
1156
 
 
 
 
 
 
 
 
1157
  var apply_megamenu_enabled_class = function() {
1158
  if ($("input.megamenu_enabled:checked") && $("input.megamenu_enabled:checked").length) {
1159
  $("body").addClass("megamenu_enabled");
1239
  });
1240
  });
1241
 
1242
+ $(".mega-accordion-title").on('click', function(e) {
1243
+ e.preventDefault();
1244
+
1245
+ var title = $(this);
1246
+ var content = title.next('.mega-accordion-content');
1247
+
1248
+ if ( content.is(':hidden') ) {
1249
+ content.slideDown();
1250
+ title.addClass('mega-accordion-open');
1251
+ } else {
1252
+ content.slideUp();
1253
+ title.removeClass('mega-accordion-open');
1254
+ }
1255
+ });
1256
+
1257
+ $(".mega-ellipsis").on('click', function(e) {
1258
+ e.stopPropagation();
1259
+
1260
+ var ellipsis = $(this);
1261
+
1262
+ $(".mega-ellipsis").not(ellipsis).removeClass('mega-ellipsis-open');
1263
+
1264
+ if ( ellipsis.hasClass('mega-ellipsis-open') ) {
1265
+ ellipsis.removeClass('mega-ellipsis-open');
1266
+ } else {
1267
+ ellipsis.addClass('mega-ellipsis-open');
1268
+ }
1269
+ });
1270
+
1271
+ $(document).on("click", function(e) { // hide menu when clicked away from
1272
+ if ( ! $(e.target).closest(".mega-ellipsis").length ) {
1273
+ $(".mega-ellipsis").removeClass('mega-ellipsis-open');
1274
+ }
1275
+ });
1276
+
1277
  });
js/maxmegamenu.js CHANGED
@@ -37,7 +37,7 @@
37
  "li.mega-menu-tabbed > ul.mega-sub-menu > li.mega-menu-item-has-children," +
38
  "li.mega-menu-flyout li.mega-menu-item-has-children", menu);
39
 
40
-
41
 
42
  plugin.addAnimatingClass = function(element) {
43
  if (plugin.settings.effect === "disabled") {
@@ -190,7 +190,7 @@
190
  }
191
  };
192
 
193
- var bindClickEvents = function() {
194
  var dragging = false;
195
 
196
  $(document).on({
@@ -206,7 +206,6 @@
206
  dragging = false;
207
  });
208
 
209
- var collapse_children_parents = $("li.mega-menu-megamenu li.mega-menu-item-has-children.mega-collapse-children > a.mega-menu-link");
210
  var clickable_parents = $("> a.mega-menu-link", items_with_submenus).add(collapse_children_parents);
211
 
212
  clickable_parents.on("touchend.megamenu", function(e) {
@@ -214,7 +213,7 @@
214
  plugin.unbindHoverIntentEvents();
215
  });
216
 
217
- clickable_parents.on("click.megamenu", function(e) {
218
  if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed") ) {
219
  if (plugin.settings.second_click === "go") {
220
  return;
@@ -244,9 +243,13 @@
244
  }
245
  }
246
  });
 
 
 
 
247
  };
248
 
249
- var bindHoverEvents = function() {
250
  items_with_submenus.on({
251
  "mouseenter.megamenu" : function() {
252
  plugin.unbindClickEvents();
@@ -262,7 +265,7 @@
262
  });
263
  };
264
 
265
- var bindHoverIntentEvents = function() {
266
  items_with_submenus.hoverIntent({
267
  over: function () {
268
  plugin.unbindClickEvents();
@@ -280,7 +283,7 @@
280
  });
281
  };
282
 
283
- var bindKeyboardEvents = function() {
284
  var tab_key = 9;
285
  var escape_key = 27;
286
  var enter_key = 13;
@@ -413,12 +416,8 @@
413
  };
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() {
@@ -446,43 +445,27 @@
446
  plugin.unbindKeyboardEvents();
447
  };
448
 
449
-
450
  plugin.bindMegaMenuEvents = function() {
 
 
451
  if (plugin.isDesktopView() && plugin.settings.event === "hover_intent") {
452
- bindHoverIntentEvents();
453
  }
454
 
455
  if (plugin.isDesktopView() && plugin.settings.event === "hover") {
456
- bindHoverEvents();
457
  }
458
 
459
- bindClickEvents(); // always bind click events for touch screen devices
460
- bindKeyboardEvents();
461
- };
462
-
463
- plugin.monitorView = function() {
464
- if (plugin.isDesktopView()) {
465
- $menu.data("view", "desktop");
466
- } else {
467
- $menu.data("view", "mobile");
468
- plugin.switchToMobile();
469
- }
470
-
471
- plugin.checkWidth();
472
-
473
- $(window).resize(function() {
474
- plugin.checkWidth();
475
- });
476
  };
477
 
478
  plugin.checkWidth = function() {
479
  if ( plugin.isMobileView() && $menu.data("view") === "desktop" ) {
480
- $menu.data("view", "mobile");
481
  plugin.switchToMobile();
482
  }
483
 
484
  if ( plugin.isDesktopView() && $menu.data("view") === "mobile" ) {
485
- $menu.data("view", "desktop");
486
  plugin.switchToDesktop();
487
  }
488
 
@@ -501,33 +484,37 @@
501
  });
502
  };
503
 
504
- plugin.switchToMobile = function() {
505
- plugin.unbindMegaMenuEvents();
506
  plugin.bindMegaMenuEvents();
507
- plugin.reverseRightAlignedItems();
508
- plugin.addClearClassesToMobileItems();
509
- plugin.hideAllPanels();
510
  };
511
 
512
  plugin.switchToDesktop = function() {
513
- plugin.unbindMegaMenuEvents();
514
  plugin.bindMegaMenuEvents();
515
  plugin.reverseRightAlignedItems();
516
  plugin.hideAllPanels();
 
 
517
 
518
- $menu.css({
519
- width: "",
520
- left: "",
521
- display: ""
522
- });
523
 
524
- $toggle_bar.removeClass("mega-menu-open");
 
 
 
 
 
 
525
  };
526
 
527
  plugin.initToggleBar = function() {
528
  // mobile menu
529
  $toggle_bar.on("click", function(e) {
530
- if ( $(e.target).is(".mega-menu-toggle, .mega-menu-toggle-block, .mega-menu-toggle-animated-block, .mega-menu-toggle-animated-block *, .mega-toggle-blocks-left, .mega-toggle-blocks-center, .mega-toggle-blocks-right, .mega-toggle-label, .mega-toggle-label span") ) {
531
  if ($(this).hasClass("mega-menu-open")) {
532
  plugin.hideMobileMenu();
533
  } else {
@@ -537,8 +524,29 @@
537
  });
538
  };
539
 
540
- plugin.hideMobileMenu = function() {
541
- if ( ! $toggle_bar.is(":visible")) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
542
  return;
543
  }
544
 
@@ -549,7 +557,7 @@
549
 
550
  $(".mega-toggle-label, .mega-toggle-animated", $toggle_bar).attr("aria-expanded", "false");
551
 
552
- if (plugin.settings.effect_mobile === "slide") {
553
  $menu.animate({"height":"hide"}, plugin.settings.effect_speed_mobile, function() {
554
  $menu.css({
555
  width: "",
@@ -559,6 +567,12 @@
559
  });
560
  }
561
 
 
 
 
 
 
 
562
  $toggle_bar.removeClass("mega-menu-open");
563
  };
564
 
@@ -587,8 +601,7 @@
587
  };
588
 
589
  plugin.toggleBarForceWidth = function() {
590
-
591
- if ($(plugin.settings.mobile_force_width).length && ( plugin.settings.effect_mobile == 'slide' || plugin.settings.effect_mobile == 'disabled' ) ) {
592
  var submenu_offset = $toggle_bar.offset();
593
  var target_offset = $(plugin.settings.mobile_force_width).offset();
594
 
@@ -610,25 +623,20 @@
610
  plugin.unbindAllEvents();
611
  }
612
 
613
- $("span.mega-indicator", $menu).on("click.megamenu", function(e) {
614
- e.preventDefault();
615
- e.stopPropagation();
616
-
617
- if ( $(this).parent().parent().hasClass("mega-toggle-on") ) {
618
- if ( ! $(this).parent().parent().parent().parent().hasClass("mega-menu-tabbed") || plugin.isMobileView() ) {
619
- plugin.hidePanel($(this).parent(), false);
620
- }
621
- } else {
622
- plugin.showPanel($(this).parent(), false);
623
- }
624
- });
625
-
626
  $(window).on("load", function() {
627
  plugin.calculateDynamicSubmenuWidths($("> li.mega-menu-megamenu > a.mega-menu-link", $menu));
628
  });
629
 
630
- plugin.bindMegaMenuEvents();
631
- plugin.monitorView();
 
 
 
 
 
 
 
 
632
  $menu.triggerHandler("after_mega_menu_init");
633
  };
634
 
37
  "li.mega-menu-tabbed > ul.mega-sub-menu > li.mega-menu-item-has-children," +
38
  "li.mega-menu-flyout li.mega-menu-item-has-children", menu);
39
 
40
+ var collapse_children_parents = $("li.mega-menu-megamenu li.mega-menu-item-has-children.mega-collapse-children > a.mega-menu-link", menu);
41
 
42
  plugin.addAnimatingClass = function(element) {
43
  if (plugin.settings.effect === "disabled") {
190
  }
191
  };
192
 
193
+ plugin.bindClickEvents = function() {
194
  var dragging = false;
195
 
196
  $(document).on({
206
  dragging = false;
207
  });
208
 
 
209
  var clickable_parents = $("> a.mega-menu-link", items_with_submenus).add(collapse_children_parents);
210
 
211
  clickable_parents.on("touchend.megamenu", function(e) {
213
  plugin.unbindHoverIntentEvents();
214
  });
215
 
216
+ clickable_parents.not("[data-has-click-event]").on("click.megamenu", function(e) {
217
  if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed") ) {
218
  if (plugin.settings.second_click === "go") {
219
  return;
243
  }
244
  }
245
  });
246
+
247
+ collapse_children_parents.each(function() {
248
+ $(this).attr('data-has-click-event', 'true');
249
+ });
250
  };
251
 
252
+ plugin.bindHoverEvents = function() {
253
  items_with_submenus.on({
254
  "mouseenter.megamenu" : function() {
255
  plugin.unbindClickEvents();
265
  });
266
  };
267
 
268
+ plugin.bindHoverIntentEvents = function() {
269
  items_with_submenus.hoverIntent({
270
  over: function () {
271
  plugin.unbindClickEvents();
283
  });
284
  };
285
 
286
+ plugin.bindKeyboardEvents = function() {
287
  var tab_key = 9;
288
  var escape_key = 27;
289
  var enter_key = 13;
416
  };
417
 
418
  plugin.unbindClickEvents = function() {
419
+ // collapsable parents always have a click event
420
+ $("> a.mega-menu-link", items_with_submenus).not(collapse_children_parents).off("click.megamenu touchend.megamenu");
 
 
 
 
421
  };
422
 
423
  plugin.unbindHoverEvents = function() {
445
  plugin.unbindKeyboardEvents();
446
  };
447
 
 
448
  plugin.bindMegaMenuEvents = function() {
449
+ plugin.unbindMegaMenuEvents();
450
+
451
  if (plugin.isDesktopView() && plugin.settings.event === "hover_intent") {
452
+ plugin.bindHoverIntentEvents();
453
  }
454
 
455
  if (plugin.isDesktopView() && plugin.settings.event === "hover") {
456
+ plugin.bindHoverEvents();
457
  }
458
 
459
+ plugin.bindClickEvents(); // always bind click events for touch screen devices
460
+ plugin.bindKeyboardEvents();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
  };
462
 
463
  plugin.checkWidth = function() {
464
  if ( plugin.isMobileView() && $menu.data("view") === "desktop" ) {
 
465
  plugin.switchToMobile();
466
  }
467
 
468
  if ( plugin.isDesktopView() && $menu.data("view") === "mobile" ) {
 
469
  plugin.switchToDesktop();
470
  }
471
 
484
  });
485
  };
486
 
487
+ plugin.initDesktop = function() {
488
+ $menu.data("view", "desktop");
489
  plugin.bindMegaMenuEvents();
490
+ plugin.initIndicators();
 
 
491
  };
492
 
493
  plugin.switchToDesktop = function() {
494
+ $menu.data("view", "desktop");
495
  plugin.bindMegaMenuEvents();
496
  plugin.reverseRightAlignedItems();
497
  plugin.hideAllPanels();
498
+ plugin.hideMobileMenu(true);
499
+ };
500
 
501
+ plugin.initMobile = function() {
502
+ plugin.switchToMobile();
503
+ };
 
 
504
 
505
+ plugin.switchToMobile = function() {
506
+ $menu.data("view", "mobile");
507
+ plugin.bindMegaMenuEvents();
508
+ plugin.initIndicators();
509
+ plugin.reverseRightAlignedItems();
510
+ plugin.addClearClassesToMobileItems();
511
+ plugin.hideAllPanels();
512
  };
513
 
514
  plugin.initToggleBar = function() {
515
  // mobile menu
516
  $toggle_bar.on("click", function(e) {
517
+ if ( $(e.target).is(".mega-menu-toggle, .mega-menu-toggle-custom-block *, .mega-menu-toggle-block, .mega-menu-toggle-animated-block, .mega-menu-toggle-animated-block *, .mega-toggle-blocks-left, .mega-toggle-blocks-center, .mega-toggle-blocks-right, .mega-toggle-label, .mega-toggle-label span") ) {
518
  if ($(this).hasClass("mega-menu-open")) {
519
  plugin.hideMobileMenu();
520
  } else {
524
  });
525
  };
526
 
527
+ plugin.initIndicators = function() {
528
+ $("span.mega-indicator", $menu).not("[data-has-click-event]").on("click.megamenu", function(e) {
529
+ e.preventDefault();
530
+ e.stopPropagation();
531
+
532
+ if ( $(this).parent().parent().hasClass("mega-toggle-on") ) {
533
+ if ( ! $(this).parent().parent().parent().parent().hasClass("mega-menu-tabbed") || plugin.isMobileView() ) {
534
+ plugin.hidePanel($(this).parent(), false);
535
+ }
536
+ } else {
537
+ plugin.showPanel($(this).parent(), false);
538
+ }
539
+ });
540
+
541
+ $("span.mega-indicator", $menu).each(function() {
542
+ $(this).attr('data-has-click-event', 'true');
543
+ });
544
+ }
545
+
546
+ plugin.hideMobileMenu = function(force) {
547
+ force = force || false;
548
+
549
+ if ( ! $toggle_bar.is(":visible") && ! force ) {
550
  return;
551
  }
552
 
557
 
558
  $(".mega-toggle-label, .mega-toggle-animated", $toggle_bar).attr("aria-expanded", "false");
559
 
560
+ if (plugin.settings.effect_mobile === "slide" && ! force ) {
561
  $menu.animate({"height":"hide"}, plugin.settings.effect_speed_mobile, function() {
562
  $menu.css({
563
  width: "",
567
  });
568
  }
569
 
570
+ $menu.css({
571
+ width: "",
572
+ left: "",
573
+ display: ""
574
+ });
575
+
576
  $toggle_bar.removeClass("mega-menu-open");
577
  };
578
 
601
  };
602
 
603
  plugin.toggleBarForceWidth = function() {
604
+ if ($(plugin.settings.mobile_force_width).length && ( plugin.settings.effect_mobile === "slide" || plugin.settings.effect_mobile === "disabled" ) ) {
 
605
  var submenu_offset = $toggle_bar.offset();
606
  var target_offset = $(plugin.settings.mobile_force_width).offset();
607
 
623
  plugin.unbindAllEvents();
624
  }
625
 
 
 
 
 
 
 
 
 
 
 
 
 
 
626
  $(window).on("load", function() {
627
  plugin.calculateDynamicSubmenuWidths($("> li.mega-menu-megamenu > a.mega-menu-link", $menu));
628
  });
629
 
630
+ if ( plugin.isDesktopView() ) {
631
+ plugin.initDesktop();
632
+ } else {
633
+ plugin.initMobile();
634
+ }
635
+
636
+ $(window).resize(function() {
637
+ plugin.checkWidth();
638
+ });
639
+
640
  $menu.triggerHandler("after_mega_menu_init");
641
  };
642
 
js/settings.js CHANGED
@@ -30,6 +30,14 @@ jQuery(function ($) {
30
  }
31
  });
32
 
 
 
 
 
 
 
 
 
33
  if (typeof wp.codeEditor !== 'undefined' && typeof cm_settings !== 'undefined') {
34
  if ($('#codemirror').length) {
35
  wp.codeEditor.initialize($('#codemirror'), cm_settings);
@@ -119,8 +127,8 @@ jQuery(function ($) {
119
  $(".theme_editor").on("submit", function(e) {
120
  e.preventDefault();
121
  $(".theme_result_message").remove();
122
- $(".spinner").css('visibility', 'visible').css('display', 'block');
123
- $("input#submit").attr('disabled', 'disabled');
124
  var memory_limit_link = $("<a>").attr('href', megamenu_settings.increase_memory_limit_url).html(megamenu_settings.increase_memory_limit_anchor_text);
125
 
126
  $.ajax({
@@ -157,8 +165,7 @@ jQuery(function ($) {
157
 
158
  },
159
  complete: function() {
160
- $(".spinner").hide();
161
- $("input#submit").removeAttr('disabled');
162
  }
163
  });
164
 
@@ -211,4 +218,42 @@ jQuery(function ($) {
211
 
212
  });
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  });
30
  }
31
  });
32
 
33
+ $('.menu_settings_menu_locations .mega-enabled input[type="checkbox"]').on("change", function() {
34
+ if ( $(this).is(":checked")) {
35
+ $(this).closest('.mega-location').removeClass('mega-location-disabled').addClass('mega-location-enabled');
36
+ } else {
37
+ $(this).closest('.mega-location').removeClass('mega-location-enabled').addClass('mega-location-disabled');
38
+ }
39
+ });
40
+
41
  if (typeof wp.codeEditor !== 'undefined' && typeof cm_settings !== 'undefined') {
42
  if ($('#codemirror').length) {
43
  wp.codeEditor.initialize($('#codemirror'), cm_settings);
127
  $(".theme_editor").on("submit", function(e) {
128
  e.preventDefault();
129
  $(".theme_result_message").remove();
130
+ var original_value = $("input#submit").attr('value');
131
+ $("input#submit").addClass('is-busy').attr('value', megamenu_settings.saving + "…");
132
  var memory_limit_link = $("<a>").attr('href', megamenu_settings.increase_memory_limit_url).html(megamenu_settings.increase_memory_limit_anchor_text);
133
 
134
  $.ajax({
165
 
166
  },
167
  complete: function() {
168
+ $("input#submit").removeClass('is-busy').attr('value', original_value);
 
169
  }
170
  });
171
 
218
 
219
  });
220
 
221
+ $(".mega-accordion-title").on('click', function(e) {
222
+ e.preventDefault();
223
+
224
+ var title = $(this);
225
+ var content = title.next('.mega-accordion-content');
226
+
227
+ $(".mega-accordion-content:visible").slideUp('fast');
228
+
229
+ if ( content.is(':hidden') ) {
230
+ content.slideDown('fast');
231
+ title.addClass('mega-accordion-open');
232
+ } else {
233
+ content.slideUp('fast');
234
+ title.removeClass('mega-accordion-open');
235
+ }
236
+
237
+ });
238
+
239
+ $(".mega-ellipsis").on('click', function(e) {
240
+ e.stopPropagation();
241
+
242
+ var ellipsis = $(this);
243
+
244
+ $(".mega-ellipsis").not(ellipsis).removeClass('mega-ellipsis-open');
245
+
246
+ if ( ellipsis.hasClass('mega-ellipsis-open') ) {
247
+ ellipsis.removeClass('mega-ellipsis-open');
248
+ } else {
249
+ ellipsis.addClass('mega-ellipsis-open');
250
+ }
251
+ });
252
+
253
+ $(document).on("click", function(e) { // hide menu when clicked away from
254
+ if ( ! $(e.target).closest(".mega-ellipsis").length ) {
255
+ $(".mega-ellipsis").removeClass('mega-ellipsis-open');
256
+ }
257
+ });
258
+
259
  });
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
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.8';
40
 
41
 
42
  /**
@@ -86,7 +86,7 @@ final class Mega_Menu {
86
  add_filter( 'megamenu_nav_menu_objects_after', array( $this, 'set_descriptions_if_enabled' ), 8, 2 );
87
  add_filter( 'body_class', array($this, 'add_megamenu_body_classes'), 10, 1);
88
 
89
- add_filter( 'megamenu_nav_menu_css_class', array( $this, 'prefix_menu_classes' ) );
90
 
91
  // plugin compatibility
92
  add_filter( 'conditional_menus_theme_location', array( $this, 'conditional_menus_restore_theme_location'), 10, 3 );
@@ -102,19 +102,33 @@ final class Mega_Menu {
102
  add_shortcode( 'maxmegamenu', array( $this, 'register_shortcode' ) );
103
 
104
  if ( is_admin() ) {
105
- new Mega_Menu_Nav_Menus();
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' ) ) {
113
  new Mega_Menu_Toggle_Blocks();
114
  }
115
 
116
- $mega_menu_style_manager = new Mega_Menu_Style_Manager();
117
- $mega_menu_style_manager->setup_actions();
 
 
 
118
  }
119
 
120
 
@@ -269,7 +283,9 @@ final class Mega_Menu {
269
  * @since 1.7.4
270
  */
271
  public function register_widget() {
272
- register_widget( 'Mega_Menu_Widget' );
 
 
273
  //register_widget( 'Mega_Menu_Widget_Reusable_Block' );
274
 
275
  // Check if Elementor installed and activated
@@ -347,17 +363,20 @@ final class Mega_Menu {
347
  */
348
  private function plugin_classes() {
349
  $classes = array(
350
- 'mega_menu_walker' => MEGAMENU_PATH . 'classes/walker.class.php',
351
- 'mega_menu_widget_manager' => MEGAMENU_PATH . 'classes/widget-manager.class.php',
352
- 'mega_menu_menu_item_manager' => MEGAMENU_PATH . 'classes/menu-item-manager.class.php',
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',
360
- 'mega_menu_toggle_blocks' => MEGAMENU_PATH . 'classes/toggle-blocks.class.php',
 
 
 
361
  'scssc' => MEGAMENU_PATH . 'classes/scssc.inc.php'
362
  );
363
 
@@ -371,26 +390,10 @@ final class Mega_Menu {
371
  * @since 1.0
372
  */
373
  private function includes() {
374
- $autoload_is_disabled = defined( 'MEGAMENU_AUTOLOAD_CLASSES' ) && MEGAMENU_AUTOLOAD_CLASSES === false;
375
-
376
- if ( function_exists( "spl_autoload_register" ) && ! $autoload_is_disabled ) {
377
-
378
- // >= PHP 5.2 - Use auto loading
379
- if ( function_exists( "__autoload" ) ) {
380
- spl_autoload_register( "__autoload" );
381
- }
382
-
383
- spl_autoload_register( array( $this, 'autoload' ) );
384
-
385
- } else {
386
-
387
- // < PHP5.2 - Require all classes
388
- foreach ( $this->plugin_classes() as $id => $path ) {
389
- if ( is_readable( $path ) && ! class_exists( $id ) ) {
390
- require_once $path;
391
- }
392
  }
393
-
394
  }
395
 
396
  $template = get_template();
@@ -408,7 +411,6 @@ final class Mega_Menu {
408
  default:
409
  break;
410
  }
411
-
412
  }
413
 
414
 
@@ -438,17 +440,22 @@ final class Mega_Menu {
438
  * @param array $classes
439
  * @return array
440
  */
441
- public function prefix_menu_classes( $classes ) {
442
  $return = array();
443
 
444
  foreach ( $classes as $class ) {
445
  $return[] = 'mega-' . $class;
446
  }
447
 
 
448
  $settings = get_option( 'megamenu_settings' );
449
 
450
  $prefix = isset( $settings['prefix'] ) ? $settings['prefix'] : 'enabled';
451
 
 
 
 
 
452
  if ( $prefix === 'disabled' ) {
453
  // add in custom classes, sans 'mega-' prefix
454
  foreach ( $classes as $class ) {
@@ -530,7 +537,6 @@ final class Mega_Menu {
530
 
531
  $items_to_move = array();
532
 
533
-
534
  foreach ( $items as $item ) {
535
 
536
  // populate standard (non-grid) sub menus
@@ -897,10 +903,15 @@ final class Mega_Menu {
897
  */
898
  public function set_descriptions_if_enabled( $items, $args ) {
899
 
 
900
  $settings = get_option( 'megamenu_settings' );
901
 
902
  $descriptions = isset( $settings['descriptions'] ) ? $settings['descriptions'] : 'disabled';
903
 
 
 
 
 
904
  if ($descriptions == 'enabled') {
905
  foreach ( $items as $item ) {
906
  if ( property_exists( $item, 'description' ) && strlen( $item->description ) ) {
@@ -1038,22 +1049,23 @@ final class Mega_Menu {
1038
  $settings = get_option( 'megamenu_settings' );
1039
  $current_theme_location = $args['theme_location'];
1040
 
1041
- $active_instance = isset( $settings['instances'][$current_theme_location] ) ? $settings['instances'][$current_theme_location] : 0;
 
 
 
 
 
 
1042
 
1043
  if ( $active_instance != '0' && strlen( $active_instance ) ) {
1044
-
1045
  if ( strpos( $active_instance, "," ) || is_numeric( $active_instance ) ) {
1046
-
1047
  $active_instances = explode( ",", $active_instance );
1048
 
1049
  if ( ! in_array( $num_times_called, $active_instances )) {
1050
  return $args;
1051
  }
1052
-
1053
  } else if ( isset( $args['container_id'] ) && $active_instance != $args['container_id'] ) {
1054
-
1055
  return $args;
1056
-
1057
  }
1058
  }
1059
 
@@ -1136,6 +1148,12 @@ final class Mega_Menu {
1136
  $effect_speed_mobile = $menu_settings['effect_speed_mobile'];
1137
  }
1138
 
 
 
 
 
 
 
1139
  if ( $effect_mobile == 'disabled' ) {
1140
  $effect_speed_mobile = 0;
1141
  }
@@ -1179,7 +1197,7 @@ final class Mega_Menu {
1179
 
1180
  $defaults = array(
1181
  'menu' => wp_get_nav_menu_object( $menu_id ),
1182
- 'container' => 'div',
1183
  'container_class' => 'mega-menu-wrap',
1184
  'container_id' => 'mega-menu-wrap-' . $sanitized_location,
1185
  'menu_class' => 'mega-menu max-mega-menu mega-menu-horizontal',
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.0.3
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.0.3';
40
 
41
 
42
  /**
86
  add_filter( 'megamenu_nav_menu_objects_after', array( $this, 'set_descriptions_if_enabled' ), 8, 2 );
87
  add_filter( 'body_class', array($this, 'add_megamenu_body_classes'), 10, 1);
88
 
89
+ add_filter( 'megamenu_nav_menu_css_class', array( $this, 'prefix_menu_classes' ), 10, 3 );
90
 
91
  // plugin compatibility
92
  add_filter( 'conditional_menus_theme_location', array( $this, 'conditional_menus_restore_theme_location'), 10, 3 );
102
  add_shortcode( 'maxmegamenu', array( $this, 'register_shortcode' ) );
103
 
104
  if ( is_admin() ) {
105
+ $admin_classes = array(
106
+ "Mega_Menu_Nav_Menus",
107
+ "Mega_Menu_Widget_Manager",
108
+ "Mega_Menu_Menu_Item_Manager",
109
+ "Mega_Menu_Page",
110
+ "Mega_Menu_General",
111
+ "Mega_Menu_Locations",
112
+ "Mega_Menu_Themes",
113
+ "Mega_Menu_Tools"
114
+ );
115
+
116
+ foreach ( $admin_classes as $class ) {
117
+ if ( class_exists( $class ) ) {
118
+ new $class();
119
+ }
120
+ }
121
  }
122
 
123
+ if ( class_exists( "Mega_Menu_Toggle_Blocks" ) ) {
124
  new Mega_Menu_Toggle_Blocks();
125
  }
126
 
127
+ if ( class_exists( "Mega_Menu_Style_Manager" ) ) {
128
+ $mega_menu_style_manager = new Mega_Menu_Style_Manager();
129
+ $mega_menu_style_manager->setup_actions();
130
+ }
131
+
132
  }
133
 
134
 
283
  * @since 1.7.4
284
  */
285
  public function register_widget() {
286
+ if ( class_exists( "Mega_Menu_Widget") ) {
287
+ register_widget( 'Mega_Menu_Widget' );
288
+ }
289
  //register_widget( 'Mega_Menu_Widget_Reusable_Block' );
290
 
291
  // Check if Elementor installed and activated
363
  */
364
  private function plugin_classes() {
365
  $classes = array(
366
+ 'Mega_Menu_Walker' => MEGAMENU_PATH . 'classes/walker.class.php',
367
+ 'Mega_Menu_Widget_Manager' => MEGAMENU_PATH . 'classes/widget-manager.class.php',
368
+ 'Mega_Menu_Menu_item_Manager' => MEGAMENU_PATH . 'classes/menu-item-manager.class.php',
369
+ 'Mega_Menu_Nav_Menus' => MEGAMENU_PATH . 'classes/nav-menus.class.php',
370
+ 'Mega_Menu_Style_Manager' => MEGAMENU_PATH . 'classes/style-manager.class.php',
371
+ 'Mega_Menu_Page' => MEGAMENU_PATH . 'classes/pages/page.php',
372
+ 'Mega_Menu_General' => MEGAMENU_PATH . 'classes/pages/general.php',
373
+ 'Mega_Menu_Locations' => MEGAMENU_PATH . 'classes/pages/locations.php',
374
+ 'Mega_Menu_Themes' => MEGAMENU_PATH . 'classes/pages/themes.php',
375
+ 'Mega_Menu_Tools' => MEGAMENU_PATH . 'classes/pages/tools.php',
376
+ 'Mega_Menu_Widget' => MEGAMENU_PATH . 'classes/widgets/widget.class.php',
377
+ 'Mega_Menu_Widget_Reusable_Block' => MEGAMENU_PATH . 'classes/widgets/widget-reusable-block.class.php',
378
+ 'Mega_Menu_Widget_Elementor_Template' => MEGAMENU_PATH . 'classes/widgets/widget-elementor-template.class.php',
379
+ 'Mega_Menu_toggle_Blocks' => MEGAMENU_PATH . 'classes/toggle-blocks.class.php',
380
  'scssc' => MEGAMENU_PATH . 'classes/scssc.inc.php'
381
  );
382
 
390
  * @since 1.0
391
  */
392
  private function includes() {
393
+ foreach ( $this->plugin_classes() as $id => $path ) {
394
+ if ( is_readable( $path ) && ! class_exists( $id ) ) {
395
+ require_once $path;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  }
 
397
  }
398
 
399
  $template = get_template();
411
  default:
412
  break;
413
  }
 
414
  }
415
 
416
 
440
  * @param array $classes
441
  * @return array
442
  */
443
+ public function prefix_menu_classes( $classes, $item, $args ) {
444
  $return = array();
445
 
446
  foreach ( $classes as $class ) {
447
  $return[] = 'mega-' . $class;
448
  }
449
 
450
+ $location = $args->theme_location;
451
  $settings = get_option( 'megamenu_settings' );
452
 
453
  $prefix = isset( $settings['prefix'] ) ? $settings['prefix'] : 'enabled';
454
 
455
+ if ( isset( $settings[$location]['prefix'] ) ) {
456
+ $prefix = $settings[$location]['prefix'];
457
+ }
458
+
459
  if ( $prefix === 'disabled' ) {
460
  // add in custom classes, sans 'mega-' prefix
461
  foreach ( $classes as $class ) {
537
 
538
  $items_to_move = array();
539
 
 
540
  foreach ( $items as $item ) {
541
 
542
  // populate standard (non-grid) sub menus
903
  */
904
  public function set_descriptions_if_enabled( $items, $args ) {
905
 
906
+ $location = $args->theme_location;
907
  $settings = get_option( 'megamenu_settings' );
908
 
909
  $descriptions = isset( $settings['descriptions'] ) ? $settings['descriptions'] : 'disabled';
910
 
911
+ if ( isset( $settings[$location]['descriptions'] ) ) {
912
+ $descriptions = $settings[$location]['descriptions'];
913
+ }
914
+
915
  if ($descriptions == 'enabled') {
916
  foreach ( $items as $item ) {
917
  if ( property_exists( $item, 'description' ) && strlen( $item->description ) ) {
1049
  $settings = get_option( 'megamenu_settings' );
1050
  $current_theme_location = $args['theme_location'];
1051
 
1052
+ $active_instance = 0;
1053
+
1054
+ if ( isset( $settings[$current_theme_location]['active_instance'] ) ) {
1055
+ $active_instance = $settings[$current_theme_location]['active_instance'];
1056
+ } else if ( isset( $settings['instances'][$current_theme_location] ) ) {
1057
+ $active_instance = $settings['instances'][$current_theme_location];
1058
+ }
1059
 
1060
  if ( $active_instance != '0' && strlen( $active_instance ) ) {
 
1061
  if ( strpos( $active_instance, "," ) || is_numeric( $active_instance ) ) {
 
1062
  $active_instances = explode( ",", $active_instance );
1063
 
1064
  if ( ! in_array( $num_times_called, $active_instances )) {
1065
  return $args;
1066
  }
 
1067
  } else if ( isset( $args['container_id'] ) && $active_instance != $args['container_id'] ) {
 
1068
  return $args;
 
1069
  }
1070
  }
1071
 
1148
  $effect_speed_mobile = $menu_settings['effect_speed_mobile'];
1149
  }
1150
 
1151
+ $container = 'div';
1152
+
1153
+ if ( isset( $menu_settings['container'] ) ) {
1154
+ $container = $menu_settings['container'];
1155
+ }
1156
+
1157
  if ( $effect_mobile == 'disabled' ) {
1158
  $effect_speed_mobile = 0;
1159
  }
1197
 
1198
  $defaults = array(
1199
  'menu' => wp_get_nav_menu_object( $menu_id ),
1200
+ 'container' => $container,
1201
  'container_class' => 'mega-menu-wrap',
1202
  'container_id' => 'mega-menu-wrap-' . $sanitized_location,
1203
  'menu_class' => 'mega-menu max-mega-menu mega-menu-horizontal',
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
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -133,13 +133,19 @@ See https://www.megamenu.com for more screenshots
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
 
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.8
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.1 =
137
+
138
+ * Improvement: Add overflow-behaviour to offcanvas menu
139
+ * Fix: Indent third level items in mobile menu
140
+ * Fix: Divi adding linting to Custom CSS area of menu theme
141
+
142
  = 2.8 =
143
 
144
  * New: Allow menu location settings to be adjusted from the Mega Menu > Menu Locations page
145
  * Fix: Trim "Panel Width" settings in theme editor to prevent attributes from being malformed
146
  * Fix: Hover text decoration not applied when Icon Position is set to "Top"
147
  * Fix: Divi reload bug, ensure sidebar is registered on front and back end
148
+ * Fix: Collapsable sub menus open and close themselves in mobile view
149
 
150
  = 2.7.7 =
151