Sindbad~EG File Manager
<?php
namespace CoursectorElementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Elementor Distortion Grid
*
* @since 1.0.0
*/
class Coursector_Distortion_Grid extends Widget_Base {
/**
* Retrieve the widget name.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'coursector-distortion-grid';
}
/**
* Retrieve the widget title.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return __( 'Distortion Hover Grid', 'coursector-elementor' );
}
/**
* Retrieve the widget icon.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-columns';
}
/**
* Retrieve the list of categories the widget belongs to.
*
* Used to determine where to display the widget in the editor.
*
* Note that currently Elementor supports only one category.
* When multiple categories passed, Elementor uses the first one.
*
* @since 1.0.0
*
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'coursector-theme-widgets-category' ];
}
/**
* Retrieve the list of scripts the widget depended on.
*
* Used to set scripts dependencies required to run the widget.
*
* @since 1.0.0
*
* @access public
*
* @return array Widget scripts dependencies.
*/
public function get_script_depends() {
return [ 'imagesloaded', 'three', 'tweenmax', 'hover', 'coursector-elementor' ];
}
/**
* Register the widget controls.
*
* Adds different input fields to allow the user to change and customize the widget settings.
*
* @since 1.0.0
*
* @access protected
*/
protected function _register_controls() {
$this->start_controls_section(
'section_content',
[
'label' => __( 'Content', 'coursector-elementor' ),
]
);
$this->add_control(
'slides',
[
'label' => __( 'Slides', 'coursector-elementor' ),
'type' => Controls_Manager::REPEATER,
'default' => [
[
'slide_title' => 'Superior Room',
'slide_subtitle' => 'From $199',
'slide_link_title' => 'Book Now',
],
],
'fields' => [
[
'name' => 'slide_image',
'label' => __( 'Image', 'coursector-elementor' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
],
[
'name' => 'slide_image_hover',
'label' => __( 'Image on hover', 'coursector-elementor' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
],
[
'name' => 'slide_title',
'label' => __( 'Title', 'coursector-elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Title' , 'coursector-elementor' ),
],
[
'name' => 'slide_subtitle',
'label' => __( 'Sub Title', 'coursector-elementor' ),
'type' => Controls_Manager::TEXT,
],
[
'name' => 'slide_excerpt',
'label' => __( 'Excerpt', 'coursector-elementor' ),
'type' => Controls_Manager::TEXTAREA,
'default' => __( 'Excerpt' , 'coursector-elementor' ),
],
[
'name' => 'slide_link_title',
'label' => __( 'Link Title', 'coursector-elementor' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Link Title' , 'coursector-elementor' ),
],
[
'name' => 'slide_link',
'label' => __( 'Link URL', 'coursector-elementor' ),
'type' => Controls_Manager::URL,
'default' => [
'url' => '',
'is_external' => '',
],
'show_external' => true,
],
],
'title_field' => '{{{ slide_title }}}',
]
);
$this->add_control(
'theme',
[
'label' => __( 'Theme', 'coursector-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 1,
'options' => [
1 => __( 'Theme 1', 'coursector-elementor' ),
2 => __( 'Theme 2', 'coursector-elementor' ),
3 => __( 'Theme 3', 'coursector-elementor' ),
4 => __( 'Theme 4', 'coursector-elementor' ),
5 => __( 'Theme 5', 'coursector-elementor' ),
6 => __( 'Theme 6', 'coursector-elementor' ),
7 => __( 'Theme 7', 'coursector-elementor' ),
8 => __( 'Theme 8', 'coursector-elementor' ),
9 => __( 'Theme 9', 'coursector-elementor' ),
10 => __( 'Theme 10', 'coursector-elementor' ),
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_title_style',
array(
'label' => esc_html__( 'Title', 'coursector-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'title_color',
[
'label' => __( 'Title Color', 'coursector-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} h2.distortion_grid_item-title' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => __( 'Title Typography', 'coursector-elementor' ),
'selector' => '{{WRAPPER}} .distortion_grid_item-content h2.distortion_grid_item-title',
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_subtitle_style',
array(
'label' => esc_html__( 'Sub Title', 'coursector-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'subtitle_color',
[
'label' => __( 'Sub Title Color', 'coursector-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .distortion_grid_item-meta' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'subtitle_typography',
'label' => __( 'Sub Title Typography', 'coursector-elementor' ),
'selector' => '{{WRAPPER}} span.distortion_grid_item-meta',
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_excerpt_style',
array(
'label' => esc_html__( 'Excerpt', 'coursector-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'excerpt_color',
[
'label' => __( 'Excerpt Color', 'coursector-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .distortion_grid_item-subtitle span' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'excerpt_typography',
'label' => __( 'Excerpt Typography', 'coursector-elementor' ),
'selector' => '{{WRAPPER}} div.distortion_grid_item-subtitle span',
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_link_style',
array(
'label' => esc_html__( 'Link', 'coursector-elementor' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'link_color',
[
'label' => __( 'Link Color', 'coursector-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .distortion_grid_item-link' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'link_hover_color',
[
'label' => __( 'Link Hover Color', 'coursector-elementor' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [
'{{WRAPPER}} .distortion_grid_item-link:focus, {{WRAPPER}} .distortion_grid_item-link:hover' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'link_typography',
'label' => __( 'Link Typography', 'coursector-elementor' ),
'selector' => '{{WRAPPER}} a.distortion_grid_item-link',
]
);
$this->end_controls_section();
}
/**
* Render the widget output on the frontend.
*
* Written in PHP and used to generate the final HTML.
*
* @since 1.0.0
*
* @access protected
*/
protected function render() {
include(COURSECTOR_ELEMENTOR_PATH.'templates/distortion-grid/index.php');
}
/**
* Render the widget output in the editor.
*
* Written as a Backbone JavaScript template and used to generate the live preview.
*
* @since 1.0.0
*
* @access protected
*/
protected function _content_template() {
return '';
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists