PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.0-beta1
Elementor Website Builder – more than just a page builder v3.34.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / modules / atomic-widgets / elements / atomic-tabs / atomic-tabs-content-area.php

atomic-tabs-content-area.php in Elementor Website Builder – more than just a page builder 3.34.0-beta1, at modules/atomic-widgets/elements/atomic-tabs/atomic-tabs-content-area.php

106 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Tabs;
3
4 use Elementor\Modules\AtomicWidgets\Elements\Atomic_Element_Base;
5 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type;
6 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
7 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
8 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
9 use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
10 use Elementor\Modules\AtomicWidgets\Controls\Section;
11 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
12 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
13 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
14
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit; // Exit if accessed directly.
18 }
19
20 class Atomic_Tabs_Content_Area extends Atomic_Element_Base {
21 const BASE_STYLE_KEY = 'base';
22
23 public static function get_type() {
24 return 'e-tabs-content-area';
25 }
26
27 public static function get_element_type(): string {
28 return 'e-tabs-content-area';
29 }
30
31 public function get_title() {
32 return esc_html__( 'Tabs content area', 'elementor' );
33 }
34
35 public function get_keywords() {
36 return [ 'ato', 'atom', 'atoms', 'atomic' ];
37 }
38
39 public function get_icon() {
40 return 'eicon-tab-content';
41 }
42
43 public function should_show_in_panel() {
44 return false;
45 }
46
47 protected static function define_props_schema(): array {
48 return [
49 'classes' => Classes_Prop_Type::make()
50 ->default( [] ),
51 'attributes' => Attributes_Prop_Type::make(),
52 ];
53 }
54
55 protected function define_atomic_controls(): array {
56 return [
57 Section::make()
58 ->set_label( __( 'Settings', 'elementor' ) )
59 ->set_id( 'settings' )
60 ->set_items( [
61 Text_Control::bind_to( '_cssid' )
62 ->set_label( __( 'ID', 'elementor' ) )
63 ->set_meta( [
64 'layout' => 'two-columns',
65 ] ),
66 ] ),
67 ];
68 }
69
70 protected function define_base_styles(): array {
71 $styles = [
72 'display' => String_Prop_Type::generate( 'block' ),
73 ];
74
75 return [
76 static::BASE_STYLE_KEY => Style_Definition::make()
77 ->add_variant(
78 Style_Variant::make()
79 ->add_props( $styles )
80 ),
81 ];
82 }
83
84 protected function add_render_attributes() {
85 parent::add_render_attributes();
86 $settings = $this->get_atomic_settings();
87 $base_style_class = $this->get_base_styles_dictionary()[ static::BASE_STYLE_KEY ];
88 $initial_attributes = $this->define_initial_attributes();
89
90 $attributes = [
91 'class' => [
92 'e-con',
93 'e-atomic-element',
94 $base_style_class,
95 ...( $settings['classes'] ?? [] ),
96 ],
97 ];
98
99 if ( ! empty( $settings['_cssid'] ) ) {
100 $attributes['id'] = esc_attr( $settings['_cssid'] );
101 }
102
103 $this->add_render_attribute( '_wrapper', array_merge( $initial_attributes, $attributes ) );
104 }
105 }
106