| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/stirizo/wp-content/plugins/widgetkit-pro/widgets/elements/ |
Upload File : |
<?php
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Group_Control_Typography;
Use Elementor\Core\Schemes\Typography;
use Elementor\Group_Control_Border;
use Elementor\Utils;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Image_Size;
use Elementor\Controls_Stack;
if (!defined('ABSPATH')) exit;
class Widgetkit_Pro_Event_List extends Widget_Base
{
public $the_events_calendar_core = 'the-events-calendar/the-events-calendar.php';
public function get_name()
{
return 'widgetkit-pro-event-list';
}
public function get_title()
{
return __('Event List', 'widgetkit-pro');
}
public function get_icon()
{
return 'eicon-post-content';
}
public function get_categories()
{
return ['widgetkit_pro'];
}
/**
* A list of style that the widgets is depended in
**/
public function get_style_depends() {
return [
'widgetkit_bs',
'widgetkit_pro_default',
];
}
/**
* A list of scripts that the widgets is depended in
**/
public function get_script_depends() {
return [
// 'animate-text',
// 'layout',
];
}
protected function _register_controls() {
$cat_names = array();
if(apply_filters('wkpro_check_plugin', $this->the_events_calendar_core) && class_exists('Tribe__Events__Main')):
$terms = get_terms(array(
'post_type' => 'tribe_events',
'hide_empty' => true,
));
foreach ($terms as $t):
$cat_names[$t->slug] = $t->name;
endforeach;
endif;
# region Query
/**
* Query
*/
$this->start_controls_section(
'section_query',
[
'label' => __( 'Query', 'widgetkit-pro' ),
]
);
// $this->add_control(
// 'cat_dynamic_multiple_id',
// [
// 'label' => __('Select Category', 'widgetkit-pro'),
// 'type' => Controls_Manager::SELECT2,
// 'options' => $cat_names,
// 'multiple' => true,
// ]
// );
$this->add_control(
'order',
[
'label' => __('Order', 'widgetkit-pro'),
'type' => Controls_Manager::SELECT,
'default' => 'ASC',
'options' => [
'ASC' => __('Ascending', 'widgetkit-pro'),
'DESC' => __('Descending', 'widgetkit-pro'),
],
]
);
$this->add_control(
'orderby',
[
'label' => __('Order By', 'widgetkit-pro'),
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => [
'title' => __('Title', 'widgetkit-pro'),
'name' => __('Name', 'widgetkit-pro'),
'date' => __('Date', 'widgetkit-pro'),
'rand' => __('Random', 'widgetkit-pro'),
],
]
);
$this->add_control(
'post_num_to_show',
[
'label' => __('Course to Show', 'widgetkit-pro'),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 50,
'step' => 1,
]
);
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'image',
'default' => 'large',
'separator' => 'none',
]
);
$this->end_controls_section();
# endregion
# region Layout
/**
* Layout
*/
$this->start_controls_section(
'section_layout',
[
'label' => __( 'Layout', 'widgetkit-pro' ),
]
);
$this->add_responsive_control(
'column_grid_gap',
[
'label' => esc_html__( 'Grid Gap', 'widgetkit-pro' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' =>20,
],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid' => 'grid-gap: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_section();
# endregion
# region Title & description
/**
* title & description
*/
$this->start_controls_section(
'section_title_description',
[
'label' => __( 'Title & Description', 'widgetkit-pro' ),
]
);
$this->add_control(
'excerpt_toggle',
[
'label' => __( 'Word Count', 'widgetkit-pro' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'label_on' => __( 'Yes', 'widgetkit-pro' ),
'label_off' => __( 'No', 'widgetkit-pro' ),
'return_value' => 'yes',
]
);
$this->add_control(
'excerpt_desc_word',
[
'label' => __('Description Length', 'widgetkit-pro'),
'type' => Controls_Manager::NUMBER,
'default' => 20,
'min' => 1,
'max' => 200,
'step' => 1,
'condition' => [
'excerpt_toggle' => 'yes',
],
]
);
$this->end_controls_section();
# endregion
# region Meta
/**
* Meta
*/
$this->start_controls_section(
'section_meta',
[
'label' => __( 'Meta', 'widgetkit-pro' ),
]
);
$this->add_control(
'read_more_button',
[
'label' => __( 'Read More', 'widgetkit-pro' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'label_on' => __( 'Show', 'widgetkit-pro' ),
'label_off' => __( 'Hide', 'widgetkit-pro' ),
'return_value' => 'yes',
]
);
$this->add_control(
'course_custom_button_text',
[
'label' => esc_html__( 'Text', 'widgetkit-pro' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Read More', 'widgetkit-pro' ),
'condition' => [
'read_more_button' => 'yes',
],
]
);
$this->end_controls_section();
# endregion
# region title & description style
$this->start_controls_section(
'section_wapper_style',
[
'label' => __('Title & Description', 'widgetkit-pro'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
/**
* Title
*/
$this->add_control(
'style_heading_title',
[
'label' => __( 'Title', 'widgetkit-pro' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __('Typography', 'widgetkit-pro'),
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .column-grid .wk-entry-title',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->start_controls_tabs('title_style_tabs');
/**
* Normal
*/
$this->start_controls_tab(
'title_style_normal_tab',
[
'label' => __('Normal', 'widgetkit-pro'),
]
);
$this->add_control(
'title_color',
[
'label' => __('Color', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .wk-entry-title' => 'color: {{VALUE}}',
],
]
);
$this->end_controls_tab();
/**
* hover
*/
$this->start_controls_tab(
'title_style_hover_tab',
[
'label' => __('Hover', 'widgetkit-pro'),
]
);
$this->add_control(
'title_hover_color',
[
'label' => __('Color', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .wk-entry-title:hover' => 'color: {{VALUE}}',
],
]
);
$this->end_controls_tab(); // Hover Tab end
$this->end_controls_tabs();
$this->add_responsive_control(
'title_spacing_bottom',
[
'label' => __( 'Spacing Bottom', 'widgetkit-pro' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' =>15,
],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .wk-entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
/**
* Content
*/
$this->add_control(
'style_heading_description',
[
'label' => __( 'Description', 'widgetkit-pro' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'content_color',
[
'label' => __('Color', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-excerpt' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __('Typography', 'widgetkit-pro'),
'name' => 'content_typography',
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-excerpt',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->add_responsive_control(
'desc_spacing_bottom',
[
'label' => __( 'Spacing Bottom', 'widgetkit-pro' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' =>15,
],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-excerpt' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_section();
# endregion
# region meta
$this->start_controls_section(
'section_meta_style',
[
'label' => __('Meta', 'widgetkit-pro'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
/**
* Date
*/
$this->add_control(
'style_date',
[
'label' => __( 'Date', 'widgetkit-pro' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __('Typography', 'widgetkit-pro'),
'name' => 'date_typography',
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-date',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->add_control(
'date_color',
[
'label' => __('Text', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-date' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'date_icon_color',
[
'label' => __('Icon', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-date i' => 'color: {{VALUE}}',
],
]
);
/**
* venue
*/
$this->add_control(
'style_venue',
[
'label' => __( 'Venue', 'widgetkit-pro' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __('Typography', 'widgetkit-pro'),
'name' => 'venue_typography',
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-venue',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->add_control(
'venue_color',
[
'label' => __('Text', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-venue' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'venue_icon_color',
[
'label' => __('Icon', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .event-venue i' => 'color: {{VALUE}}',
],
]
);
$this->add_responsive_control(
'event_meta_margin',
[
'label' => esc_html__( 'Margin', 'widgetkit-pro' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px'],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .meta-data' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'default' => [
'top' => '0',
'right' => '0',
'bottom' => '20',
'left' => '0',
'unit' => 'px',
'isLinked' => false,
],
'separator' => 'before',
]
);
$this->end_controls_section();
# endregion
# region Button style
$this->start_controls_section(
'section_button_style',
[
'label' => __( 'Button', 'widgetkit-pro' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
/**
* Button
*/
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'label' => __('Button Typography', 'widgetkit-pro'),
'name' => 'button_typography',
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more',
'scheme' => Typography::TYPOGRAPHY_3,
]
);
$this->start_controls_tabs('button_style_tabs');
$this->start_controls_tab(
'button_style_normal_tab',
[
'label' => __('Normal', 'widgetkit-pro'),
]
);
$this->add_control(
'button_text_color',
[
'label' => __('Color', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_bg_color',
[
'label' => __('Background', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'button_border_color',
[
'label' => __('Border', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more' => 'border-color: {{VALUE}};',
],
]
);
$this->end_controls_tab(); // Normal Tab end
$this->start_controls_tab(
'button_style_hover_tab',
[
'label' => __('Hover', 'widgetkit-pro'),
]
);
$this->add_control(
'button_hover_text_color',
[
'label' => __('Color', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more:hover' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_hover_background',
[
'label' => __('Background', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more:hover' => 'background: {{VALUE}};',
],
]
);
$this->add_control(
'button_hover_border_color',
[
'label' => __('Border', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more:hover' => 'border-color: {{VALUE}};',
],
]
);
$this->end_controls_tab(); // Hover Tab end
$this->end_controls_tabs();
$this->add_control(
'padding_hr',
[
'type' => \Elementor\Controls_Manager::DIVIDER,
]
);
$this->add_control(
'button-border-width',
[
'label' => esc_html__( 'Border Width', 'widgetkit-pro' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' =>0,
],
'range' => [
'px' => [
'min' => 0,
'max' => 50,
],
],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more' => 'border-style:solid; border-width: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'button-border-radius',
[
'label' => esc_html__( 'Radius', 'widgetkit-pro' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'size' =>0,
],
'range' => [
'px' => [
'min' => 0,
'max' => 200,
],
],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more' => 'border-radius: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'single_course_btn_padding',
[
'label' => esc_html__( 'Padding', 'widgetkit-pro' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px'],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .column-grid .read-more' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->end_controls_section();
# endregion
# region global option style
$this->start_controls_section(
'section_single_course_style',
[
'label' => __( 'Global option', 'widgetkit-pro' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'single_course_align',
[
'label' => esc_html__( 'Alignment', 'widgetkit-for-elementor' ),
'type' => Controls_Manager::CHOOSE,
'default' =>'left' ,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'widgetkit-for-elementor' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'widgetkit-for-elementor' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'widgetkit-for-elementor' ),
'icon' => 'eicon-text-align-left',
],
],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .single-event' => 'text-align: {{VALUE}};',
],
]
);
$this->add_control(
'single_course_background',
[
'label' => __('Background', 'widgetkit-pro'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .single-event' => 'Background: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'Border',
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .single-event',
]
);
$this->add_control(
'enable_box_shadow',
[
'label' => __( 'Enable Box Shadow', 'widgetkit-pro' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
'label_on' => __( 'Yes', 'widgetkit-pro' ),
'label_off' => __( 'No', 'widgetkit-pro' ),
'return_value' => 'yes',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'item_box_shadow',
'label' => esc_html__( 'Normal Box Shadow', 'widgetkit-pro' ),
'exclude' => [
'box_shadow_position',
],
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .single-event',
'condition' => [
'enable_box_shadow' => 'yes',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'item_hover_box_shadow',
'label' => esc_html__( 'Hover Box Shadow', 'widgetkit-pro' ),
'exclude' => [
'box_shadow_position',
],
'selector' => '{{WRAPPER}} .widgetkit-event-list-element .single-event:hover',
'condition' => [
'enable_box_shadow' => 'yes',
],
]
);
$this->add_responsive_control(
'single_course_padding',
[
'label' => esc_html__( 'Padding', 'widgetkit-pro' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px'],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .single-event .content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'default' => [
'top' => '20',
'right' => '20',
'bottom' => '20',
'left' => '20',
'unit' => 'px',
'isLinked' => true,
],
]
);
$this->add_responsive_control(
'single_course_border_radius',
[
'label' => esc_html__( 'Border Radius', 'widgetkit-pro' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .widgetkit-event-list-element .single-event' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
# endregion
}
protected function render()
{
?>
<?php include( plugin_dir_path( __FILE__ ) . '../layout/event-list.php'); ?>
<?php
}
protected function content_template()
{
}
}