D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
title
/
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 Title extends Custom_Widget_Base { public function __construct( $data = [], $args = null ){ $this->rt_name = __( 'RT Section Title', 'aeen-core' ); $this->rt_base = 'rt-title'; 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' ), ), 'default' => 'style1', ), // Title array( 'id' => 'title', 'type' => Controls_Manager::TEXTAREA, 'label' => __( 'Title', 'aeen-core' ), 'default' => 'Section Title', 'label_block' => true, ), array( 'id' => 'align', 'mode' => 'responsive', 'type' => Controls_Manager::CHOOSE, 'label' => __( 'Alignment', 'aeen-core' ), 'options' => $this->rt_alignment_options(), 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .heading-title' => 'text-align: {{VALUE}};', ], ), array( 'id' => 'line_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Horizontal Line', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'style' => array( 'style2' ) ), ), array( 'id' => 'line_height', 'type' => Controls_Manager::SLIDER, 'label' => __( 'Line height', 'aeen-core' ), 'size_units' => [ 'px', '%' ], 'range' => [ '%' => [ 'min' => 0, 'max' => 200, 'step' => 1, ], ], 'default' => [ 'unit' => '%', 'size' => 100, ], 'selectors' => [ '{{WRAPPER}} .section-heading-border:before' => 'width: {{SIZE}}{{UNIT}};', ], 'condition' => array( 'style' => array( 'style2' ) ), ), array( 'name' => 'line_color', 'mode' => 'group', 'type' => Group_Control_Background::get_type(), 'label' => __( 'Background', 'aeen-core' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .section-heading-border:before', 'condition' => array( 'style' => array( 'style2' ) ), ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Style', 'aeen-core' ), ), array( 'id' => 'title_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Title Style', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section-heading .heading-main-title' => 'color: {{VALUE}}' ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'title_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .section-heading .heading-main-title', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'title_padding', 'mode' => 'responsive', 'label' => esc_html__( 'Padding', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .section-heading .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' => 'title_margin', 'label' => esc_html__( 'Margin', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .section-heading .heading-main-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'mode' => 'section_end', ), ); return $fields; } protected function render() { $data = $this->get_settings(); switch ($data['style']) { case 'style2': $template = 'view-2'; break; default: $template = 'view-1'; break; } return $this->rt_template( $template, $data ); } }