PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.2
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.2
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / inc / modules / display / extras / extras.php

extras.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.2, at inc/modules/display/extras/extras.php

212 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MasterAddons\Modules\Display;
4
5 use \Elementor\Controls_Manager;
6
7 /**
8 * Author Name: Liton Arefin
9 * Author URL: https://jeweltheme.com
10 * Date: 1/2/20
11 */
12
13 if (!defined('ABSPATH')) {
14 exit;
15 } // Exit if accessed directly.
16
17 if (!class_exists('MasterAddons\Modules\Display\Extras')) {
18 class Extras
19 {
20
21 /*
22 * Instance of this class
23 */
24 private static $instance = null;
25
26
27 public function __construct()
28 {
29
30 // Add new controls to advanced tab globally
31 add_action("elementor/element/after_section_end", array($this, 'jltma_section_add_extra_controls'), 19, 3);
32 }
33
34
35 public function jltma_section_add_extra_controls($widget, $section_id, $args)
36 {
37 // Only show for container, section, and column - not widgets
38 $allowed_types = array('container', 'section', 'column');
39 $element_type = $widget->get_type();
40
41 if (!in_array($element_type, $allowed_types)) {
42 return;
43 }
44
45 // Anchor element sections
46 $target_sections = array('section_custom_css');
47
48 if (!defined('ELEMENTOR_PRO_VERSION')) {
49 $target_sections[] = 'section_custom_css_pro';
50 }
51
52 if (!in_array($section_id, $target_sections)) {
53 return;
54 }
55
56 // Adds extra options
57 // ---------------------------------------------------------------------
58 $widget->start_controls_section(
59 'ma_el_section_advanced_container_extra',
60 array(
61 'label' => __('Container Extra', 'master-addons' ) . JLTMA_EXTENSION_BADGE,
62 'tab' => Controls_Manager::TAB_ADVANCED
63 )
64 );
65
66 $widget->add_responsive_control(
67 'ma_el_max_width',
68 array(
69 'label' => __('Max Width', 'master-addons' ),
70 'type' => Controls_Manager::SLIDER,
71 'size_units' => array('px', 'em', '%', 'vw'),
72 'range' => array(
73 'px' => array(
74 'min' => 0,
75 'step' => 1
76 ),
77 '%' => array(
78 'min' => 0,
79 'max' => 100,
80 'step' => 1
81 ),
82 'em' => array(
83 'min' => 0,
84 'step' => 1
85 ),
86 'vw' => array(
87 'min' => 0,
88 'max' => 100,
89 'step' => 1
90 )
91 ),
92 'selectors' => array(
93 '{{WRAPPER}}' => 'max-width:{{SIZE}}{{UNIT}};'
94 )
95 )
96 );
97
98 $widget->add_responsive_control(
99 'ma_el_max_height',
100 array(
101 'label' => __('Max Height', 'master-addons' ),
102 'type' => Controls_Manager::SLIDER,
103 'size_units' => array('px', 'em', '%', 'vh'),
104 'range' => array(
105 'px' => array(
106 'min' => 0,
107 'step' => 1
108 ),
109 '%' => array(
110 'min' => 0,
111 'max' => 100,
112 'step' => 1
113 ),
114 'em' => array(
115 'min' => 0,
116 'step' => 1
117 ),
118 'vh' => array(
119 'min' => 0,
120 'max' => 100,
121 'step' => 1
122 )
123 ),
124 'selectors' => array(
125 '{{WRAPPER}}' => 'max-height:{{SIZE}}{{UNIT}};'
126 ),
127 'separator' => 'after'
128 )
129 );
130
131 $widget->add_responsive_control(
132 'ma_el_min_width',
133 array(
134 'label' => __('Min Width', 'master-addons' ),
135 'type' => Controls_Manager::SLIDER,
136 'size_units' => array('px', 'em', '%', 'vw'),
137 'range' => array(
138 'px' => array(
139 'min' => 0,
140 'step' => 1
141 ),
142 '%' => array(
143 'min' => 0,
144 'max' => 100,
145 'step' => 1
146 ),
147 'em' => array(
148 'min' => 0,
149 'step' => 1
150 ),
151 'vw' => array(
152 'min' => 0,
153 'max' => 100,
154 'step' => 1
155 )
156 ),
157 'selectors' => array(
158 '{{WRAPPER}}' => 'min-width:{{SIZE}}{{UNIT}};'
159 )
160 )
161 );
162
163 $widget->add_responsive_control(
164 'ma_el_min_height',
165 array(
166 'label' => __('Min Height', 'master-addons' ),
167 'type' => Controls_Manager::SLIDER,
168 'size_units' => array('px', 'em', '%', 'vh'),
169 'range' => array(
170 'px' => array(
171 'min' => 0,
172 'step' => 1
173 ),
174 '%' => array(
175 'min' => 0,
176 'max' => 100,
177 'step' => 1
178 ),
179 'em' => array(
180 'min' => 0,
181 'step' => 1
182 ),
183 'vh' => array(
184 'min' => 0,
185 'max' => 100,
186 'step' => 1
187 )
188 ),
189 'selectors' => array(
190 '{{WRAPPER}}' => 'min-height:{{SIZE}}{{UNIT}};'
191 )
192 )
193 );
194
195 $widget->end_controls_section();
196 }
197
198
199 public static function get_instance()
200 {
201 if (!self::$instance) {
202 self::$instance = new self;
203 }
204 return self::$instance;
205 }
206 }
207 }
208
209 if (class_exists('MasterAddons\Modules\Display\Extras')) {
210 Extras::get_instance();
211 }
212