D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
section-heading
/
Filename :
class.php
back
Copy
<?php /** * This file can be overridden by copying it to yourtheme/elementor-custom/title/class.php * * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Background; if ( ! defined( 'ABSPATH' ) ) exit; class Section_Heading extends Custom_Widget_Base { public function __construct( $data = [], $args = null ){ $this->rt_name = __( 'RT Section Heading', 'aeen-core' ); $this->rt_base = 'rt-section-heading'; parent::__construct( $data, $args ); } public function rt_fields(){ $fields = array( array( 'id' => 'sec_general', 'mode' => 'section_start', 'label' => __( 'General', 'aeen-core' ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'style', 'label' => esc_html__( 'Style', 'aeen-core' ), 'options' => array( 'style1' => esc_html__( 'Style 1', 'aeen-core' ), 'style2' => esc_html__( 'Style 2', 'aeen-core' ), 'style3' => esc_html__( 'Style 3', 'aeen-core' ), 'style4' => esc_html__( 'Style 4', 'aeen-core' ), 'style5' => esc_html__( 'Style 5', 'aeen-core' ), ), 'default' => 'style1', ), array( 'type' => Controls_Manager::CHOOSE, 'id' => 'content_align', 'mode' => 'responsive', 'label' => esc_html__( 'Alignment', 'salion-core' ), 'options' => array( 'left' => array( 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ), 'center' => array( 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ), 'right' => array( 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ), 'justify' => array( 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ), ), 'default' => '', 'selectors' => array( '{{WRAPPER}}' => 'text-align: {{VALUE}};', ), 'condition' => array( 'style' => array( 'style1', 'style3' ) ), ), // Title array( 'id' => 'heading_title', 'type' => Controls_Manager::TEXTAREA, 'label' => __( 'Heading Title', 'aeen-core' ), 'default' => 'Heading Title', 'label_block' => true, ), array( 'id' => 'heading_sub_title', 'type' => Controls_Manager::TEXT, 'label' => __( 'Sub Title', 'aeen-core' ), 'default' => 'Heading Sub Title', 'label_block' => true, 'condition' => array( 'style' => array( 'style1', 'style2' ) ), ), array( 'type' => Controls_Manager::WYSIWYG, 'id' => 'heading_content', 'label' => esc_html__( 'Content', 'aeen-core' ), 'default' => esc_html__('Grursus mal suada faci lisis Lorem ipsum dolarorit more a ametion consectetur is elit. Vesti at bulum nec odio aea the dumm ipsumm ipsum that dolocons rsus mal suada and fadolorit to the consectetur elit.' ), 'condition' => array( 'style' => array( 'style1', 'style2', 'style3', 'style5' ) ), ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_title_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Title Style', 'aeen-core' ), ), array( 'id' => 'heading_title_style', 'type' => Controls_Manager::HEADING, 'label' => __( 'Title Style', 'aeen-core' ), ), array( 'id' => 'heading_title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section-heading .heading-main-title' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading2 .heading-main-title' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading2.width-large h2.heading-main-title' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'heading_title_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .section-heading .heading-main-title, {{WRAPPER}} .section-heading2.width-large h2.heading-main-title, {{WRAPPER}} .section-heading2 .heading-main-title', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'heading_title_padding', 'mode' => 'responsive', 'label' => esc_html__( 'Padding', 'salion-core' ), 'selectors' => array( '{{WRAPPER}} .section-heading .heading-main-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading2 .heading-main-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading2.width-large h2.heading-main-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'mode' => 'responsive', 'id' => 'heading_title_margin', 'label' => esc_html__( 'Margin', 'salion-core' ), 'selectors' => array( '{{WRAPPER}} .section-heading .heading-main-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading2 .heading-main-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading2.width-large h2.heading-main-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_sub_title_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Sub Title Style', 'aeen-core' ), 'condition' => array( 'style' => array( 'style1', 'style2' ) ), ), array( 'id' => 'heading_sub_title_style', 'type' => Controls_Manager::HEADING, 'label' => __( 'Sub Title Style', 'aeen-core' ), ), array( 'id' => 'heading_sub_title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section-heading .heading-sub-title' => 'color: {{VALUE}}' ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'heading_sub_title_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .section-heading .heading-sub-title', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'heading_sub_title_padding', 'mode' => 'responsive', 'label' => esc_html__( 'Padding', 'salion-core' ), 'selectors' => array( '{{WRAPPER}} .section-heading .heading-sub-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ), 'separator' => 'before', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'mode' => 'responsive', 'id' => 'heading_sub_title_margin', 'label' => esc_html__( 'Margin', 'salion-core' ), 'selectors' => array( '{{WRAPPER}} .section-heading .heading-sub-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ), 'separator' => 'before', ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_border_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Border Style', 'aeen-core' ), 'condition' => array( 'style' => array( 'style1', 'style2', 'style4', 'style5' ) ), ), array( 'id' => 'heading_border_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section-heading .heading-sub-title:before' => 'background-color: {{VALUE}}', '{{WRAPPER}} .section-heading2:before' => 'background-color: {{VALUE}}', ), ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_content_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Content Style', 'aeen-core' ), ), array( 'id' => 'heading_content_style', 'type' => Controls_Manager::HEADING, 'label' => __( 'Content Style', 'aeen-core' ), ), array( 'id' => 'heading_content_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section_heading_wrap p' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading2.width-large p' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading.heading-light p' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading.heading-dark p' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'heading_content_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .section_heading_wrap p, {{WRAPPER}} .section-heading2.width-large p, {{WRAPPER}} .section-heading.heading-light p, {{WRAPPER}} .section-heading.heading-dark p', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'heading_content_padding', 'mode' => 'responsive', 'label' => esc_html__( 'Padding', 'salion-core' ), 'selectors' => array( '{{WRAPPER}} .section_heading_wrap p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading2.width-large p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading.heading-light p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading.heading-dark p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', 'condition' => array( 'style' => array( 'style3' ) ), ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'mode' => 'responsive', 'id' => 'heading_content_margin', 'label' => esc_html__( 'Margin', 'salion-core' ), 'selectors' => array( '{{WRAPPER}} .section_heading_wrap p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading2.width-large p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading.heading-light p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .section-heading.heading-dark p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', 'condition' => array( 'style' => array( 'style3' ) ), ), array( 'mode' => 'section_end', ), ); return $fields; } protected function render() { $data = $this->get_settings(); switch ($data['style']) { case 'style2': $template = 'view-2'; break; case 'style3': $template = 'view-3'; break; case 'style4': $template = 'view-4'; break; case 'style5': $template = 'view-5'; break; default: $template = 'view-1'; break; } return $this->rt_template( $template, $data ); } }