PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.4
Shortcodes and extra features for Phlox theme v2.17.4
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / responsive-table.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 1 year ago accordion.php 1 year ago audio.php 4 years ago before-after.php 3 years ago button.php 1 year ago carousel-navigation.php 4 years ago circle-chart.php 1 year ago contact-box.php 4 years ago contact-form.php 1 year ago custom-list.php 1 year ago divider.php 4 years ago gallery.php 1 year ago gmap.php 4 years ago heading-modern.php 1 year ago icon.php 1 year ago image.php 1 year ago mailchimp.php 1 year ago modern-button.php 1 year ago products-grid.php 1 year ago quote.php 1 year ago recent-comments.php 1 year ago recent-posts-grid-carousel.php 1 year ago recent-posts-land-style.php 1 year ago recent-posts-masonry.php 1 year ago recent-posts-tiles-carousel.php 1 year ago recent-posts-tiles.php 1 year ago recent-posts-timeline.php 1 year ago recent-products.php 1 year ago responsive-table.php 1 year ago search.php 4 years ago staff.php 1 year ago svg.php 1 year ago tabs.php 1 year ago testimonial.php 1 year ago text.php 1 year ago touch-slider.php 1 year ago video.php 4 years ago
responsive-table.php
362 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Typography;
8 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
9 use Elementor\Group_Control_Background;
10
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly.
14 }
15
16 /**
17 * Elementor 'Responsive Table' widget.
18 *
19 * Elementor widget that displays an 'Responsive Table' with lightbox.
20 *
21 * @since 1.0.0
22 */
23 class ResponsiveTable extends Widget_Base {
24
25 /**
26 * Get widget name.
27 *
28 * Retrieve 'Responsive Table' widget name.
29 *
30 * @since 1.0.0
31 * @access public
32 *
33 * @return string Widget name.
34 */
35 public function get_name() {
36 return 'aux_responsive_table';
37 }
38
39 /**
40 * Get widget title.
41 *
42 * Retrieve 'Responsive Table' widget title.
43 *
44 * @since 1.0.0
45 * @access public
46 *
47 * @return string Widget title.
48 */
49 public function get_title() {
50 return __('Responsive Table', 'auxin-elements' );
51 }
52
53 /**
54 * Get widget icon.
55 *
56 * Retrieve 'Responsive Table' widget icon.
57 *
58 * @since 1.0.0
59 * @access public
60 *
61 * @return string Widget icon.
62 */
63 public function get_icon() {
64 return 'eicon-table auxin-badge';
65 }
66
67 /**
68 * Get widget categories.
69 *
70 * Retrieve 'Responsive Table' widget icon.
71 *
72 * @since 1.0.0
73 * @access public
74 *
75 * @return string Widget icon.
76 */
77 public function get_categories() {
78 return array( 'auxin-core' );
79 }
80
81 public function get_script_depends() {
82 return ['stacktable'];
83 }
84
85 /**
86 * Register 'Responsive Table' widget controls.
87 *
88 * Adds different input fields to allow the user to change and customize the widget settings.
89 *
90 * @since 1.0.0
91 * @access protected
92 */
93 protected function register_controls() {
94
95 /*-----------------------------------------------------------------------------------*/
96 /* Content TAB
97 /*-----------------------------------------------------------------------------------*/
98
99 $this->start_controls_section(
100 'table_markup_section',
101 array(
102 'label' => __('Table Markup', 'auxin-elements' ),
103 )
104 );
105
106 $this->add_control(
107 'table_markup',
108 array(
109 'label' => '',
110 'type' => Controls_Manager::CODE,
111 'show_label' => false,
112 )
113 );
114
115 $this->end_controls_section();
116
117
118 /*-----------------------------------------------------------------------------------*/
119 /* Style TAB
120 /*-----------------------------------------------------------------------------------*/
121
122 $this->start_controls_section(
123 'table_body_section',
124 array(
125 'label' => __( 'Table Body', 'auxin-elements' ),
126 'tab' => Controls_Manager::TAB_STYLE
127 )
128 );
129
130 $this->add_responsive_control(
131 'table_body_alignment',
132 array(
133 'label' => __('Alignment','auxin-elements' ),
134 'type' => Controls_Manager::CHOOSE,
135 'options' => array(
136 'left' => array(
137 'title' => __( 'Left', 'auxin-elements' ),
138 'icon' => 'eicon-text-align-left',
139 ),
140 'center' => array(
141 'title' => __( 'Center', 'auxin-elements' ),
142 'icon' => 'eicon-text-align-center',
143 ),
144 'right' => array(
145 'title' => __( 'Right', 'auxin-elements' ),
146 'icon' => 'eicon-text-align-right',
147 )
148 ),
149 'default' => '',
150 'toggle' => true,
151 'selectors' => array(
152 '{{WRAPPER}} td' => 'text-align:{{VALUE}};',
153 ),
154 'separator' => 'after'
155 )
156 );
157
158 $this->add_group_control(
159 Group_Control_Background::get_type(),
160 array(
161 'name' => 'table_body_background_normal',
162 'selector' => '{{WRAPPER}} td',
163 'separator' => 'none'
164 )
165 );
166
167 $this->add_group_control(
168 Group_Control_Typography::get_type(),
169 array(
170 'name' => 'table_body_typography',
171 'global' => [
172 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
173 ],
174 'selector' => '{{WRAPPER}} td'
175 )
176 );
177
178 $this->add_control(
179 'table_body_color',
180 array(
181 'label' => __( 'Color', 'auxin-elements' ),
182 'type' => Controls_Manager::COLOR,
183 'selectors' => array(
184 '{{WRAPPER}} td' => 'color:{{VALUE}};'
185 )
186 )
187 );
188
189 $this->end_controls_section();
190
191 $this->start_controls_section(
192 'table_head_section',
193 array(
194 'label' => __( 'Table Heading', 'auxin-elements' ),
195 'tab' => Controls_Manager::TAB_STYLE
196 )
197 );
198
199 $this->add_responsive_control(
200 'table_head_alignment',
201 array(
202 'label' => __('Alignment','auxin-elements' ),
203 'type' => Controls_Manager::CHOOSE,
204 'options' => array(
205 'left' => array(
206 'title' => __( 'Left', 'auxin-elements' ),
207 'icon' => 'eicon-text-align-left',
208 ),
209 'center' => array(
210 'title' => __( 'Center', 'auxin-elements' ),
211 'icon' => 'eicon-text-align-center',
212 ),
213 'right' => array(
214 'title' => __( 'Right', 'auxin-elements' ),
215 'icon' => 'eicon-text-align-right',
216 )
217 ),
218 'default' => '',
219 'toggle' => true,
220 'selectors' => array(
221 '{{WRAPPER}} th' => 'text-align:{{VALUE}};',
222 ),
223 'separator' => 'after'
224 )
225 );
226
227 $this->add_group_control(
228 Group_Control_Background::get_type(),
229 array(
230 'name' => 'table_head_background_normal',
231 'selector' => '{{WRAPPER}} th',
232 'separator' => 'none'
233 )
234 );
235
236 $this->add_group_control(
237 Group_Control_Typography::get_type(),
238 array(
239 'name' => 'table_head_typography',
240 'global' => [
241 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
242 ],
243 'selector' => '{{WRAPPER}} th'
244 )
245 );
246
247 $this->add_control(
248 'table_head_color',
249 array(
250 'label' => __( 'Color', 'auxin-elements' ),
251 'type' => Controls_Manager::COLOR,
252 'selectors' => array(
253 '{{WRAPPER}} th' => 'color:{{VALUE}};'
254 )
255 )
256 );
257
258 $this->end_controls_section();
259
260 $this->start_controls_section(
261 'table_odd_row_section',
262 array(
263 'label' => __( 'Table Odd Rows', 'auxin-elements' ),
264 'tab' => Controls_Manager::TAB_STYLE
265 )
266 );
267
268 $this->add_group_control(
269 Group_Control_Background::get_type(),
270 array(
271 'name' => 'table_odd_background_normal',
272 'selector' => '{{WRAPPER}} tr:nth-child(2n+1)',
273 'separator' => 'none'
274 )
275 );
276
277 $this->add_control(
278 'table_odd_row_color',
279 array(
280 'label' => __( 'Color', 'auxin-elements' ),
281 'type' => Controls_Manager::COLOR,
282 'selectors' => array(
283 '{{WRAPPER}} {{WRAPPER}} tr:nth-child(2n+1)' => 'color:{{VALUE}};'
284 )
285 )
286 );
287
288 $this->end_controls_section();
289
290 $this->start_controls_section(
291 'table_even_row_section',
292 array(
293 'label' => __( 'Table Even Rows', 'auxin-elements' ),
294 'tab' => Controls_Manager::TAB_STYLE
295 )
296 );
297
298 $this->add_group_control(
299 Group_Control_Background::get_type(),
300 array(
301 'name' => 'table_even_row_background_normal',
302 'selector' => '{{WRAPPER}} tr:nth-child(2n)',
303 'separator' => 'none'
304 )
305 );
306
307 $this->add_control(
308 'table_even_row_color',
309 array(
310 'label' => __( 'Color', 'auxin-elements' ),
311 'type' => Controls_Manager::COLOR,
312 'selectors' => array(
313 '{{WRAPPER}} {{WRAPPER}} tr:nth-child(2n)' => 'color:{{VALUE}};'
314 )
315 )
316 );
317
318 $this->end_controls_section();
319 }
320
321 /**
322 * Render 'Tabs' widget output on the frontend.
323 *
324 * Written in PHP and used to generate the final HTML.
325 *
326 * @since 1.0.0
327 * @access protected
328 */
329 protected function render() {
330
331 $settings = $this->get_settings_for_display();
332
333 $this->add_render_attribute( 'wrapper', 'class', 'widget-container aux-widget-responsive-table' );
334 $this->add_render_attribute( 'inner', 'class', 'widget-inner' );
335
336 ?>
337 <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?> >
338 <div <?php echo $this->get_render_attribute_string( 'inner' ); ?> >
339 <?php echo wp_kses_post( $settings['table_markup'] );?>
340 </div>
341 </div>
342 <?php
343 }
344
345
346 /**
347 * Render responsive table element in the editor.
348 *
349 * @access protected
350 */
351 protected function content_template() {
352 ?>
353 <div class="widget-container widget-responsive-table">
354 <div class="widget-inner">
355 {{{ settings.table_markup }}}
356 </div>
357 </div>
358 <?php
359 }
360
361 }
362