D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
a3legalservices.site
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
Filename :
base.php
back
Copy
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use \ReflectionClass; use Elementor\Widget_Base; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly abstract class Custom_Widget_Base extends Widget_Base { public $rt_name; public $rt_base; public $rt_category; public $rt_icon; public $rt_translate; public $rt_dir; public function __construct( $data = [], $args = null ) { $this->rt_category = AEEN_CORE_THEME_PREFIX . '-widgets'; // Category /@dev $this->rt_icon = 'rdtheme-el-custom'; $this->rt_dir = dirname( ( new ReflectionClass( $this ) )->getFileName() ); parent::__construct( $data, $args ); } abstract public function rt_fields(); public function get_name() { return $this->rt_base; } public function get_title() { return $this->rt_name; } public function get_icon() { return $this->rt_icon; } public function get_categories() { return array( $this->rt_category ); } protected function register_controls() { $fields = $this->rt_fields(); foreach ( $fields as $field ) { if ( isset( $field['mode'] ) && $field['mode'] == 'section_start' ) { $id = $field['id']; unset( $field['id'] ); unset( $field['mode'] ); $this->start_controls_section( $id, $field ); } elseif ( isset( $field['mode'] ) && $field['mode'] == 'section_end' ) { $this->end_controls_section(); } elseif ( isset( $field['mode'] ) && $field['mode'] == 'group' ) { $type = $field['type']; unset( $field['mode'] ); unset( $field['type'] ); $this->add_group_control( $type, $field ); } elseif ( isset( $field['mode'] ) && $field['mode'] == 'responsive' ) { $id = $field['id']; unset( $field['id'] ); unset( $field['mode'] ); $this->add_responsive_control( $id, $field ); } else { $id = $field['id']; unset( $field['id'] ); $this->add_control( $id, $field ); } } } public function rt_template( $template, $data ) { $template_name = '/elementor-custom/' . basename( $this->rt_dir ) . '/' . $template . '.php'; if ( file_exists( STYLESHEETPATH . $template_name ) ) { $file = STYLESHEETPATH . $template_name; } elseif ( file_exists( TEMPLATEPATH . $template_name ) ) { $file = TEMPLATEPATH . $template_name; } else { $file = $this->rt_dir . '/' . $template . '.php'; } ob_start(); include $file; echo ob_get_clean(); } public function rt_alignment_options(){ return array( 'left' => array( 'title' => __( 'Left', 'aeen-core' ), 'icon' => 'eicon-text-align-left', ), 'center' => array( 'title' => __( 'Center', 'aeen-core' ), 'icon' => 'eicon-text-align-center', ), 'right' => array( 'title' => __( 'Right', 'aeen-core' ), 'icon' => 'eicon-text-align-right', ), 'justify' => array( 'title' => __( 'Justified', 'aeen-core' ), 'icon' => 'eicon-text-align-justify', ), ); } public function rt_grid_options(){ return [ '6' => esc_html__( '2 Columns', 'aeen-core' ), '4' => esc_html__( '3 Columns', 'aeen-core' ), '3' => esc_html__( '4 Columns', 'aeen-core' ), '2' => esc_html__( '6 Columns', 'aeen-core' ), ]; } public function rt_number_options(){ return [ '1' => esc_html__( '1', 'aeen-core' ), '2' => esc_html__( '2', 'aeen-core' ), '3' => esc_html__( '3', 'aeen-core' ), '4' => esc_html__( '4', 'aeen-core' ), '5' => esc_html__( '5', 'aeen-core' ), '6' => esc_html__( '6', 'aeen-core' ), '7' => esc_html__( '7', 'aeen-core' ), '8' => esc_html__( '8', 'aeen-core' ), ]; } public function rt_autoplay_speed(){ return [ '500' => esc_html__( '500', 'aeen-core' ), '1000' => esc_html__( '1000', 'aeen-core' ), '1500' => esc_html__( '1500', 'aeen-core' ), '2000' => esc_html__( '2000', 'aeen-core' ), '2500' => esc_html__( '2500', 'aeen-core' ), '3000' => esc_html__( '3000', 'aeen-core' ), ]; } public function rt_anim_delay(){ return [ '200' => esc_html__( '200', 'aeen-core' ), '300' => esc_html__( '300', 'aeen-core' ), '400' => esc_html__( '400', 'aeen-core' ), '500' => esc_html__( '500', 'aeen-core' ), '600' => esc_html__( '600', 'aeen-core' ), '700' => esc_html__( '700', 'aeen-core' ), '800' => esc_html__( '800', 'aeen-core' ), '900' => esc_html__( '900', 'aeen-core' ), ]; } public function rt_placeholder_image(){ $placeholder_image = AEEN_CORE_BASE_URL.'assets/imgs/placeholder.png'; /** * Get placeholder image source. * * Filters the source of the default placeholder image used by Elementor. * * @since 1.0.0 * * @param string $placeholder_image The source of the default placeholder image. */ $placeholder_image = apply_filters( 'elementor/utils/get_placeholder_image_src', $placeholder_image ); return $placeholder_image; } }