PluginProbe
QuadMenu – Mega Menu / trunk
QuadMenu – Mega Menu vtrunk
3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 87 releases
quadmenu / lib / integrations / divi / modules / QuadMenu / QuadMenu.php

QuadMenu.php in QuadMenu – Mega Menu trunk, at lib/integrations/divi/modules/QuadMenu/QuadMenu.php

108 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class ET_Builder_Module_QuadMenu extends \ET_Builder_Module {
4
5 public $slug = 'et_pb_quadmenu';
6 public $vb_support = 'on';
7 public $fullwidth = true;
8 public $main_css_element = '%%order_class%%.et_pb_quadmenu';
9 protected $module_credits = array(
10 'module_uri' => 'https://quadmenu.com',
11 'author' => 'QuadLayers',
12 'author_uri' => 'https://www.quadlayers.com',
13 );
14
15 function init() {
16 $this->name = esc_html__( 'QuadMenu', 'quadmenu' );
17
18 $this->settings_modal_toggles = array(
19 'general' => array(
20 'toggles' => array(
21 'main_content' => esc_html__( 'Settings', 'quadmenu' ),
22 ),
23 ),
24 'advanced' => array(
25 'toggles' => array(
26 'width' => array(
27 'title' => esc_html__( 'Width', 'quadmenu' ),
28 'priority' => 65,
29 ),
30 ),
31 ),
32 );
33
34 $this->advanced_fields = array(
35 // 'background' => array(
36 // 'background_image' => false,
37 // ),
38 'link' => false,
39 'spacing' => false,
40 'filters' => false,
41 'animation' => false,
42 'text' => false,
43 'borders' => array(
44 'default' => false,
45 ),
46 'margin_padding' => array(
47 'css' => array(
48 'important' => array( 'custom_margin' ), // needed to overwrite last module margin-bottom styling
49 ),
50 ),
51 'text_shadow' => array(
52 // Don't add text-shadow fields since they already are via font-options
53 'default' => false,
54 ),
55 'box_shadow' => array(
56 'default' => false,
57 ),
58 'fonts' => false,
59 'button' => false,
60 );
61 }
62
63 function get_fields() {
64
65 $menus = et_builder_get_nav_menus_options();
66
67 $menu_id = array_keys( $menus )[1];
68
69 $fields = array(
70 'menu_id' => array(
71 'label' => esc_html__( 'Menu', 'quadmenu' ),
72 'type' => 'select',
73 'option_category' => 'basic_option',
74 'options' => $menus,
75 'description' => sprintf( '%s <a href="%s" target="_blank">%s</a>', esc_html__( 'Select a menu that should be used in the module', 'quadmenu' ), esc_url( admin_url( 'nav-menus.php' ) ), esc_html__( 'Click here to create new menu', 'quadmenu' ) ),
76 'toggle_slug' => 'main_content',
77 'default' => $menu_id,
78 ),
79 'menu_theme' => array(
80 'label' => esc_html__( 'Theme', 'quadmenu' ),
81 'type' => 'select',
82 'option_category' => 'basic_option',
83 'options' => array_flip( quadmenu_vc_themes() ),
84 'description' => sprintf( '%s. <a href="%s" target="_blank">%s</a>', esc_html__( 'Select a the theme that should be used in the menu', 'quadmenu' ), esc_url( admin_url( 'admin.php?page=' . QUADMENU_PANEL ) ), esc_html__( 'Click here to create new theme', 'quadmenu' ) ),
85 'toggle_slug' => 'main_content',
86 'default' => 'default_theme',
87 'default_on_front' => 'default_theme',
88 ),
89 );
90
91 return $fields;
92 }
93
94 function render( $attrs, $content, $render_slug ) {
95 $this->props['content'] = quadmenu(
96 array(
97 'echo' => false,
98 'layout_classes' => 'js',
99 'menu' => $this->props['menu_id'],
100 'theme' => $this->props['menu_theme'],
101 )
102 );
103 return sprintf( '<div class="et_pb_row et_pb_fullwidth_menu clearfix">%1$s</div>', $this->props['content'] );
104 }
105 }
106
107 new ET_Builder_Module_QuadMenu();
108