elementor
/
modules
/
atomic-widgets
/
elements
/
atomic-tabs
/
atomic-tabs-content-area
/
atomic-tabs-content-area.php
atomic-tabs-content-area.php in Elementor Website Builder – more than just a page builder 4.0.0-dev4, at modules/atomic-widgets/elements/atomic-tabs/atomic-tabs-content-area/atomic-tabs-content-area.php
| 1 | <?php |
| 2 | namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Tabs\Atomic_Tabs_Content_Area; |
| 3 | |
| 4 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 5 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 6 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type; |
| 7 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 8 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 9 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| 10 | use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| 11 | use Elementor\Modules\AtomicWidgets\Controls\Section; |
| 12 | use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control; |
| 13 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 14 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 15 | use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type; |
| 16 | |
| 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | exit; // Exit if accessed directly. |
| 19 | } |
| 20 | |
| 21 | class Atomic_Tabs_Content_Area extends Atomic_Element_Base { |
| 22 | use Has_Element_Template; |
| 23 | |
| 24 | const BASE_STYLE_KEY = 'base'; |
| 25 | |
| 26 | public function __construct( $data = [], $args = null ) { |
| 27 | parent::__construct( $data, $args ); |
| 28 | $this->meta( 'llm_support', false ); |
| 29 | } |
| 30 | |
| 31 | public static function get_type() { |
| 32 | return 'e-tabs-content-area'; |
| 33 | } |
| 34 | |
| 35 | public static function get_element_type(): string { |
| 36 | return 'e-tabs-content-area'; |
| 37 | } |
| 38 | |
| 39 | public function get_title() { |
| 40 | return esc_html__( 'Tabs content area', 'elementor' ); |
| 41 | } |
| 42 | |
| 43 | public function get_keywords() { |
| 44 | return [ 'ato', 'atom', 'atoms', 'atomic' ]; |
| 45 | } |
| 46 | |
| 47 | public function get_icon() { |
| 48 | return 'eicon-tab-content'; |
| 49 | } |
| 50 | |
| 51 | public function should_show_in_panel() { |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | protected static function define_props_schema(): array { |
| 56 | return [ |
| 57 | 'classes' => Classes_Prop_Type::make() |
| 58 | ->default( [] ), |
| 59 | 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ), |
| 60 | ]; |
| 61 | } |
| 62 | |
| 63 | protected function define_atomic_controls(): array { |
| 64 | return [ |
| 65 | Section::make() |
| 66 | ->set_label( __( 'Settings', 'elementor' ) ) |
| 67 | ->set_id( 'settings' ) |
| 68 | ->set_items( [ |
| 69 | Text_Control::bind_to( '_cssid' ) |
| 70 | ->set_label( __( 'ID', 'elementor' ) ) |
| 71 | ->set_meta( [ |
| 72 | 'layout' => 'two-columns', |
| 73 | ] ), |
| 74 | ] ), |
| 75 | ]; |
| 76 | } |
| 77 | |
| 78 | protected function define_base_styles(): array { |
| 79 | $styles = [ |
| 80 | 'display' => String_Prop_Type::generate( 'block' ), |
| 81 | ]; |
| 82 | |
| 83 | return [ |
| 84 | static::BASE_STYLE_KEY => Style_Definition::make() |
| 85 | ->add_variant( |
| 86 | Style_Variant::make() |
| 87 | ->add_props( $styles ) |
| 88 | ), |
| 89 | ]; |
| 90 | } |
| 91 | |
| 92 | protected function get_templates(): array { |
| 93 | return [ |
| 94 | 'elementor/elements/atomic-tabs-content-area' => __DIR__ . '/atomic-tabs-content-area.html.twig', |
| 95 | ]; |
| 96 | } |
| 97 | |
| 98 | protected function define_allowed_child_types() { |
| 99 | return [ 'e-tab-content', 'container' ]; |
| 100 | } |
| 101 | } |
| 102 |