| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985 |
- <?php
- namespace Elementor;
- if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly.
- }
- /**
- * Elementor column element.
- *
- * Elementor column handler class is responsible for initializing the column
- * element.
- *
- * @since 1.0.0
- */
- class Element_Column extends Element_Base {
- /**
- * Element edit tools.
- *
- * Holds all the edit tools of the element. For example: delete, duplicate etc.
- *
- * @access protected
- * @static
- *
- * @var array
- */
- protected static $_edit_tools;
- /**
- * Get column name.
- *
- * Retrieve the column name.
- *
- * @since 1.0.0
- * @access public
- *
- * @return string Column name.
- */
- public function get_name() {
- return 'column';
- }
- /**
- * Get element type.
- *
- * Retrieve the element type, in this case `column`.
- *
- * @since 2.1.0
- * @access public
- * @static
- *
- * @return string The type.
- */
- public static function get_type() {
- return 'column';
- }
- /**
- * Get column title.
- *
- * Retrieve the column title.
- *
- * @since 1.0.0
- * @access public
- *
- * @return string Column title.
- */
- public function get_title() {
- return __( 'Column', 'elementor' );
- }
- /**
- * Get column icon.
- *
- * Retrieve the column icon.
- *
- * @since 1.0.0
- * @access public
- *
- * @return string Column icon.
- */
- public function get_icon() {
- return 'eicon-column';
- }
- /**
- * Get default edit tools.
- *
- * Retrieve the element default edit tools. Used to set initial tools.
- *
- * @since 2.1.0
- * @access protected
- * @static
- *
- * @return array Default edit tools.
- */
- protected static function get_default_edit_tools() {
- $column_label = __( 'Column', 'elementor' );
- $edit_tools = [
- 'edit' => [
- 'title' => __( 'Edit', 'elementor' ),
- 'icon' => 'column',
- ],
- ];
- if ( self::is_edit_buttons_enabled() ) {
- $edit_tools += [
- 'duplicate' => [
- /* translators: %s: Column label */
- 'title' => sprintf( __( 'Duplicate %s', 'elementor' ), $column_label ),
- 'icon' => 'clone',
- ],
- 'add' => [
- /* translators: %s: Column label */
- 'title' => sprintf( __( 'Add %s', 'elementor' ), $column_label ),
- 'icon' => 'plus',
- ],
- 'remove' => [
- /* translators: %s: Column label */
- 'title' => sprintf( __( 'Remove %s', 'elementor' ), $column_label ),
- 'icon' => 'close',
- ],
- ];
- }
- return $edit_tools;
- }
- /**
- * Register column controls.
- *
- * Used to add new controls to the column element.
- *
- * @since 1.0.0
- * @access protected
- */
- protected function _register_controls() {
- // Section Layout.
- $this->start_controls_section(
- 'layout',
- [
- 'label' => __( 'Layout', 'elementor' ),
- 'tab' => Controls_Manager::TAB_LAYOUT,
- ]
- );
- $this->add_control(
- '_title',
- [
- 'label' => __( 'Title', 'elementor' ),
- 'type' => Controls_Manager::HIDDEN,
- 'render_type' => 'none',
- ]
- );
- $this->add_responsive_control(
- '_inline_size',
- [
- 'label' => __( 'Column Width', 'elementor' ) . ' (%)',
- 'type' => Controls_Manager::NUMBER,
- 'min' => 2,
- 'max' => 98,
- 'required' => true,
- 'device_args' => [
- Controls_Stack::RESPONSIVE_TABLET => [
- 'max' => 100,
- 'required' => false,
- ],
- Controls_Stack::RESPONSIVE_MOBILE => [
- 'max' => 100,
- 'required' => false,
- ],
- ],
- 'min_affected_device' => [
- Controls_Stack::RESPONSIVE_DESKTOP => Controls_Stack::RESPONSIVE_TABLET,
- Controls_Stack::RESPONSIVE_TABLET => Controls_Stack::RESPONSIVE_TABLET,
- ],
- 'selectors' => [
- '{{WRAPPER}}' => 'width: {{VALUE}}%',
- ],
- ]
- );
- $this->add_control(
- 'content_position',
- [
- 'label' => __( 'Content Position', 'elementor' ),
- 'type' => Controls_Manager::SELECT,
- 'default' => '',
- 'options' => [
- '' => __( 'Default', 'elementor' ),
- 'top' => __( 'Top', 'elementor' ),
- 'center' => __( 'Middle', 'elementor' ),
- 'bottom' => __( 'Bottom', 'elementor' ),
- ],
- 'selectors_dictionary' => [
- 'top' => 'flex-start',
- 'bottom' => 'flex-end',
- ],
- 'selectors' => [
- '{{WRAPPER}}.elementor-column .elementor-column-wrap' => 'align-items: {{VALUE}}',
- ],
- ]
- );
- $this->add_control(
- 'space_between_widgets',
- [
- 'label' => __( 'Widgets Space', 'elementor' ) . ' (px)',
- 'type' => Controls_Manager::NUMBER,
- 'placeholder' => 20,
- 'selectors' => [
- '{{WRAPPER}} > .elementor-column-wrap > .elementor-widget-wrap > .elementor-widget:not(:last-child)' => 'margin-bottom: {{VALUE}}px', //Need the full path for exclude the inner section
- ],
- ]
- );
- $possible_tags = [
- 'div',
- 'header',
- 'footer',
- 'main',
- 'article',
- 'section',
- 'aside',
- 'nav',
- ];
- $options = [
- '' => __( 'Default', 'elementor' ),
- ] + array_combine( $possible_tags, $possible_tags );
- $this->add_control(
- 'html_tag',
- [
- 'label' => __( 'HTML Tag', 'elementor' ),
- 'type' => Controls_Manager::SELECT,
- 'options' => $options,
- ]
- );
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_style',
- [
- 'label' => __( 'Background', 'elementor' ),
- 'tab' => Controls_Manager::TAB_STYLE,
- ]
- );
- $this->start_controls_tabs( 'tabs_background' );
- $this->start_controls_tab(
- 'tab_background_normal',
- [
- 'label' => __( 'Normal', 'elementor' ),
- ]
- );
- $this->add_group_control(
- Group_Control_Background::get_type(),
- [
- 'name' => 'background',
- 'selector' => '{{WRAPPER}} > .elementor-element-populated',
- ]
- );
- $this->end_controls_tab();
- $this->start_controls_tab(
- 'tab_background_hover',
- [
- 'label' => __( 'Hover', 'elementor' ),
- ]
- );
- $this->add_group_control(
- Group_Control_Background::get_type(),
- [
- 'name' => 'background_hover',
- 'selector' => '{{WRAPPER}}:hover > .elementor-element-populated',
- ]
- );
- $this->add_control(
- 'background_hover_transition',
- [
- 'label' => __( 'Transition Duration', 'elementor' ),
- 'type' => Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 0.3,
- ],
- 'range' => [
- 'px' => [
- 'max' => 3,
- 'step' => 0.1,
- ],
- ],
- 'render_type' => 'ui',
- 'separator' => 'before',
- ]
- );
- $this->end_controls_tab();
- $this->end_controls_tabs();
- $this->end_controls_section();
- // Section Column Background Overlay.
- $this->start_controls_section(
- 'section_background_overlay',
- [
- 'label' => __( 'Background Overlay', 'elementor' ),
- 'tab' => Controls_Manager::TAB_STYLE,
- 'condition' => [
- 'background_background' => [ 'classic', 'gradient' ],
- ],
- ]
- );
- $this->start_controls_tabs( 'tabs_background_overlay' );
- $this->start_controls_tab(
- 'tab_background_overlay_normal',
- [
- 'label' => __( 'Normal', 'elementor' ),
- ]
- );
- $this->add_group_control(
- Group_Control_Background::get_type(),
- [
- 'name' => 'background_overlay',
- 'selector' => '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay',
- ]
- );
- $this->add_control(
- 'background_overlay_opacity',
- [
- 'label' => __( 'Opacity', 'elementor' ),
- 'type' => Controls_Manager::SLIDER,
- 'default' => [
- 'size' => .5,
- ],
- 'range' => [
- 'px' => [
- 'max' => 1,
- 'step' => 0.01,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay' => 'opacity: {{SIZE}};',
- ],
- 'condition' => [
- 'background_overlay_background' => [ 'classic', 'gradient' ],
- ],
- ]
- );
- $this->add_group_control(
- Group_Control_Css_Filter::get_type(),
- [
- 'name' => 'css_filters',
- 'selector' => '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay',
- ]
- );
- $this->add_control(
- 'overlay_blend_mode',
- [
- 'label' => __( 'Blend Mode', 'elementor' ),
- 'type' => Controls_Manager::SELECT,
- 'options' => [
- '' => __( 'Normal', 'elementor' ),
- 'multiply' => 'Multiply',
- 'screen' => 'Screen',
- 'overlay' => 'Overlay',
- 'darken' => 'Darken',
- 'lighten' => 'Lighten',
- 'color-dodge' => 'Color Dodge',
- 'saturation' => 'Saturation',
- 'color' => 'Color',
- 'luminosity' => 'Luminosity',
- ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay' => 'mix-blend-mode: {{VALUE}}',
- ],
- ]
- );
- $this->end_controls_tab();
- $this->start_controls_tab(
- 'tab_background_overlay_hover',
- [
- 'label' => __( 'Hover', 'elementor' ),
- ]
- );
- $this->add_group_control(
- Group_Control_Background::get_type(),
- [
- 'name' => 'background_overlay_hover',
- 'selector' => '{{WRAPPER}}:hover > .elementor-element-populated > .elementor-background-overlay',
- ]
- );
- $this->add_control(
- 'background_overlay_hover_opacity',
- [
- 'label' => __( 'Opacity', 'elementor' ),
- 'type' => Controls_Manager::SLIDER,
- 'default' => [
- 'size' => .5,
- ],
- 'range' => [
- 'px' => [
- 'max' => 1,
- 'step' => 0.01,
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}}:hover > .elementor-element-populated > .elementor-background-overlay' => 'opacity: {{SIZE}};',
- ],
- 'condition' => [
- 'background_overlay_hover_background' => [ 'classic', 'gradient' ],
- ],
- ]
- );
- $this->add_group_control(
- Group_Control_Css_Filter::get_type(),
- [
- 'name' => 'css_filters_hover',
- 'selector' => '{{WRAPPER}}:hover > .elementor-element-populated > .elementor-background-overlay',
- ]
- );
- $this->add_control(
- 'background_overlay_hover_transition',
- [
- 'label' => __( 'Transition Duration', 'elementor' ),
- 'type' => Controls_Manager::SLIDER,
- 'default' => [
- 'size' => 0.3,
- ],
- 'range' => [
- 'px' => [
- 'max' => 3,
- 'step' => 0.1,
- ],
- ],
- 'render_type' => 'ui',
- 'separator' => 'before',
- ]
- );
- $this->end_controls_tab();
- $this->end_controls_tabs();
- $this->end_controls_section();
- $this->start_controls_section(
- 'section_border',
- [
- 'label' => __( 'Border', 'elementor' ),
- 'tab' => Controls_Manager::TAB_STYLE,
- ]
- );
- $this->start_controls_tabs( 'tabs_border' );
- $this->start_controls_tab(
- 'tab_border_normal',
- [
- 'label' => __( 'Normal', 'elementor' ),
- ]
- );
- $this->add_group_control(
- Group_Control_Border::get_type(),
- [
- 'name' => 'border',
- 'selector' => '{{WRAPPER}} > .elementor-element-populated',
- ]
- );
- $this->add_control(
- 'border_radius',
- [
- 'label' => __( 'Border Radius', 'elementor' ),
- 'type' => Controls_Manager::DIMENSIONS,
- 'size_units' => [ 'px', '%' ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated, {{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
- ],
- ]
- );
- $this->add_group_control(
- Group_Control_Box_Shadow::get_type(),
- [
- 'name' => 'box_shadow',
- 'selector' => '{{WRAPPER}} > .elementor-element-populated',
- ]
- );
- $this->end_controls_tab();
- $this->start_controls_tab(
- 'tab_border_hover',
- [
- 'label' => __( 'Hover', 'elementor' ),
- ]
- );
- $this->add_group_control(
- Group_Control_Border::get_type(),
- [
- 'name' => 'border_hover',
- 'selector' => '{{WRAPPER}}:hover > .elementor-element-populated',
- ]
- );
- $this->add_control(
- 'border_radius_hover',
- [
- 'label' => __( 'Border Radius', 'elementor' ),
- 'type' => Controls_Manager::DIMENSIONS,
- 'size_units' => [ 'px', '%' ],
- 'selectors' => [
- '{{WRAPPER}}:hover > .elementor-element-populated, {{WRAPPER}}:hover > .elementor-element-populated > .elementor-background-overlay' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
- ],
- ]
- );
- $this->add_group_control(
- Group_Control_Box_Shadow::get_type(),
- [
- 'name' => 'box_shadow_hover',
- 'selector' => '{{WRAPPER}}:hover > .elementor-element-populated',
- ]
- );
- $this->add_control(
- 'border_hover_transition',
- [
- 'label' => __( 'Transition Duration', 'elementor' ),
- 'type' => Controls_Manager::SLIDER,
- 'separator' => 'before',
- 'default' => [
- 'size' => 0.3,
- ],
- 'range' => [
- 'px' => [
- 'max' => 3,
- 'step' => 0.1,
- ],
- ],
- 'conditions' => [
- 'relation' => 'or',
- 'terms' => [
- [
- 'name' => 'background_background',
- 'operator' => '!==',
- 'value' => '',
- ],
- [
- 'name' => 'border_border',
- 'operator' => '!==',
- 'value' => '',
- ],
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated' => 'transition: background {{background_hover_transition.SIZE}}s, border {{SIZE}}s, border-radius {{SIZE}}s, box-shadow {{SIZE}}s',
- '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay' => 'transition: background {{background_overlay_hover_transition.SIZE}}s, border-radius {{SIZE}}s, opacity {{background_overlay_hover_transition.SIZE}}s',
- ],
- ]
- );
- $this->end_controls_tab();
- $this->end_controls_tabs();
- $this->end_controls_section();
- // Section Typography.
- $this->start_controls_section(
- 'section_typo',
- [
- 'label' => __( 'Typography', 'elementor' ),
- 'type' => Controls_Manager::SECTION,
- 'tab' => Controls_Manager::TAB_STYLE,
- ]
- );
- if ( in_array( Scheme_Color::get_type(), Schemes_Manager::get_enabled_schemes(), true ) ) {
- $this->add_control(
- 'colors_warning',
- [
- 'type' => Controls_Manager::RAW_HTML,
- 'raw' => __( 'Note: The following colors won\'t work if Default Colors are enabled.', 'elementor' ),
- 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
- ]
- );
- }
- $this->add_control(
- 'heading_color',
- [
- 'label' => __( 'Heading Color', 'elementor' ),
- 'type' => Controls_Manager::COLOR,
- 'default' => '',
- 'selectors' => [
- '{{WRAPPER}} .elementor-element-populated .elementor-heading-title' => 'color: {{VALUE}};',
- ],
- 'separator' => 'none',
- ]
- );
- $this->add_control(
- 'color_text',
- [
- 'label' => __( 'Text Color', 'elementor' ),
- 'type' => Controls_Manager::COLOR,
- 'default' => '',
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'color_link',
- [
- 'label' => __( 'Link Color', 'elementor' ),
- 'type' => Controls_Manager::COLOR,
- 'default' => '',
- 'selectors' => [
- '{{WRAPPER}} .elementor-element-populated a' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'color_link_hover',
- [
- 'label' => __( 'Link Hover Color', 'elementor' ),
- 'type' => Controls_Manager::COLOR,
- 'default' => '',
- 'selectors' => [
- '{{WRAPPER}} .elementor-element-populated a:hover' => 'color: {{VALUE}};',
- ],
- ]
- );
- $this->add_control(
- 'text_align',
- [
- 'label' => __( 'Text Align', 'elementor' ),
- 'type' => Controls_Manager::CHOOSE,
- 'options' => [
- 'left' => [
- 'title' => __( 'Left', 'elementor' ),
- 'icon' => 'fa fa-align-left',
- ],
- 'center' => [
- 'title' => __( 'Center', 'elementor' ),
- 'icon' => 'fa fa-align-center',
- ],
- 'right' => [
- 'title' => __( 'Right', 'elementor' ),
- 'icon' => 'fa fa-align-right',
- ],
- ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated' => 'text-align: {{VALUE}};',
- ],
- ]
- );
- $this->end_controls_section();
- // Section Advanced.
- $this->start_controls_section(
- 'section_advanced',
- [
- 'label' => __( 'Advanced', 'elementor' ),
- 'type' => Controls_Manager::SECTION,
- 'tab' => Controls_Manager::TAB_ADVANCED,
- ]
- );
- $this->add_responsive_control(
- 'margin',
- [
- 'label' => __( 'Margin', 'elementor' ),
- 'type' => Controls_Manager::DIMENSIONS,
- 'size_units' => [ 'px', '%' ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
- ],
- ]
- );
- $this->add_responsive_control(
- 'padding',
- [
- 'label' => __( 'Padding', 'elementor' ),
- 'type' => Controls_Manager::DIMENSIONS,
- 'size_units' => [ 'px', 'em', '%' ],
- 'selectors' => [
- '{{WRAPPER}} > .elementor-element-populated' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
- ],
- ]
- );
- $this->add_control(
- 'z_index',
- [
- 'label' => __( 'Z-Index', 'elementor' ),
- 'type' => Controls_Manager::NUMBER,
- 'min' => 0,
- 'selectors' => [
- '{{WRAPPER}}' => 'z-index: {{VALUE}};',
- ],
- 'label_block' => false,
- ]
- );
- $this->add_control(
- 'animation',
- [
- 'label' => __( 'Entrance Animation', 'elementor' ),
- 'type' => Controls_Manager::ANIMATION,
- 'default' => '',
- 'prefix_class' => 'animated ',
- 'label_block' => false,
- 'frontend_available' => true,
- ]
- );
- $this->add_control(
- 'animation_duration',
- [
- 'label' => __( 'Animation Duration', 'elementor' ),
- 'type' => Controls_Manager::SELECT,
- 'default' => '',
- 'options' => [
- 'slow' => __( 'Slow', 'elementor' ),
- '' => __( 'Normal', 'elementor' ),
- 'fast' => __( 'Fast', 'elementor' ),
- ],
- 'prefix_class' => 'animated-',
- 'condition' => [
- 'animation!' => '',
- ],
- ]
- );
- $this->add_control(
- 'animation_delay',
- [
- 'label' => __( 'Animation Delay', 'elementor' ) . ' (ms)',
- 'type' => Controls_Manager::NUMBER,
- 'default' => '',
- 'min' => 0,
- 'step' => 100,
- 'condition' => [
- 'animation!' => '',
- ],
- 'render_type' => 'none',
- 'frontend_available' => true,
- ]
- );
- $this->add_control(
- '_element_id',
- [
- 'label' => __( 'CSS ID', 'elementor' ),
- 'type' => Controls_Manager::TEXT,
- 'default' => '',
- 'title' => __( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ),
- 'label_block' => false,
- 'style_transfer' => false,
- ]
- );
- $this->add_control(
- 'css_classes',
- [
- 'label' => __( 'CSS Classes', 'elementor' ),
- 'type' => Controls_Manager::TEXT,
- 'default' => '',
- 'prefix_class' => '',
- 'title' => __( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ),
- 'label_block' => false,
- ]
- );
- // TODO: Backward comparability for deprecated controls
- $this->add_control(
- 'screen_sm',
- [
- 'type' => Controls_Manager::HIDDEN,
- ]
- );
- $this->add_control(
- 'screen_sm_width',
- [
- 'type' => Controls_Manager::HIDDEN,
- 'condition' => [
- 'screen_sm' => [ 'custom' ],
- ],
- 'prefix_class' => 'elementor-sm-',
- ]
- );
- // END Backward comparability
- $this->end_controls_section();
- Plugin::$instance->controls_manager->add_custom_css_controls( $this );
- }
- /**
- * Render column edit tools.
- *
- * Used to generate the edit tools HTML.
- *
- * @since 1.8.0
- * @access protected
- */
- protected function render_edit_tools() {
- ?>
- <div class="elementor-element-overlay">
- <ul class="elementor-editor-element-settings elementor-editor-column-settings">
- <?php foreach ( self::get_edit_tools() as $edit_tool_name => $edit_tool ) : ?>
- <li class="elementor-editor-element-setting elementor-editor-element-<?php echo $edit_tool_name; ?>" title="<?php echo $edit_tool['title']; ?>">
- <i class="eicon-<?php echo $edit_tool['icon']; ?>" aria-hidden="true"></i>
- <span class="elementor-screen-only"><?php echo $edit_tool['title']; ?></span>
- </li>
- <?php endforeach; ?>
- </ul>
- <div class="elementor-column-percents-tooltip"></div>
- </div>
- <?php
- }
- /**
- * Render column output in the editor.
- *
- * Used to generate the live preview, using a Backbone JavaScript template.
- *
- * @since 1.0.0
- * @access protected
- */
- protected function _content_template() {
- ?>
- <div class="elementor-column-wrap">
- <div class="elementor-background-overlay"></div>
- <div class="elementor-widget-wrap"></div>
- </div>
- <?php
- }
- /**
- * Before column rendering.
- *
- * Used to add stuff before the column element.
- *
- * @since 1.0.0
- * @access public
- */
- public function before_render() {
- $settings = $this->get_settings_for_display();
- $has_background_overlay = in_array( $settings['background_overlay_background'], [ 'classic', 'gradient' ], true ) ||
- in_array( $settings['background_overlay_hover_background'], [ 'classic', 'gradient' ], true );
- $column_wrap_class = 'elementor-column-wrap';
- if ( $this->get_children() ) {
- $column_wrap_class .= ' elementor-element-populated';
- }
- ?>
- <<?php echo $this->get_html_tag() . ' ' . $this->get_render_attribute_string( '_wrapper' ); ?>>
- <div class="<?php echo $column_wrap_class; ?>">
- <?php if ( $has_background_overlay ) : ?>
- <div class="elementor-background-overlay"></div>
- <?php endif; ?>
- <div class="elementor-widget-wrap">
- <?php
- }
- /**
- * After column rendering.
- *
- * Used to add stuff after the column element.
- *
- * @since 1.0.0
- * @access public
- */
- public function after_render() {
- ?>
- </div>
- </div>
- </<?php echo $this->get_html_tag(); ?>>
- <?php
- }
- /**
- * Add column render attributes.
- *
- * Used to add attributes to the current column wrapper HTML tag.
- *
- * @since 1.3.0
- * @access protected
- */
- protected function _add_render_attributes() {
- parent::_add_render_attributes();
- $is_inner = $this->get_data( 'isInner' );
- $column_type = ! empty( $is_inner ) ? 'inner' : 'top';
- $settings = $this->get_settings();
- $this->add_render_attribute(
- '_wrapper', 'class', [
- 'elementor-column',
- 'elementor-col-' . $settings['_column_size'],
- 'elementor-' . $column_type . '-column',
- ]
- );
- $this->add_render_attribute( '_wrapper', 'data-element_type', $this->get_name() );
- }
- /**
- * Get default child type.
- *
- * Retrieve the column child type based on element data.
- *
- * @since 1.0.0
- * @access protected
- *
- * @param array $element_data Element ID.
- *
- * @return Element_Base Column default child type.
- */
- protected function _get_default_child_type( array $element_data ) {
- if ( 'section' === $element_data['elType'] ) {
- return Plugin::$instance->elements_manager->get_element_types( 'section' );
- }
- return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
- }
- /**
- * Get HTML tag.
- *
- * Retrieve the column element HTML tag.
- *
- * @since 1.5.3
- * @access private
- *
- * @return string Column HTML tag.
- */
- private function get_html_tag() {
- $html_tag = $this->get_settings( 'html_tag' );
- if ( empty( $html_tag ) ) {
- $html_tag = 'div';
- }
- return $html_tag;
- }
- }
|