first commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
class Better_Payment extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-better-payment';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Better Payment', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-better-payment';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'payment', 'better-payment' ,'paypal', 'stripe', 'sell', 'donate', 'transaction', 'online-transaction', 'better payment', 'online transaction', 'ea better payment', 'ea', 'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return '#';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'eael_global_warning',
|
||||
[
|
||||
'label' => __('Warning!', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_global_warning_text',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('<strong>Better Payment</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=better-payment&tab=search&type=tag" target="_blank">Better Payment</a> first.',
|
||||
'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
protected function render() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,591 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
class Betterdocs_Search_Form extends Widget_Base
|
||||
{
|
||||
|
||||
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-betterdocs-search-form';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return __('BetterDocs Search Form', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-betterdocs-search-form';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get widget keywords.
|
||||
*
|
||||
* Retrieve the list of keywords the widget belongs to.
|
||||
*
|
||||
* @since 3.5.2
|
||||
* @access public
|
||||
*
|
||||
* @return array Widget keywords.
|
||||
*/
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'knowledgebase',
|
||||
'knowledge Base',
|
||||
'documentation',
|
||||
'doc',
|
||||
'kb',
|
||||
'betterdocs',
|
||||
'ea betterdocs',
|
||||
'search',
|
||||
'search form',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/betterdocs-search-form/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
if (!defined('BETTERDOCS_URL')) {
|
||||
$this->start_controls_section(
|
||||
'eael_global_warning',
|
||||
[
|
||||
'label' => __('Warning!', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_global_warning_text',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('<strong>BetterDocs</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=BetterDocs&tab=search&type=term" target="_blank">BetterDocs</a> first.', 'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
} else {
|
||||
|
||||
/**
|
||||
* ----------------------------------------------------------
|
||||
* Section: Search Box
|
||||
* ----------------------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_search_box_settings',
|
||||
[
|
||||
'label' => __('Search Box', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'search_box_bg',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'search_box_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'default' => [
|
||||
'top' => 50,
|
||||
'right' => 50,
|
||||
'bottom' => 50,
|
||||
'left' => 50
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section(); # end of 'Search Box'
|
||||
|
||||
/**
|
||||
* ----------------------------------------------------------
|
||||
* Section: Search Field
|
||||
* ----------------------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_search_field_settings',
|
||||
[
|
||||
'label' => __('Search Field', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'section_search_field_placeholder',
|
||||
[
|
||||
'label' => __('Placeholder', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__('Search', 'essential-addons-for-elementor-lite'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'search_field_bg',
|
||||
[
|
||||
'label' => esc_html__('Field Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-searchform' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'search_field_text_color',
|
||||
[
|
||||
'label' => esc_html__('Field Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-searchform .betterdocs-search-field' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'search_field_text_typography',
|
||||
'selector' => '{{WRAPPER}} .betterdocs-searchform .betterdocs-search-field'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'search_field_padding',
|
||||
[
|
||||
'label' => __('Field Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-searchform .betterdocs-search-field' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'search_field_padding_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-searchform' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'search_field_border',
|
||||
'label' => __('Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .betterdocs-searchform',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'search_field_shadow',
|
||||
'label' => __('Shadow', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .betterdocs-searchform',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'field_search_icon_heading',
|
||||
[
|
||||
'label' => esc_html__('Search Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'field_search_icon_color',
|
||||
[
|
||||
'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-searchform svg.docs-search-icon' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'field_search_icon_size',
|
||||
[
|
||||
'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-searchform svg.docs-search-icon' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'field_close_icon_heading',
|
||||
[
|
||||
'label' => esc_html__('Close Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'search_field_close_icon_color',
|
||||
[
|
||||
'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .docs-search-close .close-line' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'search_field_close_icon_border_color',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .docs-search-loader, {{WRAPPER}} .docs-search-close .close-border' => 'stroke: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section(); # end of 'Search Field'
|
||||
|
||||
|
||||
/**
|
||||
* ----------------------------------------------------------
|
||||
* Section: Search Result Box
|
||||
* ----------------------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_search_result_settings',
|
||||
[
|
||||
'label' => __('Search Result Box', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'result_box_width',
|
||||
[
|
||||
'label' => __('Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 100,
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => ['%', 'px', 'em'],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'result_box_max_width',
|
||||
[
|
||||
'label' => __('Max Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 1600,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => ['px', 'em'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1600,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result' => 'max-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'result_box_bg',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'result_box_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section(); # end of 'Search Result Box'
|
||||
|
||||
/**
|
||||
* ----------------------------------------------------------
|
||||
* Section: Search Result Item
|
||||
* ----------------------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_search_result_item_settings',
|
||||
[
|
||||
'label' => __('Search Result List', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs('item_settings_tab');
|
||||
|
||||
// Normal State Tab
|
||||
$this->start_controls_tab(
|
||||
'item_normal',
|
||||
['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item',
|
||||
[
|
||||
'label' => esc_html__('Item', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'result_box_item_typography',
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li a'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item_color',
|
||||
[
|
||||
'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result li a' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'result_item_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'result_box_item_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result li a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'search_result_box_item_count',
|
||||
[
|
||||
'label' => esc_html__('Count', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'result_box_item_count_typography',
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li span'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item_count_color',
|
||||
[
|
||||
'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result li span' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
// Hover State Tab
|
||||
$this->start_controls_tab(
|
||||
'item_hover',
|
||||
['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'result_item_transition',
|
||||
[
|
||||
'label' => __('Transition', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 300,
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => ['%'],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'max' => 2500,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result li, {{WRAPPER}} .betterdocs-live-search .docs-search-result li a, {{WRAPPER}} .betterdocs-live-search .docs-search-result li span, {{WRAPPER}} .betterdocs-live-search .docs-search-result' => 'transition: {{SIZE}}ms;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item_hover_heading',
|
||||
[
|
||||
'label' => esc_html__('Item', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'result_box_item_hover_bg',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover',
|
||||
'exclude' => [
|
||||
'image'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item_hover_color',
|
||||
[
|
||||
'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover a' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'result_item_hover_border',
|
||||
'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item_hover_count_heading',
|
||||
[
|
||||
'label' => esc_html__('Count', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'result_box_item_hover_count_color',
|
||||
[
|
||||
'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover span' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_tab();
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->end_controls_section(); # end of 'Search Result Item'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
if (!defined('BETTERDOCS_URL')) return;
|
||||
$settings = $this->get_settings_for_display();
|
||||
$shortcode = sprintf('[betterdocs_search_form placeholder="'.$settings['section_search_field_placeholder'].'"]', apply_filters('eael_betterdocs_search_form_params', []));
|
||||
echo do_shortcode(shortcode_unautop($shortcode));
|
||||
}
|
||||
|
||||
public function render_plain_content()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
// In plain mode, render without shortcode
|
||||
echo '[betterdocs_search_form placeholder="'.$settings['section_search_field_placeholder'].'"]';
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Widget_Base;
|
||||
class Career_Page extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-career-page';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'EasyJobs Career Page', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-easyjobs';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'easyjobs',
|
||||
'addons',
|
||||
'ea',
|
||||
'career',
|
||||
'job',
|
||||
'career page',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://easy.jobs/docs/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'eael_global_warning',
|
||||
[
|
||||
'label' => __('Warning!', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_global_warning_text',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('<strong>EasyJobs</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=easyjobs&tab=search&type=term" target="_blank">EasyJobs</a> first.',
|
||||
'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
protected function render() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,853 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use Elementor\Modules\DynamicTags\Module as TagsModule;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
use \Essential_Addons_Elementor\Classes\Controls;
|
||||
|
||||
class Content_Ticker extends Widget_Base
|
||||
{
|
||||
|
||||
use \Essential_Addons_Elementor\Traits\Template_Query;
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-content-ticker';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Content Ticker', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-content-ticker';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'ticker',
|
||||
'ea ticker',
|
||||
'ea content ticker',
|
||||
'news headline',
|
||||
'news ticker',
|
||||
'text rotate',
|
||||
'text animation',
|
||||
'text swing',
|
||||
'text slide',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/content-ticker/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/**
|
||||
* Content Ticker Content Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_content_ticker_settings',
|
||||
[
|
||||
'label' => esc_html__('Ticker Settings', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_dynamic_template_Layout',
|
||||
[
|
||||
'label' => esc_html__('Template Layout', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'default',
|
||||
'options' => $this->get_template_list_for_dropdown(),
|
||||
]
|
||||
);
|
||||
|
||||
$ticker_options = apply_filters(
|
||||
'eael_ticker_options',
|
||||
[
|
||||
'options' => [
|
||||
'dynamic' => esc_html__('Dynamic', 'essential-addons-for-elementor-lite'),
|
||||
'custom' => esc_html__('Custom', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'conditions' => [
|
||||
'custom',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_ticker_type',
|
||||
[
|
||||
'label' => esc_html__('Ticker Type', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'dynamic',
|
||||
'label_block' => false,
|
||||
'options' => $ticker_options['options'],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_ticker_type_pro_alert',
|
||||
[
|
||||
'label' => esc_html__('Custom Content available in pro version only!', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_ticker_type' => $ticker_options['conditions'],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_ticker_tag_text',
|
||||
[
|
||||
'label' => esc_html__('Tag Text', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => false,
|
||||
'default' => esc_html__('Trending Today', 'essential-addons-for-elementor-lite'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Query Controls
|
||||
* @source includes/helper.php
|
||||
*/
|
||||
do_action('eael/controls/query', $this);
|
||||
|
||||
do_action('eael_ticker_custom_content_controls', $this);
|
||||
|
||||
/**
|
||||
* Content Tab: Carousel Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_additional_options',
|
||||
[
|
||||
'label' => __('Animation Settings', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'carousel_effect',
|
||||
[
|
||||
'label' => __('Effect', 'essential-addons-for-elementor-lite'),
|
||||
'description' => __('Sets transition effect', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'slide',
|
||||
'options' => [
|
||||
'slide' => __('Slide', 'essential-addons-for-elementor-lite'),
|
||||
'fade' => __('Fade', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'slider_speed',
|
||||
[
|
||||
'label' => __('Slider Speed', 'essential-addons-for-elementor-lite'),
|
||||
'description' => __('Duration of transition between slides (in ms)', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => ['size' => 400],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 3000,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => '',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'autoplay',
|
||||
[
|
||||
'label' => __('Autoplay', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'autoplay_speed',
|
||||
[
|
||||
'label' => __('Autoplay Speed', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => ['size' => 2000],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 500,
|
||||
'max' => 5000,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => '',
|
||||
'condition' => [
|
||||
'autoplay' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'pause_on_hover',
|
||||
[
|
||||
'label' => __('Pause On Hover', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'autoplay' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'infinite_loop',
|
||||
[
|
||||
'label' => __('Infinite Loop', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'grab_cursor',
|
||||
[
|
||||
'label' => __('Grab Cursor', 'essential-addons-for-elementor-lite'),
|
||||
'description' => __('Shows grab cursor when you hover over the slider', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'navigation_heading',
|
||||
[
|
||||
'label' => __('Navigation', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows',
|
||||
[
|
||||
'label' => __('Arrows', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'direction',
|
||||
[
|
||||
'label' => __('Direction', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'left',
|
||||
'options' => [
|
||||
'left' => __('Left', 'essential-addons-for-elementor-lite'),
|
||||
'right' => __('Right', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'separator' => 'before',
|
||||
'condition' => [
|
||||
'carousel_effect' => 'slide',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
if (!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Ticker Content Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_ticker_typography_settings',
|
||||
[
|
||||
'label' => esc_html__('Ticker Content', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_ticker_content_bg',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .eael-ticker' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_ticker_content_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#222222',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .eael-ticker .ticker-content a' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_ticker_hover_content_color',
|
||||
[
|
||||
'label' => esc_html__('Text Hover Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#f44336',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .eael-ticker .ticker-content a:hover' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_ticker_content_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-ticker-wrap .eael-ticker .ticker-content a',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_ticker_content_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .eael-ticker .ticker-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_ticker_content_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .eael-ticker' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_ticker_tag_style_settings',
|
||||
[
|
||||
'label' => esc_html__('Tag Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_ticker_tag_bg_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#222222',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .ticker-badge' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_ticker_tag_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .ticker-badge span' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_ticker_tag_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-ticker-wrap .ticker-badge span',
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_ticker_tag_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .ticker-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_ticker_tag_margin',
|
||||
[
|
||||
'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .ticker-badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_ticker_tag_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker-wrap .ticker-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab: Arrows
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_arrows_style',
|
||||
[
|
||||
'label' => __('Arrows', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'arrows' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'prev_arrow',
|
||||
[
|
||||
'label' => __('Choose Prev Arrow', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'value' => 'fas fa-angle-left',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrow_new',
|
||||
[
|
||||
'label' => __('Choose Next Arrow', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'arrow',
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'value' => 'fas fa-angle-right',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'arrows_size',
|
||||
[
|
||||
'label' => __('Arrows Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => ['size' => '22'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 5,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next, {{WRAPPER}} .eael-ticker .swiper-button-prev' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next img, {{WRAPPER}} .eael-ticker .swiper-button-prev img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next svg, {{WRAPPER}} .eael-ticker .swiper-button-prev svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'left_arrow_position',
|
||||
[
|
||||
'label' => __('Align Left Arrow', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => -100,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-prev' => 'right: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'right_arrow_position',
|
||||
[
|
||||
'label' => __('Align Right Arrow', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => -100,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 0,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next' => 'right: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs('tabs_arrows_style');
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_arrows_normal',
|
||||
[
|
||||
'label' => __('Normal', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows_bg_color_normal',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next, {{WRAPPER}} .eael-ticker .swiper-button-prev' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows_color_normal',
|
||||
[
|
||||
'label' => __('Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next, {{WRAPPER}} .eael-ticker .swiper-button-prev' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next svg, {{WRAPPER}} .eael-ticker .swiper-button-prev svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'arrows_border_normal',
|
||||
'label' => __('Border', 'essential-addons-for-elementor-lite'),
|
||||
'placeholder' => '1px',
|
||||
'default' => '1px',
|
||||
'selector' => '{{WRAPPER}} .eael-ticker .swiper-button-next, {{WRAPPER}} .eael-ticker .swiper-button-prev',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows_border_radius_normal',
|
||||
[
|
||||
'label' => __('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next, {{WRAPPER}} .eael-ticker .swiper-button-prev' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab(
|
||||
'tab_arrows_hover',
|
||||
[
|
||||
'label' => __('Hover', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows_bg_color_hover',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next:hover, {{WRAPPER}} .eael-ticker .swiper-button-prev:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows_color_hover',
|
||||
[
|
||||
'label' => __('Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next:hover, {{WRAPPER}} .eael-ticker .swiper-button-prev:hover' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next:hover svg, {{WRAPPER}} .eael-ticker .swiper-button-prev:hover svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'arrows_border_color_hover',
|
||||
[
|
||||
'label' => __('Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next:hover, {{WRAPPER}} .eael-ticker .swiper-button-prev:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->add_responsive_control(
|
||||
'arrows_padding',
|
||||
[
|
||||
'label' => __('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-ticker .swiper-button-next, {{WRAPPER}} .eael-ticker .swiper-button-prev' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$settings = Helper::fix_old_query($settings);
|
||||
$args = Helper::get_query_args($settings);
|
||||
|
||||
//Supported New SwiperJS version
|
||||
$swiper_class = $swiper_version_class = '';
|
||||
if ( class_exists( 'Elementor\Plugin' ) ) {
|
||||
$swiper_class = \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container';
|
||||
$swiper_version_class = 'swiper' === $swiper_class ? 'swiper-8' : 'swiper-8-lower';
|
||||
}
|
||||
|
||||
$this->add_render_attribute('content-ticker-wrap', 'class', 'eael-ticker');
|
||||
$this->add_render_attribute('content-ticker', 'class', esc_attr( $swiper_class ) );
|
||||
$this->add_render_attribute('content-ticker', 'class', esc_attr( $swiper_version_class ) );
|
||||
$this->add_render_attribute('content-ticker', 'class', 'eael-content-ticker');
|
||||
$this->add_render_attribute('content-ticker', 'class', 'swiper-container-' . esc_attr($this->get_id()));
|
||||
$this->add_render_attribute('content-ticker', 'data-pagination', '.swiper-pagination-' . esc_attr($this->get_id()));
|
||||
$this->add_render_attribute('content-ticker', 'data-arrow-next', '.swiper-button-next-' . esc_attr($this->get_id()));
|
||||
$this->add_render_attribute('content-ticker', 'data-arrow-prev', '.swiper-button-prev-' . esc_attr($this->get_id()));
|
||||
|
||||
if ($settings['direction'] == 'right') {
|
||||
$this->add_render_attribute('content-ticker', 'dir', 'rtl');
|
||||
}
|
||||
|
||||
if (!empty($settings['margin_tablet']['size'])) {
|
||||
$this->add_render_attribute('content-ticker', 'data-margin-tablet', $settings['margin_tablet']['size']);
|
||||
}
|
||||
if (!empty($settings['margin_mobile']['size'])) {
|
||||
$this->add_render_attribute('content-ticker', 'data-margin-mobile', $settings['margin_mobile']['size']);
|
||||
}
|
||||
if ($settings['carousel_effect']) {
|
||||
$this->add_render_attribute('content-ticker', 'data-effect', $settings['carousel_effect']);
|
||||
}
|
||||
if (!empty($settings['slider_speed']['size'])) {
|
||||
$this->add_render_attribute('content-ticker', 'data-speed', $settings['slider_speed']['size']);
|
||||
}
|
||||
if ($settings['autoplay'] == 'yes' && !empty($settings['autoplay_speed']['size'])) {
|
||||
$this->add_render_attribute('content-ticker', 'data-autoplay', $settings['autoplay_speed']['size']);
|
||||
} else {
|
||||
$this->add_render_attribute('content-ticker', 'data-autoplay', '999999');
|
||||
}
|
||||
if ($settings['pause_on_hover'] == 'yes') {
|
||||
$this->add_render_attribute('content-ticker', 'data-pause-on-hover', 'true');
|
||||
}
|
||||
if ($settings['infinite_loop'] == 'yes') {
|
||||
$this->add_render_attribute('content-ticker', 'data-loop', true);
|
||||
}
|
||||
if ($settings['grab_cursor'] == 'yes') {
|
||||
$this->add_render_attribute('content-ticker', 'data-grab-cursor', true);
|
||||
}
|
||||
if ($settings['arrows'] == 'yes') {
|
||||
$this->add_render_attribute('content-ticker', 'data-arrows', '1');
|
||||
}
|
||||
|
||||
echo '<div class="eael-ticker-wrap" id="eael-ticker-wrap-' . esc_attr( $this->get_id() ) . '">';
|
||||
if (!empty($settings['eael_ticker_tag_text'])) {
|
||||
echo '<div class="ticker-badge">
|
||||
<span>' . Helper::eael_wp_kses($settings['eael_ticker_tag_text']) . '</span>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '<div ' . $this->get_render_attribute_string('content-ticker-wrap') . '>
|
||||
<div ' . $this->get_render_attribute_string('content-ticker') . '>
|
||||
<div class="swiper-wrapper">';
|
||||
|
||||
if ('dynamic' === $settings['eael_ticker_type']) {
|
||||
|
||||
if (\file_exists($this->get_template($settings['eael_dynamic_template_Layout']))) {
|
||||
$query = new \WP_Query($args);
|
||||
if ($query->have_posts()) {
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
include $this->get_template($settings['eael_dynamic_template_Layout']);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
}
|
||||
} else {
|
||||
echo '<div class="swiper-slide"><a href="#" class="ticker-content">' . __('No content found!', 'essential-addons-for-elementor-lite') . '</a></div>';
|
||||
}
|
||||
} elseif ('custom' === $settings['eael_ticker_type'] && apply_filters('eael/is_plugin_active', 'essential-addons-elementor/essential_adons_elementor.php')) {
|
||||
if (\file_exists($this->get_template($settings['eael_dynamic_template_Layout']))) {
|
||||
foreach ($settings['eael_ticker_custom_contents'] as $content) {
|
||||
echo Helper::include_with_variable($this->get_template($settings['eael_dynamic_template_Layout']), ['content' => Helper::eael_wp_kses($content['eael_ticker_custom_content']), 'link' => $content['eael_ticker_custom_content_link']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '</div>
|
||||
</div>
|
||||
' . $this->render_arrows() . '
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render Content Ticker arrows output on the frontend.
|
||||
*
|
||||
* Written in PHP and used to generate the final HTML.
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function render_arrows()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
if ($settings['arrows'] == 'yes') {
|
||||
if (isset($settings['__fa4_migrated']['arrow_new']) || empty($settings['arrow'])) {
|
||||
$arrow = Helper::get_render_icon( $settings['arrow_new'] );
|
||||
} else {
|
||||
$arrow = '<i class="' . esc_attr( $settings['arrow'] ) . '"></i>';
|
||||
}
|
||||
|
||||
$html = '<div class="content-ticker-pagination">';
|
||||
|
||||
$html .= '<div class="swiper-button-next swiper-button-next-' . esc_attr( $this->get_id() ) . '">';
|
||||
if (isset($arrow['url'])) {
|
||||
$html .= '<img src="' . esc_url($arrow['url']) . '" alt="' . esc_attr(get_post_meta($arrow['id'], '_wp_attachment_image_alt', true)) . '" />';
|
||||
} else {
|
||||
$html .= $arrow;
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div class="swiper-button-prev swiper-button-prev-' . esc_attr( $this->get_id() ) . '">';
|
||||
if (isset($settings['prev_arrow']['value']['url'])) {
|
||||
$html .= '<img src="' . esc_url($settings['prev_arrow']['value']['url']) . '" alt="' . esc_attr(get_post_meta($settings['prev_arrow']['value']['id'], '_wp_attachment_image_alt', true)) . '" />';
|
||||
} else {
|
||||
$html .= Helper::get_render_icon( $settings['prev_arrow'] );
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,630 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use Elementor\Icons_Manager;
|
||||
use Elementor\Modules\DynamicTags\Module as TagsModule;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
|
||||
class Creative_Button extends Widget_Base
|
||||
{
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-creative-button';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Creative Button', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-creative-button';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'button',
|
||||
'ea button',
|
||||
'creative button',
|
||||
'ea creative button',
|
||||
'cta',
|
||||
'call to action',
|
||||
'ea',
|
||||
'marketing button',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/creative-buttons/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
|
||||
if ( !apply_filters( 'eael/pro_enabled', false ) ) {
|
||||
// Content Controls
|
||||
$this->start_controls_section(
|
||||
'eael_section_creative_button_content',
|
||||
[
|
||||
'label' => esc_html__('Button Content', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'creative_button_text',
|
||||
[
|
||||
'label' => __('Button Text', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => 'Click Me!',
|
||||
'placeholder' => __('Enter button text', 'essential-addons-for-elementor-lite'),
|
||||
'title' => __('Enter button text here', 'essential-addons-for-elementor-lite'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'creative_button_secondary_text',
|
||||
[
|
||||
'label' => __('Button Secondary Text', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => 'Go!',
|
||||
'placeholder' => __('Enter button secondary text', 'essential-addons-for-elementor-lite'),
|
||||
'title' => __('Enter button secondary text here', 'essential-addons-for-elementor-lite'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'creative_button_link_url',
|
||||
[
|
||||
'label' => esc_html__('Link URL', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
'categories' => [
|
||||
TagsModule::POST_META_CATEGORY,
|
||||
TagsModule::URL_CATEGORY,
|
||||
],
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'url' => '#',
|
||||
'is_external' => '',
|
||||
],
|
||||
'show_external' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_icon_new',
|
||||
[
|
||||
'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'eael_creative_button_icon',
|
||||
'condition' => [
|
||||
'creative_button_effect!' => ['eael-creative-button--tamaya'],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_icon_alignment',
|
||||
[
|
||||
'label' => esc_html__('Icon Position', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'left',
|
||||
'options' => [
|
||||
'left' => esc_html__('Before', 'essential-addons-for-elementor-lite'),
|
||||
'right' => esc_html__('After', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_creative_button_icon_new!' => '',
|
||||
'creative_button_effect!' => ['eael-creative-button--tamaya'],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_creative_button_icon_indent',
|
||||
[
|
||||
'label' => esc_html__('Icon Spacing', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 60,
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'eael_creative_button_icon_new!' => '',
|
||||
'creative_button_effect!' => ['eael-creative-button--tamaya'],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button-icon-right' => 'margin-left: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-creative-button-icon-left' => 'margin-right: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-creative-button--shikoba i' => 'left: {{SIZE}}%;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
} else {
|
||||
do_action('eael_creative_button_pro_controls', $this);
|
||||
}
|
||||
|
||||
if ( !apply_filters( 'eael/pro_enabled', false ) ) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
// Style Controls
|
||||
$this->start_controls_section(
|
||||
'eael_section_creative_button_settings',
|
||||
[
|
||||
'label' => esc_html__('Button Effects & Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
if (!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->add_control(
|
||||
'creative_button_effect',
|
||||
[
|
||||
'label' => esc_html__('Set Button Effect', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'eael-creative-button--default',
|
||||
'options' => [
|
||||
'eael-creative-button--default' => esc_html__('Default', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--winona' => esc_html__('Winona', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--ujarak' => esc_html__('Ujarak', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--wayra' => esc_html__('Wayra', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--tamaya' => esc_html__('Tamaya', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--rayen' => esc_html__('Rayen', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--pipaluk' => esc_html__('Pipaluk (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--moema' => esc_html__('Moema (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--wave' => esc_html__('Wave (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--aylen' => esc_html__('Aylen (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--saqui' => esc_html__('Saqui (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--wapasha' => esc_html__('Wapasha (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--nuka' => esc_html__('Nuka (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--antiman' => esc_html__('Antiman (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--quidel' => esc_html__('Quidel (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
'eael-creative-button--shikoba' => esc_html__('Shikoba (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'description' => '10 more effects on <a href="https://wpdeveloper.com/in/upgrade-essential-addons-elementor">Pro version</a>',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'use_gradient_background',
|
||||
[
|
||||
'label' => __('Use Gradient Background', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
$this->start_controls_tabs('eael_creative_button_tabs');
|
||||
|
||||
$this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]);
|
||||
|
||||
$this->add_control('eael_creative_button_icon_color',
|
||||
[
|
||||
'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button i' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button .creative-button-inner svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button svg' => 'fill: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button .eael-creative-button--tamaya-secondary' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_creative_button_background_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#f54',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak:hover' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'use_gradient_background' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_creative_button_gradient_background',
|
||||
'types' => ['gradient', 'classic'],
|
||||
'selector' => '
|
||||
{{WRAPPER}} .eael-creative-button,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak:hover,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::after
|
||||
',
|
||||
'condition' => [
|
||||
'use_gradient_background' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_creative_button_border',
|
||||
'selector' => '{{WRAPPER}} .eael-creative-button',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button' => 'border-radius: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-creative-button::before' => 'border-radius: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-creative-button::after' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab('eael_creative_button_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]);
|
||||
|
||||
$this->add_control('eael_creative_button_hover_icon_color',
|
||||
[
|
||||
'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button:hover i' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button:hover .creative-button-inner svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button:hover .cretive-button-text' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--winona::after' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_hover_background_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#f54',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button:hover' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak::before' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover::before' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya:hover' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'use_gradient_background' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_creative_button_hover_gradient_background',
|
||||
'types' => ['gradient', 'classic'],
|
||||
'selector' => '
|
||||
{{WRAPPER}} .eael-creative-button:hover,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--ujarak::before,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--wayra:hover::before,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya:hover,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before,
|
||||
{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen:hover::before
|
||||
',
|
||||
'condition' => [
|
||||
'use_gradient_background' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_creative_button_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button:hover' => 'border-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--wapasha::before' => 'border-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--antiman::before' => 'border-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--pipaluk::before' => 'border-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--quidel::before' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_creative_button_alignment',
|
||||
[
|
||||
'label' => esc_html__('Button Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button-wrapper' => 'justify-content: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_creative_button_width',
|
||||
[
|
||||
'label' => esc_html__('Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
'step' => 1,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_creative_button_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-creative-button .cretive-button-text, {{WRAPPER}} .eael-creative-button--winona::after, {{WRAPPER}} .eael-creative-button--rayen::before, {{WRAPPER}} .eael-creative-button--tamaya::after, {{WRAPPER}} .eael-creative-button--tamaya::before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_creative_button_icon_size',
|
||||
[
|
||||
'label' => esc_html__('Icon Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'default' => [
|
||||
'size' => 30,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
'step' => 1,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_creative_button_padding',
|
||||
[
|
||||
'label' => esc_html__('Button Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-creative-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--winona::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--winona > .creative-button-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--tamaya::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen::before' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--rayen > .creative-button-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-creative-button.eael-creative-button--saqui::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
do_action('eael_creative_button_style_pro_controls', $this);
|
||||
}
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'button_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-creative-button',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$icon_migrated = isset($settings['__fa4_migrated']['eael_creative_button_icon_new']);
|
||||
$icon_is_new = empty($settings['eael_creative_button_icon']);
|
||||
|
||||
$this->add_render_attribute('eael_creative_button', [
|
||||
'class' => ['eael-creative-button', esc_attr($settings['creative_button_effect'])],
|
||||
]);
|
||||
|
||||
if ( ! empty( $settings['creative_button_link_url']['url'] ) ) {
|
||||
$this->add_link_attributes( 'eael_creative_button', $settings['creative_button_link_url'] );
|
||||
}
|
||||
|
||||
if ($settings['creative_button_link_url']['is_external']) {
|
||||
$this->add_render_attribute('eael_creative_button', 'target');
|
||||
}
|
||||
|
||||
if ($settings['creative_button_link_url']['nofollow']) {
|
||||
$this->add_render_attribute('eael_creative_button', 'rel', 'nofollow');
|
||||
}
|
||||
|
||||
$this->add_render_attribute('eael_creative_button', 'data-text', esc_attr($settings['creative_button_secondary_text']));
|
||||
?>
|
||||
<div class="eael-creative-button-wrapper">
|
||||
|
||||
<a <?php echo $this->get_render_attribute_string('eael_creative_button'); ?>>
|
||||
|
||||
<?php if ($settings['creative_button_effect'] === 'eael-creative-button--tamaya' ) : ?>
|
||||
<div class="eael-creative-button--tamaya-secondary eael-creative-button--tamaya-before"><span><?php echo Helper::eael_wp_kses($settings['creative_button_secondary_text']); ?></span></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="creative-button-inner">
|
||||
|
||||
<?php if ($settings['creative_button_effect'] !== 'eael-creative-button--tamaya' && $settings['eael_creative_button_icon_alignment'] == 'left') : ?>
|
||||
<?php if ($icon_migrated || $icon_is_new) {
|
||||
echo '<span class="eael-creative-button-icon-left">';
|
||||
Icons_Manager::render_icon( $settings['eael_creative_button_icon_new'], [ 'aria-hidden' => 'true' ] );
|
||||
echo '</span>';
|
||||
} else { ?>
|
||||
<i class="<?php echo esc_attr($settings['eael_creative_button_icon']); ?> eael-creative-button-icon-left" aria-hidden="true"></i>
|
||||
<?php } ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="cretive-button-text"><?php echo Helper::eael_wp_kses($settings['creative_button_text']); ?></span>
|
||||
|
||||
<?php if ($settings['creative_button_effect'] !== 'eael-creative-button--tamaya' && $settings['eael_creative_button_icon_alignment'] == 'right') : ?>
|
||||
<?php if ($icon_migrated || $icon_is_new) {
|
||||
echo '<span class="eael-creative-button-icon-right">';
|
||||
Icons_Manager::render_icon( $settings['eael_creative_button_icon_new'], [ 'aria-hidden' => 'true' ] );
|
||||
echo '</span>';
|
||||
} else { ?>
|
||||
<i class="<?php echo esc_attr($settings['eael_creative_button_icon']); ?> eael-creative-button-icon-right" aria-hidden="true"></i>
|
||||
<?php } ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if ($settings['creative_button_effect'] === 'eael-creative-button--tamaya' ) : ?>
|
||||
<div class="eael-creative-button--tamaya-secondary eael-creative-button--tamaya-after"><span><?php echo Helper::eael_wp_kses($settings['creative_button_secondary_text']); ?></span></div>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
class EmbedPress extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-embedpress';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'EmbedPress', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-embedpress';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'embedpress',
|
||||
'ea embedpress',
|
||||
'audio',
|
||||
'video',
|
||||
'map',
|
||||
'youtube',
|
||||
'vimeo',
|
||||
'wistia',
|
||||
'google',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://embedpress.com/documentation';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'eael_global_warning',
|
||||
[
|
||||
'label' => __('Warning!', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_global_warning_text',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('<strong>EmbedPress</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=embedpress&tab=search&type=term" target="_blank">EmbedPress</a> first.',
|
||||
'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
protected function render() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,654 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Elementor\Repeater;
|
||||
use Essential_Addons_Elementor\Classes\Helper as HelperClass;
|
||||
|
||||
|
||||
class Fancy_Text extends Widget_Base {
|
||||
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-fancy-text';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Fancy Text', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-fancy-text';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'ea fancy text',
|
||||
'ea typing text',
|
||||
'animated headline',
|
||||
'Headline',
|
||||
'typewriter',
|
||||
'text effect',
|
||||
'text typing effect',
|
||||
'text animation',
|
||||
'animated heading',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'e-animations',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://essential-addons.com/elementor/docs/fancy-text/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
// Content Controls
|
||||
$this->start_controls_section(
|
||||
'eael_fancy_text_content',
|
||||
[
|
||||
'label' => esc_html__( 'Fancy Text', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_prefix',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Text', 'essential-addons-for-elementor-lite'),
|
||||
'placeholder' => esc_html__( 'Place your prefix text', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'This is the ', 'essential-addons-for-elementor-lite'),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_fancy_text_strings_text_field',
|
||||
[
|
||||
'label' => esc_html__( 'Fancy String', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_strings',
|
||||
[
|
||||
'label' => __( 'Fancy Text Strings', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'show_label' => true,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '{{ eael_fancy_text_strings_text_field }}',
|
||||
'default' => [
|
||||
[
|
||||
'eael_fancy_text_strings_text_field' => __( 'First string', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
[
|
||||
'eael_fancy_text_strings_text_field' => __( 'Second string', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
[
|
||||
'eael_fancy_text_strings_text_field' => __( 'Third string', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_suffix',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Text', 'essential-addons-for-elementor-lite'),
|
||||
'placeholder' => esc_html__( 'Place your suffix text', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( ' of the sentence.', 'essential-addons-for-elementor-lite'),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Settings Control
|
||||
$this->start_controls_section(
|
||||
'eael_fancy_text_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Fancy Text Settings', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$style_options = apply_filters(
|
||||
'fancy_text_style_types',
|
||||
[
|
||||
'styles' => [
|
||||
'style-1' => esc_html__( 'Style 1', 'essential-addons-for-elementor-lite'),
|
||||
'style-2' => esc_html__( 'Style 2 (Pro)', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'conditions' => ['style-2']
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style Type', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'style-1',
|
||||
'options' => $style_options['styles']
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_style_pro_alert',
|
||||
[
|
||||
'label' => esc_html__( 'Only available in pro version!', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_fancy_text_style' => $style_options['conditions'],
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_fancy_text_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-container' => 'text-align: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_transition_type',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Type', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'typing',
|
||||
'options' => [
|
||||
'typing' => esc_html__( 'Typing', 'essential-addons-for-elementor-lite'),
|
||||
'fadeIn' => esc_html__( 'Fade', 'essential-addons-for-elementor-lite'),
|
||||
'fadeInUp' => esc_html__( 'Fade Up', 'essential-addons-for-elementor-lite'),
|
||||
'fadeInDown' => esc_html__( 'Fade Down', 'essential-addons-for-elementor-lite'),
|
||||
'fadeInLeft' => esc_html__( 'Fade Left', 'essential-addons-for-elementor-lite'),
|
||||
'fadeInRight' => esc_html__( 'Fade Right', 'essential-addons-for-elementor-lite'),
|
||||
'zoomIn' => esc_html__( 'Zoom', 'essential-addons-for-elementor-lite'),
|
||||
'bounceIn' => esc_html__( 'Bounce', 'essential-addons-for-elementor-lite'),
|
||||
'swing' => esc_html__( 'Swing', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Typing Speed', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '50',
|
||||
'condition' => [
|
||||
'eael_fancy_text_transition_type' => 'typing',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_delay',
|
||||
[
|
||||
'label' => esc_html__( 'Delay on Change', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '2500'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_loop',
|
||||
[
|
||||
'label' => esc_html__( 'Loop the animation', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_cursor',
|
||||
[
|
||||
'label' => esc_html__( 'Display Type Cursor', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eael_fancy_text_transition_type' => 'typing',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
if(!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>'
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_fancy_text_prefix_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Text Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_prefix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-prefix' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'fields_options' => [
|
||||
'typography' => ['default' => 'yes'],
|
||||
'font_size' => ['default' => ['size' => 22]],
|
||||
'font_weight' => ['default' => 600],
|
||||
'line_height' => ['default' => ['size' => 1]],
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-fancy-text-prefix',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_fancy_text_strings_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Fancy Text Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_color_selector',
|
||||
[
|
||||
'label' => esc_html__('Choose Background Type', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'solid-color' => [
|
||||
'title' => __('Color', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-paint-brush',
|
||||
],
|
||||
'gradient-color' => [
|
||||
'title' => __('Gradient', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-barcode',
|
||||
],
|
||||
],
|
||||
'toggle' => true,
|
||||
'default' => 'solid-color',
|
||||
'condition' => [
|
||||
'eael_fancy_text_style' => 'style-1',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_strings_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-strings' => 'background: {{VALUE}};',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'eael_fancy_text_color_selector',
|
||||
'operator' => '==',
|
||||
'value' => 'solid-color',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'eael_fancy_text_style',
|
||||
'operator' => '==',
|
||||
'value' => 'style-2',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_fancy_text_color_gradient',
|
||||
'types' => ['gradient'],
|
||||
'fields_options' => [
|
||||
'background' => [
|
||||
'label' => _x( 'Gradient Color', 'Text Shadow Control', 'elementor' ),
|
||||
'toggle' => false,
|
||||
'default' => 'gradient',
|
||||
],
|
||||
'color' => [
|
||||
'default' => '#062ACA',
|
||||
],
|
||||
'color_b' => [
|
||||
'default' => '#9401D9',
|
||||
]
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-fancy-text-strings',
|
||||
'condition' => [
|
||||
'eael_fancy_text_color_selector' => 'gradient-color',
|
||||
'eael_fancy_text_style' => 'style-1',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_fancy_text_strings_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'fields_options' => [
|
||||
'typography' => ['default' => 'yes'],
|
||||
'font_size' => ['default' => ['size' => 22]],
|
||||
'font_weight' => ['default' => 600],
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-fancy-text-strings, {{WRAPPER}} .typed-cursor',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_strings_color',
|
||||
[
|
||||
'label' => esc_html__( 'Solid Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-strings' => 'color: {{VALUE}};',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'eael_fancy_text_style',
|
||||
'operator' => '==',
|
||||
'value' => 'style-1',
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'eael_fancy_text_style',
|
||||
'operator' => '==',
|
||||
'value' => 'style-2',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_cursor_color',
|
||||
[
|
||||
'label' => esc_html__( 'Typing Cursor Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-strings::after' => 'color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_fancy_text_cursor' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_fancy_text_strings_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-strings' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_fancy_text_strings_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-strings' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_fancy_text_strings_border',
|
||||
'selector' => '{{WRAPPER}} .eael-fancy-text-strings',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_strings_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-strings' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_fancy_text_suffix_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Text Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_fancy_text_suffix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-fancy-text-suffix' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'ending_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'fields_options' => [
|
||||
'typography' => ['default' => 'yes'],
|
||||
'font_size' => ['default' => ['size' => 22]],
|
||||
'font_weight' => ['default' => 600],
|
||||
'line_height' => ['default' => ['size' => 1]],
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-fancy-text-suffix',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
public function fancy_text($settings) {
|
||||
$fancy_text = array("");
|
||||
foreach ( $settings as $item ) {
|
||||
if ( ! empty( $item['eael_fancy_text_strings_text_field'] ) ) {
|
||||
$fancy_text[] = HelperClass::eael_wp_kses( html_entity_decode( $item['eael_fancy_text_strings_text_field'] ) );
|
||||
}
|
||||
}
|
||||
return implode("|",$fancy_text);
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$fancy_text = $this->fancy_text($settings['eael_fancy_text_strings']);
|
||||
if(!apply_filters('eael/pro_enabled', false)) { $settings['eael_fancy_text_style'] = 'style-1'; }
|
||||
$this->add_render_attribute( 'fancy-text', 'class', 'eael-fancy-text-container' );
|
||||
$this->add_render_attribute( 'fancy-text', 'class', esc_attr($settings['eael_fancy_text_style']) );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text-id', esc_attr($this->get_id()) );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text', $fancy_text );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text-transition-type', $settings['eael_fancy_text_transition_type'] );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text-speed', $settings['eael_fancy_text_speed'] );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text-delay', $settings['eael_fancy_text_delay'] );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text-cursor', $settings['eael_fancy_text_cursor'] );
|
||||
$this->add_render_attribute( 'fancy-text', 'data-fancy-text-loop', $settings['eael_fancy_text_loop'] );
|
||||
?>
|
||||
|
||||
<div <?php echo $this->get_render_attribute_string( 'fancy-text' ); ?> >
|
||||
<?php if ( ! empty( $settings['eael_fancy_text_prefix'] ) ) : ?>
|
||||
<span class="eael-fancy-text-prefix"><?php echo HelperClass::eael_wp_kses($settings['eael_fancy_text_prefix']); ?> </span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_fancy_text_transition_type'] == 'fancy' ) : ?>
|
||||
<span id="eael-fancy-text-<?php echo esc_attr($this->get_id()); ?>" class="eael-fancy-text-strings
|
||||
<?php echo esc_attr( $settings['eael_fancy_text_color_selector'] ) ?>"></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_fancy_text_transition_type'] != 'fancy' ) : ?>
|
||||
<span id="eael-fancy-text-<?php echo esc_attr($this->get_id()); ?>" class="eael-fancy-text-strings <?php echo esc_attr( $settings['eael_fancy_text_color_selector'] ); ?>">
|
||||
<noscript>
|
||||
<?php
|
||||
$eael_fancy_text_strings_list = "";
|
||||
foreach ( $settings['eael_fancy_text_strings'] as $item ) {
|
||||
$eael_fancy_text_strings_list .= HelperClass::eael_wp_kses($item['eael_fancy_text_strings_text_field']) . ', ';
|
||||
}
|
||||
echo rtrim($eael_fancy_text_strings_list, ", ");
|
||||
?>
|
||||
</noscript>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $settings['eael_fancy_text_suffix'] ) ) : ?>
|
||||
<span class="eael-fancy-text-suffix"> <?php echo HelperClass::eael_wp_kses($settings['eael_fancy_text_suffix']); ?></span>
|
||||
<?php endif; ?>
|
||||
</div><!-- close .eael-fancy-text-container -->
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,640 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( !defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Elementor\Repeater;
|
||||
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
class Image_Accordion extends Widget_Base {
|
||||
public function get_name() {
|
||||
return 'eael-image-accordion';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Image Accordion', 'essential-addons-for-elementor-lite' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-image-accrodion';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'image',
|
||||
'ea image accordion',
|
||||
'image effect',
|
||||
'hover effect',
|
||||
'creative image',
|
||||
'gallery',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://essential-addons.com/elementor/docs/image-accordion/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
/**
|
||||
* Image accordion Content Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_img_accordion_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'essential-addons-for-elementor-lite' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_img_accordion_type',
|
||||
[
|
||||
'label' => esc_html__( 'Accordion Style', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'on-hover',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'on-hover' => esc_html__( 'On Hover', 'essential-addons-for-elementor-lite' ),
|
||||
'on-click' => esc_html__( 'On Click', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_img_accordion_direction',
|
||||
[
|
||||
'label' => esc_html__( 'Direction', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'on-hover',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'accordion-direction-horizontal' => esc_html__( 'Horizontal', 'essential-addons-for-elementor-lite' ),
|
||||
'accordion-direction-vertical' => esc_html__( 'Vertical', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
'default' => 'accordion-direction-horizontal',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_img_accordion_content_heading',
|
||||
[
|
||||
'label' => __( 'Content', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => \Elementor\Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_img_accordion_content_horizontal_align',
|
||||
[
|
||||
'label' => __( 'Horizontal Alignment', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => \Elementor\Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __( 'Left', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __( 'Center', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __( 'Right', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => true,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_img_accordion_content_vertical_align',
|
||||
[
|
||||
'label' => __( 'Vertical Alignment', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => \Elementor\Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => __( 'Top', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'fa fa-arrow-circle-up',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __( 'Center', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => __( 'Bottom', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'fa fa-arrow-circle-down',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_tag',
|
||||
[
|
||||
'label' => __( 'Select Tag', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'h2',
|
||||
'options' => [
|
||||
'h1' => __( 'H1', 'essential-addons-for-elementor-lite' ),
|
||||
'h2' => __( 'H2', 'essential-addons-for-elementor-lite' ),
|
||||
'h3' => __( 'H3', 'essential-addons-for-elementor-lite' ),
|
||||
'h4' => __( 'H4', 'essential-addons-for-elementor-lite' ),
|
||||
'h5' => __( 'H5', 'essential-addons-for-elementor-lite' ),
|
||||
'h6' => __( 'H6', 'essential-addons-for-elementor-lite' ),
|
||||
'span' => __( 'Span', 'essential-addons-for-elementor-lite' ),
|
||||
'p' => __( 'P', 'essential-addons-for-elementor-lite' ),
|
||||
'div' => __( 'Div', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_accordion_is_active',
|
||||
[
|
||||
'label' => __( 'Make it active?', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ),
|
||||
'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_accordion_bg',
|
||||
[
|
||||
'label' => esc_html__( 'Background Image', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'url' => EAEL_PLUGIN_URL . '/assets/front-end/img/accordion.png',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_accordion_tittle',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Accordion item title', 'essential-addons-for-elementor-lite' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_accordion_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Accordion content goes here!', 'essential-addons-for-elementor-lite' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_accordion_enable_title_link',
|
||||
[
|
||||
'label' => esc_html__( 'Enable Title Link', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Show', 'your-plugin' ),
|
||||
'label_off' => __( 'Hide', 'your-plugin' ),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'eael_accordion_title_link',
|
||||
[
|
||||
'name' => 'eael_accordion_title_link',
|
||||
'label' => esc_html__( 'Title Link', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'url' => '#',
|
||||
'is_external' => '',
|
||||
],
|
||||
'show_external' => true,
|
||||
'condition' => [
|
||||
'eael_accordion_enable_title_link' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_img_accordions',
|
||||
[
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'seperator' => 'before',
|
||||
'default' => [
|
||||
[
|
||||
'eael_accordion_tittle' => esc_html__( 'Image Accordion #1', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_content' => esc_html__( 'Image Accordion Content Goes Here! Click edit button to change this text.', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_bg' => [
|
||||
'url' => EAEL_PLUGIN_URL . '/assets/front-end/img/accordion.png',
|
||||
]
|
||||
],
|
||||
[
|
||||
'eael_accordion_tittle' => esc_html__( 'Image Accordion #2', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_content' => esc_html__( 'Image Accordion Content Goes Here! Click edit button to change this text.', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_bg' => [
|
||||
'url' => EAEL_PLUGIN_URL . '/assets/front-end/img/accordion.png',
|
||||
]
|
||||
],
|
||||
[
|
||||
'eael_accordion_tittle' => esc_html__( 'Image Accordion #3', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_content' => esc_html__( 'Image Accordion Content Goes Here! Click edit button to change this text.', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_bg' => [
|
||||
'url' => EAEL_PLUGIN_URL . '/assets/front-end/img/accordion.png',
|
||||
]
|
||||
],
|
||||
[
|
||||
'eael_accordion_tittle' => esc_html__( 'Image Accordion #4', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_content' => esc_html__( 'Image Accordion Content Goes Here! Click edit button to change this text.', 'essential-addons-for-elementor-lite' ),
|
||||
'eael_accordion_bg' => [
|
||||
'url' => EAEL_PLUGIN_URL . '/assets/front-end/img/accordion.png',
|
||||
]
|
||||
],
|
||||
],
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '{{eael_accordion_tittle}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Image accordion)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_img_accordion_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'essential-addons-for-elementor-lite' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_height',
|
||||
[
|
||||
'label' => esc_html__( 'Height', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '400',
|
||||
'description' => 'Unit in px',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion ' => 'height: {{VALUE}}px;',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_bg_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_accordion_container_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_accordion_container_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_accordion_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite' ),
|
||||
'selector' => '{{WRAPPER}} .eael-img-accordion',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 4,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion' => 'border-radius: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-img-accordion a:first-child' => 'border-radius: {{SIZE}}px 0 0 {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-img-accordion a:last-child' => 'border-radius: 0 {{SIZE}}px {{SIZE}}px 0;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_accordion_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-img-accordion',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_img_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(0, 0, 0, .3)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-hover:before' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_img_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Overlay Color', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(0, 0, 0, .5)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-hover:hover::before' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-hover.overlay-active:hover::before' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-hover.overlay-active:before' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Thumbnail Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_img_accordion_thumbnail_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Thumbnail', 'essential-addons-for-elementor-lite' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_image_accordion_thumbnail_margin',
|
||||
[
|
||||
'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_image_accordion_thumbnail_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_image_accordion_thumbnail_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .eael-image-accordion-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_image_accordion_thumbnail_border',
|
||||
'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
|
||||
'selector' => '{{WRAPPER}} .eael-img-accordion .eael-image-accordion-item',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style (Image accordion Content Style)
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_img_accordion_typography_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Color & Typography', 'essential-addons-for-elementor-lite' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_title_text',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .overlay .img-accordion-title' => 'color: {{VALUE}} !important;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_accordion_title_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-img-accordion .overlay .img-accordion-title',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_content_text',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_accordion_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-img-accordion .overlay p' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_accordion_content_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-img-accordion .overlay p',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
$horizontal_alignment = 'eael-img-accordion-horizontal-align-' . $settings[ 'eael_img_accordion_content_horizontal_align' ];
|
||||
$vertical_alignment = 'eael-img-accordion-vertical-align-' . $settings[ 'eael_img_accordion_content_vertical_align' ];
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael-image-accordion',
|
||||
[
|
||||
'class' => [
|
||||
'eael-img-accordion',
|
||||
$settings[ 'eael_img_accordion_direction' ],
|
||||
$horizontal_alignment,
|
||||
$vertical_alignment,
|
||||
],
|
||||
'id' => 'eael-img-accordion-' . $this->get_id(),
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_render_attribute( 'eael-image-accordion', 'data-img-accordion-id', esc_attr( $this->get_id() ) );
|
||||
$this->add_render_attribute( 'eael-image-accordion', 'data-img-accordion-type', $settings[ 'eael_img_accordion_type' ] );
|
||||
if ( empty( $settings[ 'eael_img_accordions' ] ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div <?php echo $this->get_render_attribute_string( 'eael-image-accordion' ); ?>>
|
||||
<?php foreach ( $settings[ 'eael_img_accordions' ] as $key => $img_accordion ): ?>
|
||||
<?php
|
||||
$active = $img_accordion['eael_accordion_is_active'];
|
||||
$activeCSS = ( $active === 'yes' ? ' flex: 3 1 0%;' : '' );
|
||||
$this->add_render_attribute(
|
||||
'eael-image-accordion-item-wrapper-' . $key,
|
||||
[
|
||||
'class' => 'eael-image-accordion-hover eael-image-accordion-item',
|
||||
'style' => "background-image: url(" . esc_url( $img_accordion['eael_accordion_bg']['url'] ) . ");" . $activeCSS,
|
||||
]
|
||||
);
|
||||
if ( $active === 'yes' ) {
|
||||
$this->add_render_attribute( 'eael-image-accordion-item-wrapper-' . $key, 'class', 'overlay-active' );
|
||||
}
|
||||
?>
|
||||
|
||||
<div <?php echo $this->get_render_attribute_string( 'eael-image-accordion-item-wrapper-' . $key ); ?> tabindex="0">
|
||||
<div class="overlay">
|
||||
<div class="overlay-inner <?php echo( $active === 'yes' ? ' overlay-inner-show' : '' ); ?>">
|
||||
<?php
|
||||
$title_linked = false;
|
||||
if ( $img_accordion['eael_accordion_enable_title_link'] == 'yes' && $img_accordion['eael_accordion_title_link']['url'] !== '#' && $img_accordion['eael_accordion_title_link']['url'] ) {
|
||||
$this->add_link_attributes( 'eael-image-accordion-link-' . $key, $img_accordion['eael_accordion_title_link'] );
|
||||
$title_linked = true;
|
||||
echo "<a ". $this->get_render_attribute_string( 'eael-image-accordion-link-' . $key ) .">";
|
||||
}
|
||||
if ( !empty( $img_accordion[ 'eael_accordion_tittle' ] ) ):
|
||||
printf( '<%1$s class="img-accordion-title">%2$s</%1$s>', Helper::eael_validate_html_tag($settings[ 'title_tag' ]), Helper::eael_wp_kses($img_accordion[ 'eael_accordion_tittle' ]) );
|
||||
endif;
|
||||
|
||||
echo $title_linked ? '</a>' : '';
|
||||
|
||||
if ( !empty( $img_accordion[ 'eael_accordion_content' ] ) ):
|
||||
?>
|
||||
<p><?php echo sprintf( "%s", $this->parse_text_editor( $img_accordion[ 'eael_accordion_content' ] ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php
|
||||
if ( !empty( $settings[ 'eael_img_accordions' ] ) ) {
|
||||
if ( 'on-hover' === $settings[ 'eael_img_accordion_type' ] ) {
|
||||
echo '<style typr="text/css">
|
||||
#eael-img-accordion-' . esc_html( $this->get_id() ) . ' .eael-image-accordion-hover:hover {
|
||||
flex: 3 1 0% !important;
|
||||
}
|
||||
#eael-img-accordion-' . esc_html( $this->get_id() ) . ' .eael-image-accordion-hover:hover:hover .overlay-inner * {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: none;
|
||||
transition: all .3s .3s;
|
||||
}
|
||||
</style>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,801 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Classes\Helper as HelperClass;
|
||||
use Essential_Addons_Elementor\Traits\Helper;
|
||||
|
||||
class Post_Timeline extends Widget_Base
|
||||
{
|
||||
use Helper;
|
||||
|
||||
protected $page_id;
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-post-timeline';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return __('Post Timeline', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-post-timeline';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-for-elementor-lite'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'post',
|
||||
'posts',
|
||||
'timeline',
|
||||
'ea post timeline',
|
||||
'ea posts timeline',
|
||||
'blog posts',
|
||||
'content marketing',
|
||||
'blogger',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/post-timeline/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
|
||||
/**
|
||||
* Query And Layout Controls!
|
||||
* @source includes/elementor-helper.php
|
||||
*/
|
||||
do_action('eael/controls/query', $this);
|
||||
do_action('eael/controls/layout', $this);
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_post_timeline_links',
|
||||
[
|
||||
'label' => __('Links', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'timeline_link_nofollow',
|
||||
[
|
||||
'label' => __('No Follow', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'timeline_link_target_blank',
|
||||
[
|
||||
'label' => __('Target Blank', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Yes', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('No', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
if (!apply_filters('eael/pro_enabled', false)) {
|
||||
HelperClass::go_premium($this);
|
||||
}
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_post_timeline_style',
|
||||
[
|
||||
'label' => __('Timeline Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_display_overlay',
|
||||
[
|
||||
'label' => __('Show Overlay', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-image' => 'opacity: .6',
|
||||
],
|
||||
'condition'=> [
|
||||
'eael_dynamic_template_Layout!' => 'card',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_overlay_color',
|
||||
[
|
||||
'label' => __('Overlay Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'description' => __('Leave blank or Clear to use default gradient overlay', 'essential-addons-for-elementor-lite'),
|
||||
'default' => 'linear-gradient(45deg, #3f3f46 0%, #05abe0 100%) repeat scroll 0 0 rgba(0, 0, 0, 0)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-inner' => 'background: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_timeline_display_overlay' => 'yes',
|
||||
'eael_dynamic_template_Layout!' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_bg_color',
|
||||
[
|
||||
'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#3DB1C0',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-inner' => 'background: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_grid_spacing',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_timeline_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-inner' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_post_timeline_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-timeline-post-inner',
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_timeline_content_heading',
|
||||
[
|
||||
'label' => esc_html__('Content', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'card',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_post_timeline_content_spacing',
|
||||
[
|
||||
'label' => esc_html__('Spacing', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'card',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_post_timeline_image_heading',
|
||||
[
|
||||
'label' => esc_html__('Image', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout!' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_timeline_image_height',
|
||||
[
|
||||
'label' => esc_html__('Height', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-image' => 'height: {{SIZE}}PX;',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout!' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_img_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout!' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_typography',
|
||||
[
|
||||
'label' => __('Typography', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_title_style',
|
||||
[
|
||||
'label' => __('Title Style', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_title_color',
|
||||
[
|
||||
'label' => __('Title Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-title .eael-timeline-post-title-text' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .timeline-layout-card .eael-timeline-post-title .eael-timeline-post-title-text-card' => 'color: {{VALUE}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_timeline_title_alignment',
|
||||
[
|
||||
'label' => __('Title Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-title .eael-timeline-post-title-text' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_timeline_title_typography',
|
||||
'label' => __('Title Typography', 'essential-addons-for-elementor-lite'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-timeline-post-title .eael-timeline-post-title-text',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_excerpt_style',
|
||||
[
|
||||
'label' => __('Excerpt Style', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_excerpt_color',
|
||||
[
|
||||
'label' => __('Excerpt Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ffffff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-excerpt p' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_timeline_excerpt_alignment',
|
||||
[
|
||||
'label' => __('Excerpt Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __('Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __('Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __('Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
'title' => __('Justified', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-excerpt p' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_timeline_excerpt_typography',
|
||||
'label' => __('Excerpt Typography', 'essential-addons-for-elementor-lite'),
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_TEXT,
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-timeline-post-excerpt p',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Start Arrow Styling
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_arrow',
|
||||
[
|
||||
'label' => __('Arrow', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_border_color',
|
||||
[
|
||||
'label' => __('Border & Arrow Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#e5eaed',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-inner' => 'border-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-timeline-post-inner::after' => 'border-left-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-timeline-post:nth-child(2n) .eael-timeline-post-inner::after' => 'border-right-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_arrow_color',
|
||||
[
|
||||
'label' => __('Arrow Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#3DB1C0',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post-inner' => 'border-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-timeline-post-inner::after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}}',
|
||||
// '{{WRAPPER}} .eael-timeline-post:nth-child(2n) .eael-timeline-post-inner::after' => 'border-right-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout!' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_timeline_arrow_size',
|
||||
[
|
||||
'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 20,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-post-timeline.timeline-layout-card .eael-timeline-post-inner:after' => 'border-width: {{SIZE}}px; right: -{{SIZE}}px; left: -{{SIZE}}px',
|
||||
'{{WRAPPER}} .eael-post-timeline.timeline-layout-card .eael-timeline-post:nth-child(2n) .eael-timeline-post-inner:after' => 'left: -{{SIZE}}px;',
|
||||
],
|
||||
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout!' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_arrow_alignment',
|
||||
[
|
||||
'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => __( 'Top', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'middle' => [
|
||||
'title' => __( 'Middle', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => __( 'Bottom', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'default' => 'top',
|
||||
'condition' => [
|
||||
'eael_dynamic_template_Layout!' => 'default',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Start Time Styling
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_time',
|
||||
[
|
||||
'label' => __('Time', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_date_background_color',
|
||||
[
|
||||
'label' => __('Date Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(0, 0, 0, 0.7)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post time' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-timeline-post time::before' => 'border-bottom-color: {{VALUE}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_date_color',
|
||||
[
|
||||
'label' => __('Date Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post time' => 'color: {{VALUE}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_timeline_time_typography',
|
||||
'label' => __('Typography', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} time',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_time_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} time' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_time_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} time' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_line',
|
||||
[
|
||||
'label' => __('Line & Bullet', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_section_post_timeline_line_heading',
|
||||
[
|
||||
'label' => __('Line', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_section_post_timeline_line_size',
|
||||
[
|
||||
'label' => __('Line Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 20,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post:after' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_post_timeline_line_position_from_right',
|
||||
[
|
||||
'label' => __('Line Position From Right', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 20,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post:after' => 'right: -{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition'=> [
|
||||
'eael_dynamic_template_Layout!' => 'card',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_section_post_timeline_bullet_size',
|
||||
[
|
||||
'label' => __('Bullet Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-bullet' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_post_timeline_bullet_position_from_left',
|
||||
[
|
||||
'label' => __('Left-sided Bullet Positon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-bullet' => 'right: -{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition'=> [
|
||||
'eael_dynamic_template_Layout!' => 'card',
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_section_post_timeline_bullet_position_from_right',
|
||||
[
|
||||
'label' => __('Right-sided Bullet Position', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post:nth-child(2n) .eael-timeline-bullet' => 'left: -{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition'=> [
|
||||
'eael_dynamic_template_Layout!' => 'card',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_bullet_color',
|
||||
[
|
||||
'label' => __('Timeline Bullet Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#9fa9af',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-bullet' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_bullet_border_color',
|
||||
[
|
||||
'label' => __('Timeline Bullet Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-bullet' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_timeline_vertical_line_color',
|
||||
[
|
||||
'label' => __('Timeline Vertical Line Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(83, 85, 86, .2)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-timeline-post:after' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
do_action('eael/controls/load_more_button_style', $this);
|
||||
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$settings = HelperClass::fix_old_query($settings);
|
||||
$args = HelperClass::get_query_args($settings);
|
||||
$args = HelperClass::get_dynamic_args($settings, $args);
|
||||
|
||||
$settings ['expanison_indicator'] = $settings['excerpt_expanison_indicator'];
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael_post_timeline_wrapper',
|
||||
[
|
||||
'id' => "eael-post-timeline-{$this->get_id()}",
|
||||
'class' => ["eael-post-timeline", "timeline-layout-{$settings['eael_dynamic_template_Layout']}", "eael-post-timeline-arrow-{$settings['eael_timeline_arrow_alignment']}"],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael_post_timeline',
|
||||
[
|
||||
'class' => ['eael-post-timeline', 'eael-post-appender', "eael-post-appender-{$this->get_id()}"],
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div ' . $this->get_render_attribute_string('eael_post_timeline_wrapper') . '>
|
||||
<div ' . $this->get_render_attribute_string('eael_post_timeline') . '>';
|
||||
|
||||
$template = $this->get_template($this->get_settings('eael_dynamic_template_Layout'));
|
||||
$settings['loadable_file_name'] = $this->get_filename_only($template);
|
||||
$dir_name = $this->get_temp_dir_name($settings['loadable_file_name']);
|
||||
$found_posts = 0;
|
||||
|
||||
if(file_exists($template)){
|
||||
$query = new \WP_Query($args);
|
||||
if ($query->have_posts()) {
|
||||
$found_posts = $query->found_posts;
|
||||
$ppp = empty( $args['posts_per_page'] ) ? get_option( 'posts_per_page' ) : $args['posts_per_page'];
|
||||
$max_page = ceil( $found_posts / absint( $ppp ) );
|
||||
$args['max_page'] = $max_page;
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
include($template);
|
||||
}
|
||||
} else {
|
||||
_e('<p class="no-posts-found">No posts found!</p>', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
wp_reset_postdata();
|
||||
} else {
|
||||
_e('<p class="no-posts-found">No layout found!</p>', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
echo '</div>
|
||||
</div>';
|
||||
|
||||
if ( $found_posts > $args['posts_per_page'] ) {
|
||||
$this->print_load_more_button( $settings, $args, $dir_name );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,543 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Icons_Manager;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
class SVG_Draw extends Widget_Base {
|
||||
public function get_name() {
|
||||
return 'eael-svg-draw';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'SVG Draw', 'essential-addons-for-elementor-lite' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-svg-draw';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'svg',
|
||||
'draq',
|
||||
'ea svg',
|
||||
'ea svg draw',
|
||||
'animation',
|
||||
'icon',
|
||||
'icon animation',
|
||||
'svg animation',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://essential-addons.com/elementor/docs/ea-svg-draw/';
|
||||
}
|
||||
|
||||
protected function default_custom_svg() {
|
||||
return '<?xml version="1.0"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="Icons" viewBox="0 0 74 74" width="512" height="512">
|
||||
<path d="M65,72H9a3,3,0,0,1-3-3V30a1,1,0,0,1,2,0V69a1,1,0,0,0,1,1H65a1,1,0,0,0,1-1V30a1,1,0,0,1,2,0V69A3,3,0,0,1,65,72Z"/>
|
||||
<path d="M70,31H52.31a1,1,0,0,1,0-2H70V19H4V29H21.69a1,1,0,1,1,0,2H4a2,2,0,0,1-2-2V19a2,2,0,0,1,2-2H70a2,2,0,0,1,2,2V29A2,2,0,0,1,70,31Z"/>
|
||||
<path d="M37,19a1,1,0,0,1-.86-1.509c2.193-3.712,7.618-12.538,10.615-14.326a8.2,8.2,0,1,1,8.4,14.078c-1.222.73-3.7,1.319-7.369,1.75a1,1,0,1,1-.233-1.986c4.439-.522,6.025-1.151,6.576-1.48A6.179,6.179,0,0,0,56.971,11.7a6.194,6.194,0,0,0-9.191-6.818c-2.126,1.269-6.517,7.871-9.918,13.626A1,1,0,0,1,37,19Z"/>
|
||||
<path d="M37,19a1,1,0,0,1-.862-.491c-3.4-5.756-7.792-12.358-9.917-13.626a6.2,6.2,0,1,0-6.347,10.644c.55.329,2.136.958,6.576,1.48a1,1,0,1,1-.233,1.986c-3.667-.431-6.147-1.02-7.369-1.75a8.2,8.2,0,1,1,8.4-14.078c3,1.788,8.42,10.614,10.614,14.326A1,1,0,0,1,37,19Z"/>
|
||||
<path d="M42,72H32a1,1,0,0,1-1-1V29.12a1,1,0,0,1,2,0V70h8V29.12a1,1,0,0,1,2,0V71A1,1,0,0,1,42,72Z"/>
|
||||
<path d="M41.94,30H32.06a1,1,0,1,1,0-2h9.88a1,1,0,0,1,0,2Z"/>
|
||||
<path d="M46.692,40.563a1,1,0,0,1-.912-.59L36.088,18.41a1,1,0,0,1,1.824-.82l8.613,19.162,1.29-4.114a1,1,0,0,1,1.365-.613l3.77,1.7-7.163-15.3a1,1,0,1,1,1.812-.848L55.906,35.32a1,1,0,0,1-1.316,1.335l-5.2-2.344-1.74,5.55a1,1,0,0,1-.895.7Z"/>
|
||||
<path d="M27.308,40.563l-.06,0a1,1,0,0,1-.895-.7l-1.74-5.55-5.2,2.344a1,1,0,0,1-1.316-1.335L26.4,17.576a1,1,0,1,1,1.812.848l-7.163,15.3,3.77-1.7a1,1,0,0,1,1.365.613l1.29,4.114L36.088,17.59a1,1,0,0,1,1.824.82L28.22,39.973A1,1,0,0,1,27.308,40.563Z"/>
|
||||
</svg>
|
||||
';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'eael_section_svg_content_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'essential-addons-for-elementor-lite' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_src',
|
||||
[
|
||||
'label' => esc_html__( 'Source', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'icon',
|
||||
'options' => [
|
||||
'icon' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite' ),
|
||||
'custom' => esc_html__( 'Custom SVG', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => \Elementor\Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => [
|
||||
'url' => EAEL_PLUGIN_URL . 'assets/admin/images/svg-draw.svg',
|
||||
],
|
||||
'library' => 'svg',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_svg_src' => 'icon'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'svg_html',
|
||||
[
|
||||
'label' => esc_html__( 'SVG Code', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'condition' => [
|
||||
'eael_svg_src' => 'custom'
|
||||
],
|
||||
'default' => $this->default_custom_svg(),
|
||||
'description' => esc_html__( 'SVG draw works best on path elements.', 'essential-addons-for-elementor-lite' ),
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_exclude_style',
|
||||
[
|
||||
'label' => esc_html__( 'Exclude Style', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-for-elementor-lite' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-for-elementor-lite' ),
|
||||
'default' => 'no',
|
||||
'description' => esc_html__( 'Exclude style from SVG Source (If any).', 'essential-addons-for-elementor-lite' )
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_svg_width',
|
||||
[
|
||||
'label' => esc_html__( 'Width', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 500,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 200,
|
||||
],
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} svg' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_svg_height',
|
||||
[
|
||||
'label' => esc_html__( 'Height', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 200,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} svg' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'center',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-svg-draw-container' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'placeholder' => esc_html__( 'https://your-link.com', 'essential-addons-for-elementor-lite' ),
|
||||
'options' => [ 'url' ],
|
||||
'label_block' => true,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_svg_appearance',
|
||||
[
|
||||
'label' => esc_html__( 'Appearance', 'essential-addons-for-elementor-lite' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_fill',
|
||||
[
|
||||
'label' => esc_html__( 'SVG Fill Type', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None', 'essential-addons-for-elementor-lite' ),
|
||||
'after' => esc_html__( 'Fill After Draw', 'essential-addons-for-elementor-lite' ),
|
||||
'before' => esc_html__( 'Fill Before Draw', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_fill_transition',
|
||||
[
|
||||
'label' => esc_html__( 'Fill Transition', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => 1,
|
||||
'min' => 0,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .fill-svg svg path' => 'animation-duration: {{SIZE}}s;',
|
||||
],
|
||||
'description' => esc_html__( 'Duration on SVG fills (in seconds)', 'essential-addons-for-elementor-lite' )
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_animation_on',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'page-load',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None', 'essential-addons-for-elementor-lite' ),
|
||||
'page-load' => esc_html__( 'On Page Load', 'essential-addons-for-elementor-lite' ),
|
||||
'page-scroll' => esc_html__( 'On Page Scroll', 'essential-addons-for-elementor-lite' ),
|
||||
'hover' => esc_html__( 'Mouse Hover', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_draw_offset',
|
||||
[
|
||||
'label' => esc_html__( 'Drawing Start Point', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 1000,
|
||||
'step' => 1,
|
||||
'default' => 50,
|
||||
'condition' => [
|
||||
'eael_svg_animation_on' => [ 'page-scroll' ],
|
||||
],
|
||||
'description' => esc_html__( 'The point at which the drawing begins to animate as scrolls down (in pixels).', 'essential-addons-for-elementor-lite' )
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_pause_on_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Pause on Hover Off', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-for-elementor-lite' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-for-elementor-lite' ),
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eael_svg_animation_on' => 'hover',
|
||||
],
|
||||
'description' => esc_html__( 'Pause SVG drawing on mouse leave', 'essential-addons-for-elementor-lite' )
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_loop',
|
||||
[
|
||||
'label' => esc_html__( 'Repeat Drawing', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Yes', 'essential-addons-for-elementor-lite' ),
|
||||
'label_off' => esc_html__( 'No', 'essential-addons-for-elementor-lite' ),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eael_svg_animation_on!' => [ 'page-scroll', 'none' ],
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_animation_direction',
|
||||
[
|
||||
'label' => esc_html__( 'Direction', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'reverse',
|
||||
'options' => [
|
||||
'reverse' => esc_html__( 'Reverse', 'essential-addons-for-elementor-lite' ),
|
||||
'restart' => esc_html__( 'Restart', 'essential-addons-for-elementor-lite' ),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_svg_animation_on!' => [ 'page-scroll', 'none' ],
|
||||
'eael_svg_loop' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_draw_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Speed', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 300,
|
||||
'step' => 1,
|
||||
'default' => 20,
|
||||
'condition' => [
|
||||
'eael_svg_animation_on!' => [ 'page-scroll' ],
|
||||
],
|
||||
'description' => esc_html__( 'Duration on SVG draws (in ms)', 'essential-addons-for-elementor-lite' )
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_svg_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'essential-addons-for-elementor-lite' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_path_thickness',
|
||||
[
|
||||
'label' => esc_html__( 'Path Thickness', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'step' => .1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 1.2,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} svg path' => 'stroke-width: {{SIZE}};',
|
||||
'{{WRAPPER}} svg circle' => 'stroke-width: {{SIZE}};',
|
||||
'{{WRAPPER}} svg rect' => 'stroke-width: {{SIZE}};',
|
||||
'{{WRAPPER}} svg polygon' => 'stroke-width: {{SIZE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_color',
|
||||
[
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ),
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} svg path' => 'stroke:{{VALUE}};',
|
||||
'{{WRAPPER}} svg circle' => 'stroke:{{VALUE}};',
|
||||
'{{WRAPPER}} svg rect' => 'stroke:{{VALUE}};',
|
||||
'{{WRAPPER}} svg polygon' => 'stroke:{{VALUE}};',
|
||||
],
|
||||
'default' => '#974CF3'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_fill_color',
|
||||
[
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'label' => esc_html__( 'Fill Color', 'essential-addons-for-elementor-lite' ),
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .elementor-widget-container .fill-svg svg path' => 'fill:{{VALUE}};',
|
||||
'{{WRAPPER}} .elementor-widget-container .eael-svg-draw-container.fill-svg svg path' => 'fill:{{VALUE}};',
|
||||
'{{WRAPPER}} .elementor-widget-container .eael-svg-draw-container.fill-svg svg circle' => 'fill:{{VALUE}};',
|
||||
'{{WRAPPER}} .elementor-widget-container .eael-svg-draw-container.fill-svg svg rect' => 'fill:{{VALUE}};',
|
||||
'{{WRAPPER}} .elementor-widget-container .eael-svg-draw-container.fill-svg svg polygon' => 'fill:{{VALUE}};'
|
||||
],
|
||||
'default' => '#D8C2F3',
|
||||
'condition' => [
|
||||
'eael_svg_fill!' => 'none'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_svg_background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .eael-svg-draw-container svg',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_svg_border',
|
||||
'selector' => '{{WRAPPER}} .eael-svg-draw-container svg',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-svg-draw-container svg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-svg-draw-container svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_svg_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-svg-draw-container svg' => 'Margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-svg-draw-container svg',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
$svg_html = isset( $settings['svg_html'] ) ? preg_replace( '#<script(.*?)>(.*?)</script>#is', '', $settings['svg_html'] ) : '';
|
||||
$this->add_render_attribute( 'eael-svg-drow-wrapper', [
|
||||
'class' => [
|
||||
'eael-svg-draw-container',
|
||||
esc_attr( $settings['eael_svg_animation_on'] ),
|
||||
$settings['eael_svg_fill'] === 'before' ? 'fill-svg' : ''
|
||||
],
|
||||
] );
|
||||
|
||||
$svg_options = [
|
||||
'fill' => $settings['eael_svg_fill'] === 'after' ? 'fill-svg' : '',
|
||||
'speed' => esc_attr( $settings['eael_svg_draw_speed'] ),
|
||||
'offset' => esc_attr( $settings['eael_svg_draw_offset'] ),
|
||||
'loop' => $settings['eael_svg_loop'] ? esc_attr( $settings['eael_svg_loop'] ) : 'no',
|
||||
'pause' => $settings['eael_svg_pause_on_hover'] ? esc_attr( $settings['eael_svg_pause_on_hover'] ) : 'no',
|
||||
'direction' => esc_attr( $settings['eael_svg_animation_direction'] ),
|
||||
'excludeStyle' => esc_attr( $settings['eael_svg_exclude_style'] )
|
||||
];
|
||||
|
||||
$this->add_render_attribute( 'eael-svg-drow-wrapper', [
|
||||
'data-settings' => wp_json_encode( $svg_options )
|
||||
] );
|
||||
|
||||
if ( ! empty( $settings['eael_svg_link']['url'] ) ) {
|
||||
$this->add_link_attributes( 'eael_svg_link', $settings['eael_svg_link'] );
|
||||
echo '<a ' . $this->get_render_attribute_string( 'eael_svg_link' ) . '>';
|
||||
}
|
||||
|
||||
echo '<div ' . $this->get_render_attribute_string( 'eael-svg-drow-wrapper' ) . '>';
|
||||
|
||||
if ( $settings['eael_svg_src'] === 'icon' ):
|
||||
|
||||
if ( $settings['eael_svg_icon']['library'] === 'svg' ) {
|
||||
if ( empty( $settings['eael_svg_icon']['value']['id'] ) ) {
|
||||
echo $this->default_custom_svg();
|
||||
}
|
||||
|
||||
Icons_Manager::render_icon( $settings['eael_svg_icon'], [ 'aria-hidden' => 'true', 'class' => [ 'eael-svg-drow-wrapper' ] ] );
|
||||
} else {
|
||||
echo Helper::get_svg_by_icon( $settings['eael_svg_icon'] );
|
||||
}
|
||||
|
||||
else:
|
||||
printf( '%s', $svg_html );
|
||||
endif;
|
||||
|
||||
echo ' </div>';
|
||||
|
||||
if ( ! empty( $settings['eael_svg_link']['url'] ) ) {
|
||||
echo "</a>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,925 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Modules\DynamicTags\Module as TagsModule;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Image_Size;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
class Sticky_Video extends Widget_Base
|
||||
{
|
||||
|
||||
|
||||
protected $eaelRElem = 1;
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-sticky-video';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('Sticky Video', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-sticky-video';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'video',
|
||||
'sticky',
|
||||
'ea sticky video',
|
||||
'ea video player',
|
||||
'youtube',
|
||||
'vimeo',
|
||||
'mp4',
|
||||
'mpg',
|
||||
'ogg',
|
||||
'webm',
|
||||
'mov',
|
||||
'avi',
|
||||
'scrollable video',
|
||||
'sticky control',
|
||||
'video player',
|
||||
'youtube content',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/sticky-video/';
|
||||
}
|
||||
|
||||
public function get_style_depends()
|
||||
{
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_script_depends()
|
||||
{
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
/**
|
||||
* General
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eaelsv_sticky_option_section',
|
||||
[
|
||||
'label' => __('Sticky Options', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_is_sticky',
|
||||
[
|
||||
'label' => __('Sticky', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'label_on' => __('On', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('Off', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} div.eaelsv-sticky-player' => 'display: block',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sticky_position',
|
||||
[
|
||||
'label' => __('Position', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'top-left' => __('Top Left', 'essential-addons-for-elementor-lite'),
|
||||
'top-right' => __('Top Right', 'essential-addons-for-elementor-lite'),
|
||||
'bottom-left' => __('Bottom Left', 'essential-addons-for-elementor-lite'),
|
||||
'bottom-right' => __('Bottom Right', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'default' => 'bottom-right',
|
||||
'condition' => [
|
||||
'eaelsv_is_sticky' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_video_settings',
|
||||
[
|
||||
'label' => esc_html__('Video', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_video_source',
|
||||
[
|
||||
'label' => __('Source', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'youtube',
|
||||
'options' => [
|
||||
'youtube' => __('YouTube', 'essential-addons-for-elementor-lite'),
|
||||
'vimeo' => __('Vimeo', 'essential-addons-for-elementor-lite'),
|
||||
'self_hosted' => __('Self Hosted', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_link_youtube',
|
||||
[
|
||||
'label' => __('Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => ['active' => true],
|
||||
'placeholder' => __('Enter your URL (YouTube)', 'essential-addons-for-elementor-lite'),
|
||||
'label_block' => true,
|
||||
'default' => 'https://www.youtube.com/watch?v=uuyXfUDqRZM',
|
||||
'condition' => [
|
||||
'eael_video_source' => 'youtube',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_link_vimeo',
|
||||
[
|
||||
'label' => __('Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'placeholder' => __('Enter your URL (Vimeo)', 'essential-addons-for-elementor-lite'),
|
||||
'label_block' => true,
|
||||
'default' => 'https://vimeo.com/235215203',
|
||||
'condition' => [
|
||||
'eael_video_source' => 'vimeo',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_link_dailymotion',
|
||||
[
|
||||
'label' => __('Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'placeholder' => __('Enter your URL (Dailymotion)', 'essential-addons-for-elementor-lite'),
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'eael_video_source' => 'dailymotion',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_link_external',
|
||||
[
|
||||
'label' => __('External URL', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'condition' => [
|
||||
'eael_video_source' => 'self_hosted',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_hosted_url',
|
||||
[
|
||||
'label' => __('Choose File', 'elementor'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
'categories' => [
|
||||
TagsModule::MEDIA_CATEGORY,
|
||||
],
|
||||
],
|
||||
'media_type' => 'video',
|
||||
'condition' => [
|
||||
'eael_video_source' => 'self_hosted',
|
||||
'eaelsv_link_external' => '',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_external_url',
|
||||
[
|
||||
'label' => __('Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'placeholder' => __('Enter your URL', 'essential-addons-for-elementor-lite'),
|
||||
'label_block' => true,
|
||||
'show_label' => false,
|
||||
'condition' => [
|
||||
'eael_video_source' => 'self_hosted',
|
||||
'eaelsv_link_external' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_video_self_hosted_link',
|
||||
[
|
||||
'label' => __('Choose File', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'eael_video_source' => 'self_hosted',
|
||||
'eael_video_source_external' => '',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_start_time',
|
||||
[
|
||||
'label' => __('Start Time', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 0,
|
||||
'max' => 10000,
|
||||
'step' => 1,
|
||||
'default' => '',
|
||||
'description' => 'Specify a start time (in seconds)',
|
||||
'condition' => [
|
||||
'eael_video_source' => 'self_hosted',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_end_time',
|
||||
[
|
||||
'label' => __('End Time', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 0,
|
||||
'max' => 10000,
|
||||
'step' => 1,
|
||||
'default' => '',
|
||||
'description' => 'Specify an end time (in seconds)',
|
||||
'condition' => [
|
||||
'eael_video_source' => 'self_hosted',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_video_video_options',
|
||||
[
|
||||
'label' => __('Video Options', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_autopaly',
|
||||
[
|
||||
'label' => __('Autoplay', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_autopaly_description',
|
||||
[
|
||||
'raw' => __('Autoplay requires mute volume.', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
|
||||
'condition' => [
|
||||
'eaelsv_autopaly' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_mute',
|
||||
[
|
||||
'label' => __('Mute', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'eaelsv_autopaly!' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_loop',
|
||||
[
|
||||
'label' => __('Loop', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sh_show_bar',
|
||||
[
|
||||
'label' => __('Show Bar', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'default' => 'yes',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .plyr__controls' => 'display: flex!important;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_video_image_overlay_section',
|
||||
[
|
||||
'label' => __('Image Overlay', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_overlay_options',
|
||||
[
|
||||
'label' => __('Image Overlay', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'' => __('Default', 'essential-addons-for-elementor-lite'),
|
||||
'yes' => __('Custom', 'essential-addons-for-elementor-lite'),
|
||||
'transparent' => __('Transparent', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_overlay_image',
|
||||
[
|
||||
'label' => __('Choose Image', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'eaelsv_overlay_options' => 'yes',
|
||||
],
|
||||
'default' => [
|
||||
'url' => \Elementor\Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Image_Size::get_type(),
|
||||
[
|
||||
'default' => 'full',
|
||||
'name' => 'eaelsv_overlay_image_size',
|
||||
'condition' => [
|
||||
'eaelsv_overlay_options' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_overlay_play_icon',
|
||||
[
|
||||
'label' => __('Play Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_block' => false,
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'eaelsv_overlay_options' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_icon_new',
|
||||
[
|
||||
'label' => esc_html__('Choose Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'eaelsv_icon',
|
||||
'condition' => [
|
||||
'eaelsv_overlay_options' => 'yes',
|
||||
'eaelsv_overlay_play_icon' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control( 'eaelsv_icon_new_notice', [
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __( 'Play icon appears on top of overlay image.', 'essential-addons-for-elementor-lite' ),
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
|
||||
'condition' => [
|
||||
'eaelsv_overlay_options' => 'yes',
|
||||
],
|
||||
] );
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Style Tab Started
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eaelsv_sticky_video_interface',
|
||||
[
|
||||
'label' => __('Sticky Video Interface', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'eaelsv_is_sticky' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sticky_width',
|
||||
[
|
||||
'label' => __('Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 100,
|
||||
'max' => 500,
|
||||
'step' => 1,
|
||||
'default' => 300,
|
||||
'condition' => [
|
||||
'eaelsv_is_sticky' => 'yes',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-player2.out' => 'width: {{VALUE}}px!important;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sticky_height',
|
||||
[
|
||||
'label' => __('Height', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 55,
|
||||
'max' => 280,
|
||||
'step' => 1,
|
||||
'default' => 169,
|
||||
'condition' => [
|
||||
'eaelsv_is_sticky' => 'yes',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-player2.out' => 'height: {{VALUE}}px!important;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_scroll_height_display_sticky',
|
||||
[
|
||||
'label' => __('Scroll Height To Display Sticky (%)', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 50,
|
||||
'max' => 200,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 70,
|
||||
],
|
||||
'condition' => [
|
||||
'eaelsv_is_sticky' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sticky_close_button_color',
|
||||
[
|
||||
'label' => __('Close Button Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'condition' => [
|
||||
'eaelsv_is_sticky' => 'yes',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eaelsv-sticky-player-close' => 'color: {{VALUE}}!important',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eaelsv_sh_player_section',
|
||||
[
|
||||
'label' => __('Player', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eaelsv_sh_video_width',
|
||||
[
|
||||
'label' => esc_html__('Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1200,
|
||||
'step' => 1,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-wrapper' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sh_video_border_type',
|
||||
[
|
||||
'label' => __('Border Type', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => __('None', 'essential-addons-for-elementor-lite'),
|
||||
'solid' => __('Solid', 'essential-addons-for-elementor-lite'),
|
||||
'double' => __('Double', 'essential-addons-for-elementor-lite'),
|
||||
'dotted' => __('Dotted', 'essential-addons-for-elementor-lite'),
|
||||
'dashed' => __('Dashed', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-wrapper' => 'border-style: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eaelsv_sh_video_border_width',
|
||||
[
|
||||
'label' => esc_html__('Border Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-wrapper' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sh_video_border_color',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-wrapper' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eaelsv_sh_video_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-sticky-video-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eaelsv-overlay' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-sticky-video-player2' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eaelsv_sh_player_interface_section',
|
||||
[
|
||||
'label' => __('Interface', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eaelsv_sh_video_interface_color',
|
||||
[
|
||||
'label' => esc_html__('Interface Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ADD8E6',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .plyr__control.plyr__tab-focus' => 'box-shadow: 0 0 0 5px {{VALUE}}!important',
|
||||
'{{WRAPPER}} .plyr__control--overlaid' => 'background: {{VALUE}}!important',
|
||||
'{{WRAPPER}} .plyr--video .plyr__control.plyr__tab-focus' => 'background: {{VALUE}}!important',
|
||||
'{{WRAPPER}} .plyr__control--overlaid' => 'background: {{VALUE}}!important',
|
||||
'{{WRAPPER}} .plyr--video .plyr__control:hover' => 'background: {{VALUE}}!important',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eaelsv_sh_play_button_size',
|
||||
[
|
||||
'label' => __('Play Button Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 15,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 15,
|
||||
'max' => 55,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .plyr__control--overlaid' => 'padding: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eaelsv_sh_player_bar_section',
|
||||
[
|
||||
'label' => __('Bar', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eaelsv_sh_player_bar_padding',
|
||||
[
|
||||
'label' => __('Bar Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 50,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .plyr--video .plyr__controls' => 'padding: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eaelsv_sh_bar_margin',
|
||||
[
|
||||
'label' => esc_html__('Bar Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .plyr--video .plyr__controls' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$iconNew = $settings['eaelsv_icon_new'];
|
||||
$sticky = $settings['eaelsv_is_sticky'];
|
||||
$autoplay = ($settings['eaelsv_autopaly'] == 'yes') ? $settings['eaelsv_autopaly'] : 'no';
|
||||
$eaelsvPlayer = '';
|
||||
$eaelsv_overlay_visibility = $settings['eaelsv_overlay_options'];
|
||||
|
||||
if ('youtube' == $settings['eael_video_source']) {
|
||||
$eaelsvPlayer = $this->eaelsv_load_player_youtube();
|
||||
}
|
||||
if ('vimeo' == $settings['eael_video_source']) {
|
||||
$eaelsvPlayer = $this->eaelsv_load_player_vimeo();
|
||||
}
|
||||
if ('self_hosted' == $settings['eael_video_source']) {
|
||||
$eaelsvPlayer = $this->eaelsv_load_player_self_hosted();
|
||||
}
|
||||
|
||||
echo '<div class="eael-sticky-video-wrapper eaelsv-overlay-visibility-' . esc_attr( $eaelsv_overlay_visibility ) . '">';
|
||||
if ('yes' === $settings['eaelsv_overlay_options']) {
|
||||
// $autoplay = 'yes';
|
||||
$icon = '';
|
||||
if ('yes' === $settings['eaelsv_overlay_play_icon']) {
|
||||
if ($iconNew['value'] != '') {
|
||||
if (is_array($iconNew['value'])) {
|
||||
$icon = '<img src="' . esc_url( $iconNew['value']['url'] ) . '" width="100">';
|
||||
} else {
|
||||
$icon = '<i class="' . esc_attr( $iconNew['value'] ) . '"></i>';
|
||||
}
|
||||
} else {
|
||||
$icon = '<i class="eicon-play"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
$overlay_class = 'eaelsv-overlay';
|
||||
if( 'yes' === $settings['eaelsv_overlay_options'] && empty( $settings['eaelsv_overlay_image']['url'] ) ){
|
||||
$icon = '';
|
||||
$overlay_class = 'eaelsv-overlay-ignore';
|
||||
}
|
||||
|
||||
$this->add_render_attribute(
|
||||
'esvp_overlay_wrapper',
|
||||
[
|
||||
'class' => esc_attr( $overlay_class ),
|
||||
'style' => "background-image:url('" . $settings['eaelsv_overlay_image']['url'] . "');",
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div ' . $this->get_render_attribute_string('esvp_overlay_wrapper') . '>
|
||||
<div class="eaelsv-overlay-icon">' . $icon . '</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$this->add_render_attribute(
|
||||
'esvp_overlay_wrapper2',
|
||||
[
|
||||
'class' => 'eael-sticky-video-player2',
|
||||
'data-sticky' => $sticky,
|
||||
'data-position' => $settings['eaelsv_sticky_position'],
|
||||
'data-sheight' => $settings['eaelsv_sticky_height'],
|
||||
'data-swidth' => $settings['eaelsv_sticky_width'],
|
||||
'data-scroll_height' => !empty($settings['eaelsv_scroll_height_display_sticky']['size']) ? $settings['eaelsv_scroll_height_display_sticky']['size'] : '',
|
||||
'data-autoplay' => $autoplay,
|
||||
'data-overlay' => ($settings['eaelsv_overlay_options'] == 'yes') ? $settings['eaelsv_overlay_options'] : 'no',
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div ' . $this->get_render_attribute_string('esvp_overlay_wrapper2') . '>
|
||||
' . $eaelsvPlayer . '
|
||||
<span class="eaelsv-sticky-player-close"><i class="fas fa-times-circle"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
protected function eaelsv_load_player_youtube()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$id = $this->eaelsv_get_url_id();
|
||||
$autoplay = $settings['eaelsv_autopaly'];
|
||||
$mute = $autoplay == 'yes' ? 'yes' : $settings['eaelsv_mute'];
|
||||
$loop = $settings['eaelsv_loop'];
|
||||
|
||||
$am = '"storage": {"enabled": false, "key": "plyr"}';
|
||||
$am .= ( $autoplay == 'yes' ? ', "autoplay":1' : ', "autoplay":0' );
|
||||
$am .= ( $mute == 'yes' ? ', "muted":1, "volume":0' : ', "muted":0' );
|
||||
|
||||
if ('yes' == $loop) {
|
||||
$lp = '"loop": {"active": true}';
|
||||
} else {
|
||||
$lp = '"loop": {"active": false}';
|
||||
}
|
||||
|
||||
return '<div
|
||||
id="eaelsv-player-' . esc_attr( $this->get_id() ) . '"
|
||||
data-plyr-provider="youtube"
|
||||
data-plyr-embed-id="' . esc_attr($id) . '"
|
||||
data-plyr-config="{' . esc_attr($am) . ', ' . esc_attr($lp) . '}"
|
||||
></div>';
|
||||
}
|
||||
|
||||
protected function eaelsv_load_player_vimeo()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$id = $this->eaelsv_get_url_id();
|
||||
$autoplay = $settings['eaelsv_autopaly'];
|
||||
$mute = $autoplay == 'yes' ? 'yes' : $settings['eaelsv_mute'];
|
||||
$loop = $settings['eaelsv_loop'];
|
||||
|
||||
$am = '"storage": {"enabled": false, "key": "plyr"}';
|
||||
$am .= ( $autoplay == 'yes' ? ', "autoplay":1' : ', "autoplay":0' );
|
||||
$am .= ( $mute == 'yes' ? ', "muted":1, "volume":0' : ', "muted":0' );
|
||||
|
||||
if ('yes' == $loop) {
|
||||
$lp = '"loop": {"active": true}';
|
||||
} else {
|
||||
$lp = '"loop": {"active": false}';
|
||||
}
|
||||
|
||||
return '<div
|
||||
id="eaelsv-player-' . esc_attr( $this->get_id() ) . '"
|
||||
data-plyr-provider="vimeo"
|
||||
data-plyr-embed-id="' . esc_attr($id) . '"
|
||||
data-plyr-config="{' . esc_attr($am) . ', ' . esc_attr($lp) . '}"
|
||||
></div>';
|
||||
}
|
||||
|
||||
protected function eaelsv_load_player_self_hosted()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
$video = ($settings['eaelsv_external_url'] != '') ? $settings['eaelsv_external_url'] : $settings['eaelsv_hosted_url']['url'];
|
||||
$controlBars = $settings['eaelsv_sh_show_bar'];
|
||||
$autoplay = $settings['eaelsv_autopaly'];
|
||||
$mute = $settings['eaelsv_mute'];
|
||||
$loop = $settings['eaelsv_loop'];
|
||||
$interfaceColor = $settings['eaelsv_sh_video_interface_color'];
|
||||
$startTime = $settings['eaelsv_start_time'];
|
||||
$endTime = $settings['eaelsv_end_time'];
|
||||
|
||||
$am = '';
|
||||
$am .= ($autoplay == 'yes' ? '"autoplay":1' : '"autoplay":0');
|
||||
$am .= ($mute == 'yes' ? ', "muted":1' : ', "muted":0');
|
||||
|
||||
if ('yes' == $loop) {
|
||||
$lp = '"loop": {"active": true}';
|
||||
} else {
|
||||
$lp = '"loop": {"active": false}';
|
||||
}
|
||||
|
||||
return '<video class="eaelsv-player" id="eaelsv-player-' . esc_attr( $this->get_id() ) . '" playsinline controls data-plyr-config="{' . esc_attr($am) . ', ' . esc_attr($lp) . '}">
|
||||
<source src="' . esc_attr($video) . '#t=' . esc_attr($startTime) . ',' . esc_attr($endTime) . '" type="video/mp4" />
|
||||
</video>';
|
||||
}
|
||||
|
||||
protected function eaelsv_get_url_id()
|
||||
{
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
if ( 'youtube' === $settings['eael_video_source'] ) {
|
||||
$url = $settings['eaelsv_link_youtube'];
|
||||
$link = explode( '=', parse_url( $url, PHP_URL_QUERY ) );
|
||||
$short_link = explode( '/', $url );
|
||||
$id = isset( $link[1] ) ? $link[1] : ( isset( $short_link[3] ) ? $short_link[3] : '' );
|
||||
}
|
||||
if ('vimeo' === $settings['eael_video_source']) {
|
||||
$url = $settings['eaelsv_link_vimeo'];
|
||||
$link = explode('/', $url);
|
||||
$id = isset( $link[3] ) ? $link[3] : '';
|
||||
}
|
||||
if ('self_hosted' === $settings['eael_video_source']) {
|
||||
$externalUrl = $settings['eaelsv_link_external'];
|
||||
if ('yes' == $externalUrl) {
|
||||
$id = $settings['eaelsv_external_url'];
|
||||
} else {
|
||||
$id = $settings['eaelsv_hosted_url']['url'];
|
||||
}
|
||||
}
|
||||
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,981 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Image_Size;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper as HelperClass;
|
||||
class Team_Member extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-team-member';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Team Member', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-team-mamber';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'team',
|
||||
'member',
|
||||
'team member',
|
||||
'ea team member',
|
||||
'ea team members',
|
||||
'person',
|
||||
'card',
|
||||
'meet the team',
|
||||
'team builder',
|
||||
'our team',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/team-members/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_member_image',
|
||||
[
|
||||
'label' => esc_html__( 'Team Member Image', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_member_image',
|
||||
[
|
||||
'label' => __( 'Team Member Avatar', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Image_Size::get_type(),
|
||||
[
|
||||
'name' => 'thumbnail',
|
||||
'default' => 'full',
|
||||
'condition' => [
|
||||
'eael_team_member_image[url]!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_member_content',
|
||||
[
|
||||
'label' => esc_html__( 'Team Member Content', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_member_name',
|
||||
[
|
||||
'label' => esc_html__( 'Name', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => esc_html__( 'John Doe', 'essential-addons-for-elementor-lite'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_member_job_title',
|
||||
[
|
||||
'label' => esc_html__( 'Job Position', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => esc_html__( 'Software Engineer', 'essential-addons-for-elementor-lite'),
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_member_description',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => esc_html__( 'Add team member description here. Remove the text if not necessary.', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_member_social_profiles',
|
||||
[
|
||||
'label' => esc_html__( 'Social Profiles', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_member_enable_social_profiles',
|
||||
[
|
||||
'label' => esc_html__( 'Display Social Profiles?', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'social_new',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'social',
|
||||
'default' => [
|
||||
'value' => 'fab fa-wordpress',
|
||||
'library' => 'fa-brands',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'name' => 'link',
|
||||
'label' => esc_html__( 'Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => ['active' => true],
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => 'true',
|
||||
],
|
||||
'placeholder' => esc_html__( 'Place URL here', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_member_social_profile_links',
|
||||
[
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'condition' => [
|
||||
'eael_team_member_enable_social_profiles!' => '',
|
||||
],
|
||||
'default' => [
|
||||
[
|
||||
'social_new' => [
|
||||
'value' => 'fab fa-facebook',
|
||||
'library' => 'fa-brands'
|
||||
]
|
||||
],
|
||||
[
|
||||
'social_new' => [
|
||||
'value' => 'fab fa-twitter',
|
||||
'library' => 'fa-brands'
|
||||
]
|
||||
],
|
||||
[
|
||||
'social_new' => [
|
||||
'value' => 'fab fa-google-plus',
|
||||
'library' => 'fa-brands'
|
||||
]
|
||||
],
|
||||
[
|
||||
'social_new' => [
|
||||
'value' => 'fab fa-linkedin',
|
||||
'library' => 'fa-brands'
|
||||
]
|
||||
],
|
||||
],
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '<i class="{{ social_new.value }}"></i>',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
if(!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>'
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_members_styles_general',
|
||||
[
|
||||
'label' => esc_html__( 'Team Member Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$template_list = apply_filters('eael_team_member_style_presets_options', [
|
||||
'eael-team-members-simple' => esc_html__( 'Simple Style', 'essential-addons-for-elementor-lite' ),
|
||||
'eael-team-members-overlay' => esc_html__( 'Overlay Style', 'essential-addons-for-elementor-lite' ),
|
||||
'eael-team-members-centered' => esc_html__( 'Centered Style', 'essential-addons-for-elementor-lite' ),
|
||||
'eael-team-members-circle' => esc_html__( 'Circle Style', 'essential-addons-for-elementor-lite' ),
|
||||
'eael-team-members-social-bottom' => esc_html__( 'Social on Bottom', 'essential-addons-for-elementor-lite' ),
|
||||
'eael-team-members-social-right' => esc_html__( 'Social on Right', 'essential-addons-for-elementor-lite' ),
|
||||
]);
|
||||
|
||||
$layout_options = [];
|
||||
|
||||
if( ! empty( $template_list ) ){
|
||||
$image_path = EAEL_PLUGIN_URL . 'assets/admin/images/layout-previews/team-preset-';
|
||||
foreach( $template_list as $key => $label ){
|
||||
$layout_options[ $key ] = [
|
||||
'title' => $label,
|
||||
'image' => $image_path . str_replace( 'eael-team-members-', '', $key ) . '.png'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_preset',
|
||||
[
|
||||
'label' => esc_html__( 'Layout', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => $layout_options,
|
||||
'default' => 'eael-team-members-simple',
|
||||
'label_block' => true,
|
||||
'toggle' => false,
|
||||
'image_choose'=> true,
|
||||
]
|
||||
);
|
||||
|
||||
$team_member_style_presets_condition = apply_filters('eael_team_member_style_presets_condition', [
|
||||
'eael-team-members-centered',
|
||||
'eael-team-members-circle',
|
||||
'eael-team-members-social-bottom',
|
||||
'eael-team-members-social-right'
|
||||
]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_preset_pro_alert',
|
||||
[
|
||||
'label' => esc_html__( 'Only available in pro version!', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition' => [
|
||||
'eael_team_members_preset' => $team_member_style_presets_condition
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'content_card_style',
|
||||
[
|
||||
'label' => __( 'Content Card', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'content_card_height',
|
||||
[
|
||||
'label' => esc_html__( 'Height', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 0,
|
||||
'max' => 200
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-content' => 'min-height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_enable_text_overlay',
|
||||
[
|
||||
'label' => esc_html__( 'Enable Description Overlay', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'eael_team_members_preset' => 'eael-team-members-simple'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_overlay_background',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(255,255,255,0.8)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-members-overlay .eael-team-content' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-team-image .eael-team-text-overlay' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'eael_team_members_preset',
|
||||
'operator' => '=',
|
||||
'value' => 'eael-team-members-overlay'
|
||||
],
|
||||
[
|
||||
'name' => 'eael_team_members_enable_text_overlay',
|
||||
'operator' => '=',
|
||||
'value' => 'yes'
|
||||
]
|
||||
]
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_background',
|
||||
[
|
||||
'label' => esc_html__( 'Content Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-content' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-image .eael-team-text-overlay' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Set Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'default' => [
|
||||
'title' => __( 'Default', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-ban',
|
||||
],
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'centered' => [
|
||||
'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'eael-team-align-default',
|
||||
'prefix_class' => 'eael-team-align-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Content Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .eael-team-item',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_members_image_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Team Member Image Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_image_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 100,
|
||||
'unit' => '%',
|
||||
],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item figure img' => 'width:{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_team_members_preset!' => 'eael-team-members-circle'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
do_action('eael/team_member_circle_controls', $this);
|
||||
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_image_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item figure img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_image_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item figure img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_image_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .eael-team-item figure img',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_image_rounded',
|
||||
[
|
||||
'label' => esc_html__( 'Rounded Avatar?', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'team-avatar-rounded',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_image_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item figure img' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_team_members_image_rounded!' => 'team-avatar-rounded',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_members_typography',
|
||||
[
|
||||
'label' => esc_html__( 'Color & Typography', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_name_heading',
|
||||
[
|
||||
'label' => __( 'Member Name', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_name_color',
|
||||
[
|
||||
'label' => esc_html__( 'Member Name Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#272727',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-member-name' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_name_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-team-item .eael-team-member-name',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_position_heading',
|
||||
[
|
||||
'label' => __( 'Member Job Position', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_position_color',
|
||||
[
|
||||
'label' => esc_html__( 'Job Position Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#272727',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-member-position' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_position_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-team-item .eael-team-member-position',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_description_heading',
|
||||
[
|
||||
'label' => __( 'Member Description', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#272727',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-content .eael-team-text' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-team-item .eael-team-image .eael-team-text.eael-team-text-overlay' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_description_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-team-item .eael-team-content .eael-team-text,
|
||||
{{WRAPPER}} .eael-team-item .eael-team-image .eael-team-text.eael-team-text-overlay',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_team_members_social_profiles_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Social Profiles Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 200,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 35,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
// '{{WRAPPER}} .eael-team-member-social-link > a' => 'width: {{SIZE}}px; height: {{SIZE}}px; line-height: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a img' => 'width: {{SIZE}}px; height: {{SIZE}}px; line-height: {{SIZE}}px;',
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a svg' => 'width: {{SIZE}}px; height: {{SIZE}}px; line-height: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_social_profiles_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Social Profiles Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-content > .eael-team-member-social-profiles' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-team-image > .eael-team-member-social-profiles' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_social_icons_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Social Icon Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-content > .eael-team-member-social-profiles li.eael-team-member-social-link > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-team-image > .eael-team-member-social-profiles li.eael-team-member-social-link > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_team_members_social_icons_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Social Icon Distance', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-content > .eael-team-member-social-profiles li.eael-team-member-social-link' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-team-image > .eael-team-member-social-profiles li.eael-team-member-social-link' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icons_used_gradient_bg',
|
||||
[
|
||||
'label' => __( 'Use Gradient Background', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ),
|
||||
'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->start_controls_tabs( 'eael_team_members_social_icons_style_tabs' );
|
||||
|
||||
$this->start_controls_tab( 'normal', [ 'label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite') ] );
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#f1ba63',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_background',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_team_members_social_icons_used_gradient_bg' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_social_icon_gradient_background',
|
||||
'label' => __( 'Background', 'essential-addons-for-elementor-lite' ),
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .eael-team-member-social-link > a',
|
||||
'condition' => [
|
||||
'eael_team_members_social_icons_used_gradient_bg' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_social_icon_border',
|
||||
'selector' => '{{WRAPPER}} .eael-team-member-social-link > a',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_social_icon_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-team-member-social-link > a',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab( 'eael_team_members_social_icon_hover', [ 'label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite') ] );
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Hover Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#ad8647',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a:hover' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a:hover svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_hover_background',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Background', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_team_members_social_icons_used_gradient_bg' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_team_members_social_icon_hover_gradient_background',
|
||||
'label' => __( 'Background', 'essential-addons-for-elementor-lite' ),
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .eael-team-member-social-link > a:hover',
|
||||
'condition' => [
|
||||
'eael_team_members_social_icons_used_gradient_bg' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_team_members_social_icon_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-team-member-social-link > a:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function render( ) {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$team_member_image = $this->get_settings( 'eael_team_member_image' );
|
||||
$team_member_image_url = Group_Control_Image_Size::get_attachment_image_src( $team_member_image['id'], 'thumbnail', $settings );
|
||||
if( empty( $team_member_image_url ) ) : $team_member_image_url = $team_member_image['url']; else: $team_member_image_url = $team_member_image_url; endif;
|
||||
$team_member_classes = $this->get_settings('eael_team_members_preset') . " " . $this->get_settings('eael_team_members_image_rounded');
|
||||
|
||||
$this->add_render_attribute( 'eael_team_text', 'class', 'eael-team-text' );
|
||||
|
||||
if ( isset( $settings['eael_team_members_enable_text_overlay'] ) && $settings['eael_team_members_enable_text_overlay'] == 'yes' ) {
|
||||
$this->add_render_attribute( 'eael_team_text', 'class', 'eael-team-text-overlay' );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div id="eael-team-member-<?php echo esc_attr($this->get_id()); ?>" class="eael-team-item <?php echo esc_attr( $team_member_classes ); ?>">
|
||||
<div class="eael-team-item-inner">
|
||||
<div class="eael-team-image">
|
||||
<figure>
|
||||
<img src="<?php echo esc_url($team_member_image_url);?>" alt="<?php echo esc_attr( get_post_meta($team_member_image['id'], '_wp_attachment_image_alt', true) ); ?>">
|
||||
</figure>
|
||||
<?php if( 'eael-team-members-social-right' === $settings['eael_team_members_preset'] ) : ?>
|
||||
<?php do_action( 'eael/team_member_social_right_markup', $settings, $this ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ( isset( $settings['eael_team_members_enable_text_overlay'] ) && $settings['eael_team_members_enable_text_overlay'] == 'yes' ) {
|
||||
?>
|
||||
<p <?php echo $this->get_render_attribute_string('eael_team_text'); ?>><?php echo HelperClass::eael_wp_kses($settings['eael_team_member_description']); ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="eael-team-content">
|
||||
<h2 class="eael-team-member-name"><?php echo HelperClass::eael_wp_kses($settings['eael_team_member_name']); ?></h2>
|
||||
<h3 class="eael-team-member-position"><?php echo HelperClass::eael_wp_kses($settings['eael_team_member_job_title']); ?></h3>
|
||||
|
||||
<?php if( 'eael-team-members-social-bottom' === $settings['eael_team_members_preset'] ) : ?>
|
||||
<?php do_action( 'eael/team_member_social_botton_markup', $settings, $this ); ?>
|
||||
<?php else: ?>
|
||||
<?php if ( ! empty( $settings['eael_team_member_enable_social_profiles'] ) && 'eael-team-members-social-right' !== $settings['eael_team_members_preset'] ): ?>
|
||||
<ul class="eael-team-member-social-profiles">
|
||||
<?php foreach ( $settings['eael_team_member_social_profile_links'] as $index => $item ) : ?>
|
||||
<?php $icon_migrated = isset($item['__fa4_migrated']['social_new']);
|
||||
$icon_is_new = empty($item['social']); ?>
|
||||
<?php if ( ! empty( $item['social'] ) || !empty($item['social_new'])) : ?>
|
||||
<?php $this->add_link_attributes( 'social_link_' . $index, $item['link'] ); ?>
|
||||
<li class="eael-team-member-social-link">
|
||||
<a <?php $this->print_render_attribute_string( 'social_link_' . $index ); ?>>
|
||||
<?php if ($icon_is_new || $icon_migrated) { ?>
|
||||
<?php if( isset( $item['social_new']['value']['url'] ) ) : ?>
|
||||
<img src="<?php echo esc_url( $item['social_new']['value']['url'] ); ?>" alt="<?php echo esc_attr(get_post_meta($item['social_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" />
|
||||
<?php else :
|
||||
\Elementor\Icons_Manager::render_icon( $item['social_new'], [ 'aria-hidden' => 'true' ] );
|
||||
endif; ?>
|
||||
<?php } else { ?>
|
||||
<i class="<?php echo esc_attr($item['social'] ); ?>"></i>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<p <?php echo $this->get_render_attribute_string('eael_team_text'); ?>><?php echo HelperClass::eael_wp_kses($settings['eael_team_member_description']); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,950 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Image_Size;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
use Essential_Addons_Elementor\Classes\Helper as HelperClass;
|
||||
|
||||
class Testimonial extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-testimonial';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Testimonial', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-testimonial';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'testimonial',
|
||||
'ea testimonial',
|
||||
'ea testimonials',
|
||||
'testimony',
|
||||
'review',
|
||||
'endorsement',
|
||||
'recommendation',
|
||||
'reference',
|
||||
'appreciation',
|
||||
'feedback',
|
||||
'star rating',
|
||||
'social proof',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/testimonials/';
|
||||
}
|
||||
|
||||
public function get_style_depends()
|
||||
{
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_script_depends()
|
||||
{
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_testimonial_image',
|
||||
[
|
||||
'label' => esc_html__( 'Testimonial Image', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_enable_avatar',
|
||||
[
|
||||
'label' => esc_html__( 'Display Avatar?', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => __( 'Testimonial Avatar', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_testimonial_enable_avatar' => 'yes',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Image_Size::get_type(),
|
||||
[
|
||||
'name' => 'image',
|
||||
'default' => 'thumbnail',
|
||||
'condition' => [
|
||||
'image[url]!' => '',
|
||||
'eael_testimonial_enable_avatar' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_testimonial_content',
|
||||
[
|
||||
'label' => esc_html__( 'Testimonial Content', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_name',
|
||||
[
|
||||
'label' => esc_html__( 'User Name', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'John Doe', 'essential-addons-for-elementor-lite'),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_company_title',
|
||||
[
|
||||
'label' => esc_html__( 'Company Name', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Codetic', 'essential-addons-for-elementor-lite'),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_description',
|
||||
[
|
||||
'label' => esc_html__( 'Testimonial Description', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'default' => esc_html__( 'Add testimonial description here. Edit and place your own text.', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'content_height',
|
||||
[
|
||||
'label' => esc_html__( 'Description Height', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'range' => [
|
||||
'px' => [ 'max' => 300 ],
|
||||
'%' => [ 'max' => 100 ]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_enable_rating',
|
||||
[
|
||||
'label' => esc_html__( 'Display Rating?', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_rating_number',
|
||||
[
|
||||
'label' => __( 'Rating Number', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'rating-five',
|
||||
'options' => [
|
||||
'rating-one' => __( '1', 'essential-addons-for-elementor-lite'),
|
||||
'rating-two' => __( '2', 'essential-addons-for-elementor-lite'),
|
||||
'rating-three' => __( '3', 'essential-addons-for-elementor-lite'),
|
||||
'rating-four' => __( '4', 'essential-addons-for-elementor-lite'),
|
||||
'rating-five' => __( '5', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_testimonial_enable_rating' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
if(!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>'
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_testimonial_styles_general',
|
||||
[
|
||||
'label' => esc_html__( 'Testimonial Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$image_path = EAEL_PLUGIN_URL . 'assets/admin/images/layout-previews/testimonial-';
|
||||
$this->add_control(
|
||||
'eael_testimonial_style',
|
||||
[
|
||||
'label' => esc_html__( 'Select Style', 'essential-addons-for-elementor-lite' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'default-style' => [
|
||||
'title' => esc_html__('Default', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'default-style.png'
|
||||
],
|
||||
'classic-style' => [
|
||||
'title' => esc_html__('Classic', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'classic-style.png'
|
||||
],
|
||||
'middle-style' => [
|
||||
'title' => esc_html__('Content | Icon/Image | Bio', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'middle-style.png'
|
||||
],
|
||||
'icon-img-left-content' => [
|
||||
'title' => esc_html__('Icon/Image | Content', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'icon-img-left-content.png'
|
||||
],
|
||||
'icon-img-right-content' => [
|
||||
'title' => esc_html__('Content | Icon/Image', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'icon-img-right-content.png'
|
||||
],
|
||||
'content-top-icon-title-inline' => [
|
||||
'title' => esc_html__('Content Top | Icon Title Inline', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'content-top-icon-title-inline.png'
|
||||
],
|
||||
'content-bottom-icon-title-inline' => [
|
||||
'title' => esc_html__('Content Bottom | Icon Title Inline', 'essential-addons-for-elementor-lite'),
|
||||
'image' => $image_path . 'content-bottom-icon-title-inline.png'
|
||||
],
|
||||
],
|
||||
'default' => 'default-style',
|
||||
'label_block' => true,
|
||||
'toggle' => false,
|
||||
'image_choose'=> true,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_is_gradient_background',
|
||||
[
|
||||
'label' => __('Use Gradient Background', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
|
||||
'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_background',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-item' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_testimonial_is_gradient_background' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'eael_testimonial_gradient_background',
|
||||
'label' => __('Gradient Background', 'essential-addons-for-elementor-lite'),
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .eael-testimonial-item',
|
||||
'condition' => [
|
||||
'eael_testimonial_is_gradient_background' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Layout Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'default' => [
|
||||
'title' => __( 'Default', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-ban',
|
||||
],
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'default',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content' => 'text-align: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-testimonial-image' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_user_display_block',
|
||||
[
|
||||
'label' => esc_html__( 'Display User & Company Block?', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'yes',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_testimonial_image_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Testimonial Image Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'eael_testimonial_enable_avatar' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_testimonial_image_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 150,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-image figure > img' => 'width:{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_testimonial_max_image_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image Max Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 100,
|
||||
'unit' => '%',
|
||||
],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-image' => 'max-width:{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_testimonial_image_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-image img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_testimonial_image_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-image img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_testimonial_image_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .eael-testimonial-image img',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_image_rounded',
|
||||
[
|
||||
'label' => esc_html__( 'Rounded Avatar?', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'testimonial-avatar-rounded',
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_image_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-image img' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_testimonial_image_rounded!' => 'testimonial-avatar-rounded',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// color, Typography & Spacing
|
||||
$this->start_controls_section(
|
||||
'eael_section_testimonial_typography',
|
||||
[
|
||||
'label' => esc_html__( 'Color, Typography & Spacing', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_name_heading',
|
||||
[
|
||||
'label' => __( 'User Name', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_name_color',
|
||||
[
|
||||
'label' => esc_html__( 'User Name Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#272727',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .eael-testimonial-user' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_testimonial_name_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-testimonial-content .eael-testimonial-user',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_name_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .eael-testimonial-user' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_company_heading',
|
||||
[
|
||||
'label' => __( 'Company Name', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_company_color',
|
||||
[
|
||||
'label' => esc_html__( 'Company Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#272727',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .eael-testimonial-user-company' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_testimonial_position_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-testimonial-content .eael-testimonial-user-company',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_company_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .eael-testimonial-user-company' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_description_heading',
|
||||
[
|
||||
'label' => __( 'Testimonial Text', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Testimonial Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#292929',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .eael-testimonial-text' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_testimonial_description_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-testimonial-content .eael-testimonial-text',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_description_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .eael-testimonial-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_rating_heading',
|
||||
[
|
||||
'label' => __( 'Rating', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_rating_item_color',
|
||||
[
|
||||
'label' => esc_html__( 'Rating Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#f2b01e',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .rating-five .testimonial-star-rating li i' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .rating-one .testimonial-star-rating li:first-child i' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .rating-two .testimonial-star-rating li:nth-child(1) i, {{WRAPPER}} .rating-two .testimonial-star-rating li:nth-child(2) i' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .rating-three .testimonial-star-rating li:nth-child(1) i, {{WRAPPER}} .rating-three .testimonial-star-rating li:nth-child(2) i, {{WRAPPER}} .rating-three .testimonial-star-rating li:nth-child(3) i' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .rating-four .testimonial-star-rating li:nth-child(1) i, {{WRAPPER}} .rating-four .testimonial-star-rating li:nth-child(2) i, {{WRAPPER}} .rating-four .testimonial-star-rating li:nth-child(3) i, {{WRAPPER}} .rating-four .testimonial-star-rating li:nth-child(4) i' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_rating_item_size',
|
||||
[
|
||||
'label' => esc_html__( 'Rating Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .testimonial-star-rating li i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_rating_item_distance',
|
||||
[
|
||||
'label' => esc_html__( 'Distance Between Rating Item', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .testimonial-star-rating li' => 'margin-right: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_rating_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-content .testimonial-star-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_testimonial_quotation_typography',
|
||||
[
|
||||
'label' => esc_html__( 'Quotation Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_testimonial_quotation_color',
|
||||
[
|
||||
'label' => esc_html__( 'Quotation Mark Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => 'rgba(0,0,0,0.15)',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-testimonial-quote' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_testimonial_quotation_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-testimonial-quote',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_testimonial_quotation_top',
|
||||
[
|
||||
'label' => esc_html__( 'Quotation Postion From Top', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
'unit' => '%',
|
||||
],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
]
|
||||
],
|
||||
'size_units' => [ '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} span.eael-testimonial-quote' => 'top:{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_testimonial_quotation_right',
|
||||
[
|
||||
'label' => esc_html__( 'Quotation Postion From Right', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
'unit' => '%',
|
||||
],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
]
|
||||
],
|
||||
'size_units' => [ '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} span.eael-testimonial-quote' => 'right:{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render_testimonial_image() {
|
||||
$settings = $this->get_settings();
|
||||
$image = Group_Control_Image_Size::get_attachment_image_html( $settings );
|
||||
if( ! empty($image) && ! empty($settings['eael_testimonial_enable_avatar']) ) {
|
||||
ob_start();
|
||||
?>
|
||||
<div class="eael-testimonial-image">
|
||||
<?php if( 'yes' == $settings['eael_testimonial_enable_avatar'] ) : ?>
|
||||
<figure><?php echo Group_Control_Image_Size::get_attachment_image_html( $settings ); ?></figure>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
echo ob_get_clean();
|
||||
}
|
||||
}
|
||||
|
||||
protected function render_testimonial_rating() {
|
||||
$settings = $this->get_settings_for_display('eael_testimonial_enable_rating');
|
||||
|
||||
if ( $settings == 'yes' ) :
|
||||
ob_start();
|
||||
?>
|
||||
<ul class="testimonial-star-rating">
|
||||
<li><i class="fas fa-star" aria-hidden="true"></i></li>
|
||||
<li><i class="fas fa-star" aria-hidden="true"></i></li>
|
||||
<li><i class="fas fa-star" aria-hidden="true"></i></li>
|
||||
<li><i class="fas fa-star" aria-hidden="true"></i></li>
|
||||
<li><i class="fas fa-star" aria-hidden="true"></i></li>
|
||||
</ul>
|
||||
<?php
|
||||
echo ob_get_clean();
|
||||
endif;
|
||||
}
|
||||
|
||||
protected function render_user_name_and_company() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
if( ! empty($settings['eael_testimonial_name']) ) : ?><p <?php echo $this->get_render_attribute_string('eael_testimonial_user'); ?>><?php echo HelperClass::eael_wp_kses($settings['eael_testimonial_name']); ?></p><?php endif;
|
||||
if( ! empty($settings['eael_testimonial_company_title']) ) : ?><p class="eael-testimonial-user-company"><?php echo HelperClass::eael_wp_kses($settings['eael_testimonial_company_title']); ?></p><?php endif;
|
||||
}
|
||||
|
||||
protected function testimonial_quote() {
|
||||
echo '<span class="eael-testimonial-quote"></span>';
|
||||
}
|
||||
|
||||
protected function testimonial_desc() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
echo '<div class="eael-testimonial-text">'.wpautop($settings['eael_testimonial_description']).'</div>';
|
||||
}
|
||||
|
||||
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$rating = $this->get_settings_for_display('eael_testimonial_enable_rating');
|
||||
|
||||
$this->add_render_attribute(
|
||||
'eael_testimonial_wrap',
|
||||
[
|
||||
'id' => 'eael-testimonial-'.esc_attr($this->get_id()),
|
||||
'class' => [
|
||||
'eael-testimonial-item',
|
||||
'clearfix',
|
||||
$this->get_settings('eael_testimonial_image_rounded'),
|
||||
esc_attr($settings['eael_testimonial_style']),
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
if ( $rating == 'yes' )
|
||||
$this->add_render_attribute('eael_testimonial_wrap', 'class', $this->get_settings('eael_testimonial_rating_number'));
|
||||
|
||||
$this->add_render_attribute('eael_testimonial_user', 'class', 'eael-testimonial-user');
|
||||
if ( ! empty( $settings['eael_testimonial_user_display_block'] ) )
|
||||
$this->add_render_attribute('eael_testimonial_user', 'style', 'display: block; float: none;');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div <?php echo $this->get_render_attribute_string('eael_testimonial_wrap'); ?>>
|
||||
|
||||
<?php if('classic-style' == $settings['eael_testimonial_style']) { ?>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php
|
||||
// $this->testimonial_quote();
|
||||
$this->testimonial_desc();
|
||||
?>
|
||||
<div class="clearfix">
|
||||
<?php $this->render_user_name_and_company(); ?>
|
||||
</div>
|
||||
<?php $this->render_testimonial_rating( $settings ); ?>
|
||||
</div>
|
||||
<?php $this->render_testimonial_image(); ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if('middle-style' == $settings['eael_testimonial_style']) { ?>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php
|
||||
// $this->testimonial_quote();
|
||||
$this->testimonial_desc();
|
||||
?>
|
||||
<?php $this->render_testimonial_image(); ?>
|
||||
<div class="clearfix">
|
||||
<?php $this->render_user_name_and_company(); ?>
|
||||
</div>
|
||||
<?php $this->render_testimonial_rating( $settings ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if('default-style' == $settings['eael_testimonial_style']) { ?>
|
||||
<?php $this->render_testimonial_image(); ?>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php
|
||||
// $this->testimonial_quote();
|
||||
$this->testimonial_desc();
|
||||
$this->render_testimonial_rating( $settings );
|
||||
$this->render_user_name_and_company();
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if('icon-img-left-content' == $settings['eael_testimonial_style']) { ?>
|
||||
<?php
|
||||
// $this->testimonial_quote();
|
||||
$this->render_testimonial_image();
|
||||
?>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php
|
||||
$this->testimonial_desc();
|
||||
$this->render_testimonial_rating( $settings );
|
||||
?>
|
||||
<div class="bio-text clearfix">
|
||||
<?php $this->render_user_name_and_company(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if('icon-img-right-content' == $settings['eael_testimonial_style']) { ?>
|
||||
<?php
|
||||
// $this->testimonial_quote();
|
||||
$this->render_testimonial_image();
|
||||
?>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php
|
||||
$this->testimonial_desc();
|
||||
$this->render_testimonial_rating( $settings );
|
||||
?>
|
||||
<div class="bio-text-right"><?php $this->render_user_name_and_company(); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if('content-top-icon-title-inline' == $settings['eael_testimonial_style']) { ?>
|
||||
<div class="eael-testimonial-content eael-testimonial-inline-bio">
|
||||
<?php $this->render_testimonial_image(); ?>
|
||||
<div class="bio-text"><?php $this->render_user_name_and_company(); ?></div>
|
||||
<?php $this->render_testimonial_rating( $settings ); ?>
|
||||
</div>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php $this->testimonial_desc(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if('content-bottom-icon-title-inline' == $settings['eael_testimonial_style']) { ?>
|
||||
<div class="eael-testimonial-content">
|
||||
<?php $this->testimonial_desc(); ?>
|
||||
</div>
|
||||
<div class="eael-testimonial-content eael-testimonial-inline-bio">
|
||||
<?php $this->render_testimonial_image(); ?>
|
||||
<div class="bio-text"><?php $this->render_user_name_and_company(); ?></div>
|
||||
<?php $this->render_testimonial_rating( $settings ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php $this->testimonial_quote(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
|
||||
protected function content_template() {}
|
||||
}
|
||||
@@ -0,0 +1,752 @@
|
||||
<?php
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Elementor\Icons_Manager;
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
class Tooltip extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'eael-tooltip';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Tooltip', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eaicon-tooltip';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor' ];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'tooltip',
|
||||
'ea tooltip',
|
||||
'popover',
|
||||
'hover',
|
||||
'hint',
|
||||
'floating text',
|
||||
'glossary',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/tooltip/';
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
/**
|
||||
* Tooltip Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_tooltip_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Content Settings', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_type',
|
||||
[
|
||||
'label' => esc_html__( 'Content Type', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'icon' => [
|
||||
'title' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-info',
|
||||
],
|
||||
'text' => [
|
||||
'title' => esc_html__( 'Text', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-text-width',
|
||||
],
|
||||
'image' => [
|
||||
'title' => esc_html__( 'Image', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-image',
|
||||
],
|
||||
'shortcode' => [
|
||||
'title' => esc_html__( 'Shortcode', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-code',
|
||||
],
|
||||
],
|
||||
'default' => 'icon',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_tooltip_icon_content_new',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'fa4compatibility' => 'eael_tooltip_icon_content',
|
||||
'default' => [
|
||||
'value' => 'fas fa-home',
|
||||
'library' => 'fa-solid',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => [ 'icon' ]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'default' => [
|
||||
'size' => 60,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150,
|
||||
],
|
||||
'%' => [
|
||||
'max' => 100
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-content i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-content svg' => 'height: {{SIZE}}{{UNIT}};width: {{SIZE}}{{UNIT}};line-height: {{SIZE}}{{UNIT}};',
|
||||
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-content .ea-tooltip-svg-trigger' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => 'icon'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_tooltip_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Hover Me!', 'essential-addons-for-elementor-lite'),
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => [ 'text' ]
|
||||
],
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_content_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Content Tag', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'span',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1', 'essential-addons-for-elementor-lite'),
|
||||
'h2' => esc_html__( 'H2', 'essential-addons-for-elementor-lite'),
|
||||
'h3' => esc_html__( 'H3', 'essential-addons-for-elementor-lite'),
|
||||
'h4' => esc_html__( 'H4', 'essential-addons-for-elementor-lite'),
|
||||
'h5' => esc_html__( 'H5', 'essential-addons-for-elementor-lite'),
|
||||
'h6' => esc_html__( 'H6', 'essential-addons-for-elementor-lite'),
|
||||
'div' => esc_html__( 'DIV', 'essential-addons-for-elementor-lite'),
|
||||
'span' => esc_html__( 'SPAN', 'essential-addons-for-elementor-lite'),
|
||||
'p' => esc_html__( 'P', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => 'text'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_tooltip_img_content',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
],
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => [ 'image' ]
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_tooltip_shortcode_content',
|
||||
[
|
||||
'label' => esc_html__( 'Shortcode', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '[shortcode-here]', 'essential-addons-for-elementor-lite'),
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => [ 'shortcode' ]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_content_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
'title' => __( 'Justified', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'eael-tooltip-align%s-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_tooltip_enable_link',
|
||||
[
|
||||
'label' => esc_html__( 'Enable Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'false',
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'eael_tooltip_type!' => ['shortcode']
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_link',
|
||||
[
|
||||
'label' => esc_html__( 'Button Link', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => ['active' => true],
|
||||
'label_block' => true,
|
||||
'default' => [
|
||||
'url' => '#',
|
||||
'is_external' => '',
|
||||
],
|
||||
'show_external' => true,
|
||||
'condition' => [
|
||||
'eael_tooltip_enable_link' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* Tooltip Hover Content Settings
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_tooltip_hover_content_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Tooltip Settings', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_hover_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Tooltip content', 'essential-addons-for-elementor-lite'),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_hover_dir',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Direction', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'right',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'left' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
|
||||
'right' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
|
||||
'top' => esc_html__( 'Top', 'essential-addons-for-elementor-lite'),
|
||||
'bottom' => esc_html__( 'Bottom', 'essential-addons-for-elementor-lite'),
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_hover_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Speed', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'default' => esc_html__( '300', 'essential-addons-for-elementor-lite'),
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip:hover .eael-tooltip-text.eael-tooltip-top' => 'animation-duration: {{SIZE}}ms;',
|
||||
'{{WRAPPER}} .eael-tooltip:hover .eael-tooltip-text.eael-tooltip-left' => 'animation-duration: {{SIZE}}ms;',
|
||||
'{{WRAPPER}} .eael-tooltip:hover .eael-tooltip-text.eael-tooltip-bottom' => 'animation-duration: {{SIZE}}ms;',
|
||||
'{{WRAPPER}} .eael-tooltip:hover .eael-tooltip-text.eael-tooltip-right' => 'animation-duration: {{SIZE}}ms;',
|
||||
],
|
||||
'ai' => [
|
||||
'active' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style Tooltip Content
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_tooltip_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Content Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_max_width',
|
||||
[
|
||||
'label' => __( 'Content Max Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
'step' => 1,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 100,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip' => 'width: {{SIZE}}{{UNIT}};',
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_text_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Content Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
'title' => __( 'Justified', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'eael_tooltip_type' => 'text'
|
||||
],
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'eael-tooltip-text-align-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs( 'eael_tooltip_content_style_tabs' );
|
||||
// Normal State Tab
|
||||
$this->start_controls_tab( 'eael_tooltip_content_normal', [ 'label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite') ] );
|
||||
$this->add_control(
|
||||
'eael_tooltip_content_bg_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip a' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip',
|
||||
]
|
||||
);
|
||||
$this->end_controls_tab();
|
||||
|
||||
// Hover State Tab
|
||||
$this->start_controls_tab( 'eael_tooltip_content_hover', [ 'label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite') ] );
|
||||
$this->add_control(
|
||||
'eael_tooltip_content_hover_bg_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_content_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#212121',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip:hover' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip:hover a' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip:hover svg' => 'fill: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_hover_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip:hover',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_hover_border',
|
||||
'label' => esc_html__( 'Border', 'essential-addons-for-elementor-lite'),
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip:hover',
|
||||
]
|
||||
);
|
||||
$this->end_controls_tab();
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_content_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip',
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_content_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
|
||||
if(!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __( 'Go Premium for More Features', 'essential-addons-for-elementor-lite')
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __( 'Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>'
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/**
|
||||
* -------------------------------------------
|
||||
* Tab Style Tooltip Hover Content
|
||||
* -------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'eael_section_tooltip_hover_style_settings',
|
||||
[
|
||||
'label' => esc_html__( 'Tooltip Style', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_hover_width',
|
||||
[
|
||||
'label' => __( 'Tooltip Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => '150'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
'step' => 5,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text' => 'width: {{SIZE}}{{UNIT}};',
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_hover_max_width',
|
||||
[
|
||||
'label' => __( 'Tooltip Max Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => '150'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
'step' => 5,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text' => 'max-width: {{SIZE}}{{UNIT}};',
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_hover_content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_hover_content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_hover_content_bg_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#555',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_hover_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_hover_content_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip .eael-tooltip-text',
|
||||
]
|
||||
);
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_tooltip_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-tooltip .eael-tooltip-text',
|
||||
]
|
||||
);
|
||||
$this->add_responsive_control(
|
||||
'eael_tooltip_arrow_size',
|
||||
[
|
||||
'label' => __( 'Arrow Size', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text:after' => 'border-width: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-left::after' => 'top: calc( 50% - {{SIZE}}{{UNIT}} );',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-right::after' => 'top: calc( 50% - {{SIZE}}{{UNIT}} );',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-top::after' => 'left: calc( 50% - {{SIZE}}{{UNIT}} );',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-bottom::after' => 'left: calc( 50% - {{SIZE}}{{UNIT}} );',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_tooltip_arrow_color',
|
||||
[
|
||||
'label' => esc_html__( 'Arrow Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#555',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-top:after' => 'border-top-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-bottom:after' => 'border-bottom-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-left:after' => 'border-left-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-tooltip .eael-tooltip-text.eael-tooltip-right:after' => 'border-right-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
protected function render( ) {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
$icon_migrated = isset($settings['__fa4_migrated']['eael_tooltip_icon_content_new']);
|
||||
$icon_is_new = empty($settings['eael_tooltip_icon_content']);
|
||||
$this->add_link_attributes( 'eael_tooltip_link', (array) $settings['eael_tooltip_link'] );
|
||||
?>
|
||||
<div class="eael-tooltip">
|
||||
<?php if( $settings['eael_tooltip_type'] === 'text' ) : ?>
|
||||
<<?php echo esc_attr( Helper::eael_validate_html_tag($settings['eael_tooltip_content_tag']) ); ?> class="eael-tooltip-content" tabindex="0" aria-describedby="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>"><?php if( $settings['eael_tooltip_enable_link'] === 'yes' ) : ?><a <?php $this->print_render_attribute_string( 'eael_tooltip_link' ); ?>><?php endif; ?><?php echo wp_kses_post($settings['eael_tooltip_content']); ?><?php if( $settings['eael_tooltip_enable_link'] === 'yes' ) : ?></a><?php endif; ?></<?php echo esc_attr( Helper::eael_validate_html_tag($settings['eael_tooltip_content_tag']) ); ?>>
|
||||
<span id="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>" class="eael-tooltip-text eael-tooltip-<?php echo esc_attr( $settings['eael_tooltip_hover_dir'] ) ?>" role="tooltip"><?php echo __( $settings['eael_tooltip_hover_content'] ); ?></span>
|
||||
<?php elseif( $settings['eael_tooltip_type'] === 'icon' ) : ?>
|
||||
<span class="eael-tooltip-content" tabindex="0" aria-describedby="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>"><?php if( $settings['eael_tooltip_enable_link'] === 'yes' ) : ?><a <?php $this->print_render_attribute_string( 'eael_tooltip_link' ); ?>><?php endif; ?>
|
||||
<?php if ($icon_is_new || $icon_migrated) { ?>
|
||||
<?php if( isset($settings['eael_tooltip_icon_content_new']['value']['url']) ) : ?>
|
||||
<img class="ea-tooltip-svg-trigger" src="<?php echo esc_url( $settings['eael_tooltip_icon_content_new']['value']['url'] ); ?>" alt="<?php echo esc_attr(get_post_meta($settings['eael_tooltip_icon_content_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" />
|
||||
<?php else :
|
||||
Icons_Manager::render_icon( $settings['eael_tooltip_icon_content_new'], [ 'aria-hidden' => 'true' ] );
|
||||
endif;
|
||||
} else {
|
||||
Icons_Manager::render_icon( $settings['eael_tooltip_icon_content'], [ 'aria-hidden' => 'true' ] );
|
||||
} ?>
|
||||
<?php if( $settings['eael_tooltip_enable_link'] === 'yes' ) : ?></a><?php endif; ?></span>
|
||||
<span id="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>" class="eael-tooltip-text eael-tooltip-<?php echo esc_attr( $settings['eael_tooltip_hover_dir'] ) ?>" role="tooltip"><?php echo __( $settings['eael_tooltip_hover_content'] ); ?></span>
|
||||
<?php elseif( $settings['eael_tooltip_type'] === 'image' ) : ?>
|
||||
<span class="eael-tooltip-content" tabindex="0" aria-describedby="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>"><?php if( $settings['eael_tooltip_enable_link'] === 'yes' ) : ?><a <?php $this->print_render_attribute_string( 'eael_tooltip_link' ); ?>><?php endif; ?><img src="<?php echo esc_url( $settings['eael_tooltip_img_content']['url'] ); ?>" alt="<?php echo esc_attr( get_post_meta($settings['eael_tooltip_img_content']['id'], '_wp_attachment_image_alt', true) ); ?>"><?php if( $settings['eael_tooltip_enable_link'] === 'yes' ) : ?></a><?php endif; ?></span>
|
||||
<span id="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>" class="eael-tooltip-text eael-tooltip-<?php echo esc_attr( $settings['eael_tooltip_hover_dir'] ) ?>" role="tooltip"><?php echo __( $settings['eael_tooltip_hover_content'] ); ?></span>
|
||||
<?php elseif( $settings['eael_tooltip_type'] === 'shortcode' ) : ?>
|
||||
<div class="eael-tooltip-content" tabindex="0" aria-describedby="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>"><?php echo do_shortcode( $settings['eael_tooltip_shortcode_content'] ); ?></div>
|
||||
<span id="tooltip-text-<?php echo esc_attr( $this->get_id() ); ?>" class="eael-tooltip-text eael-tooltip-<?php echo esc_attr( $settings['eael_tooltip_hover_dir'] ) ?>" role="tooltip"><?php echo __( $settings['eael_tooltip_hover_content'] ); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,372 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
class TypeForm extends Widget_Base {
|
||||
|
||||
private $form_list = [];
|
||||
|
||||
public function get_name () {
|
||||
return 'eael-typeform';
|
||||
}
|
||||
|
||||
public function get_title () {
|
||||
return __('Typeform', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_categories () {
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_icon () {
|
||||
return 'eaicon-typeform';
|
||||
}
|
||||
|
||||
public function get_keywords () {
|
||||
return [
|
||||
'ea contact form',
|
||||
'ea typeform',
|
||||
'ea type form',
|
||||
'ea type forms',
|
||||
'contact form',
|
||||
'form styler',
|
||||
'elementor form',
|
||||
'feedback',
|
||||
'typeform',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url () {
|
||||
return 'https://essential-addons.com/elementor/docs/typeform/';
|
||||
}
|
||||
|
||||
private function get_personal_token () {
|
||||
return get_option('eael_save_typeform_personal_token');
|
||||
}
|
||||
|
||||
public function get_form_list () {
|
||||
|
||||
$token = $this->get_personal_token();
|
||||
$key = 'eael_typeform_'.md5(implode('', ['eael_type_form_data', $token]));
|
||||
$form_arr = get_transient($key);
|
||||
if (empty($form_arr)) {
|
||||
$response = wp_remote_get(
|
||||
'https://api.typeform.com/forms?page_size=200',
|
||||
[
|
||||
'headers' => [
|
||||
'Authorization' => "Bearer $token",
|
||||
]
|
||||
]
|
||||
);
|
||||
if (is_wp_error($response)) {
|
||||
return $this->form_list;
|
||||
}
|
||||
|
||||
if (isset($response['response']['code']) && $response['response']['code'] == 200) {
|
||||
$data = json_decode(wp_remote_retrieve_body($response));
|
||||
if (isset($data->items)) {
|
||||
$form_arr = $data->items;
|
||||
set_transient($key, $form_arr, 1 * HOUR_IN_SECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->form_list[''] = __('Select Form', 'essential-addons-for-elementor-lite');
|
||||
if (!empty($form_arr)) {
|
||||
foreach ($form_arr as $item) {
|
||||
$this->form_list[$item->_links->display] = $item->title;
|
||||
}
|
||||
}
|
||||
return $this->form_list;
|
||||
}
|
||||
|
||||
private function no_token_set () {
|
||||
$this->start_controls_section(
|
||||
'eael_global_warning',
|
||||
[
|
||||
'label' => __('Warning!', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_global_warning_text',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('Whoops! It seems like you haven\'t connected your Typeform account. To do this, navigate to <b>WordPress Dashboard -> Essential Addons -> Elements -> Typeform</b> (<a target="_blank" href="'.esc_url(admin_url( 'admin.php?page=eael-settings')).'">Get Access</a>).',
|
||||
'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function register_controls () {
|
||||
|
||||
if ($this->get_personal_token() == '') {
|
||||
$this->no_token_set();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_info_box',
|
||||
[
|
||||
'label' => __('Typeform', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_typeform_list',
|
||||
[
|
||||
'label' => __('Typeform', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => '',
|
||||
'label_block' => true,
|
||||
'options' => $this->get_form_list()
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_typeform_hideheaders',
|
||||
[
|
||||
'label' => __('Hide Header', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'eael_typeform_hidefooter',
|
||||
[
|
||||
'label' => __('Hide Footer', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Style Tab: Form Container
|
||||
* -------------------------------------------------
|
||||
*/
|
||||
$this->start_controls_section(
|
||||
'section_container_style',
|
||||
[
|
||||
'label' => __('Form Container', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_typeform_background',
|
||||
[
|
||||
'label' => esc_html__('Form Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-typeform' => 'background: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_typeform_alignment',
|
||||
[
|
||||
'label' => esc_html__('Form Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'default' => [
|
||||
'title' => __('Default', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-ban',
|
||||
],
|
||||
'left' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'default',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_typeform_max_width',
|
||||
[
|
||||
'label' => esc_html__('Form Max Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-typeform' => 'width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_typeform_max_height',
|
||||
[
|
||||
'label' => esc_html__('Form Height', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => '700',
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-typeform' => 'height: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_typeform_opacity',
|
||||
[
|
||||
'label' => __('Opacity', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 50,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_typeform_margin',
|
||||
[
|
||||
'label' => esc_html__('Form Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-typeform' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_typeform_padding',
|
||||
[
|
||||
'label' => esc_html__('Form Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-typeform' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_type_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'separator' => 'before',
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-typeform' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_type_border',
|
||||
'selector' => '{{WRAPPER}} .eael-typeform',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_typeform_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-typeform',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function render () {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
if ($this->get_settings('eael_typeform_list') == '') {
|
||||
return;
|
||||
}
|
||||
$id = 'eael-type-form-'.$this->get_id();
|
||||
$this->add_render_attribute(
|
||||
'eael_typeform_wrapper',
|
||||
[
|
||||
'id' => $id,
|
||||
'class' => [
|
||||
'eael-typeform',
|
||||
'clearfix',
|
||||
'fs_wp_sidebar',
|
||||
'fsBody',
|
||||
'eael-contact-form'
|
||||
]
|
||||
]
|
||||
);
|
||||
$alignment = $settings['eael_typeform_alignment'];
|
||||
$this->add_render_attribute('eael_typeform_wrapper', 'class', 'eael-typeform-align-'.$alignment);
|
||||
$data = [
|
||||
'url' => esc_url($settings['eael_typeform_list']),
|
||||
'hideFooter' => ($this->get_settings('eael_typeform_hidefooter') == 'yes'),
|
||||
'hideHeaders' => ($this->get_settings('eael_typeform_hideheaders') == 'yes'),
|
||||
'opacity' => $this->get_settings('eael_typeform_opacity')['size']
|
||||
];
|
||||
echo '<div data-typeform="'.htmlspecialchars(json_encode($data), ENT_QUOTES,
|
||||
'UTF-8').'" '.$this->get_render_attribute_string('eael_typeform_wrapper').'></div>';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,803 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
|
||||
use \Elementor\Widget_Base;
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
class WeForms extends Widget_Base
|
||||
{
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'eael-weform';
|
||||
}
|
||||
|
||||
public function get_title()
|
||||
{
|
||||
return esc_html__('weForm', 'essential-addons-for-elementor-lite');
|
||||
}
|
||||
|
||||
public function get_icon()
|
||||
{
|
||||
return 'eaicon-weforms';
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
return ['essential-addons-elementor'];
|
||||
}
|
||||
|
||||
public function get_keywords()
|
||||
{
|
||||
return [
|
||||
'contact form',
|
||||
'ea contact form',
|
||||
'ea we form',
|
||||
'ea weform',
|
||||
'ea weforms',
|
||||
'form styler',
|
||||
'ea form styler',
|
||||
'elementor form',
|
||||
'feedback',
|
||||
'ea',
|
||||
'essential addons'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url()
|
||||
{
|
||||
return 'https://essential-addons.com/elementor/docs/weforms/';
|
||||
}
|
||||
|
||||
protected function register_controls()
|
||||
{
|
||||
|
||||
if (!function_exists('WeForms')) {
|
||||
$this->start_controls_section(
|
||||
'eael_global_warning',
|
||||
[
|
||||
'label' => __('Warning!', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_global_warning_text',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => __('<strong>WeForms</strong> is not installed/activated on your site. Please install and activate <strong>WeForms</strong> first.', 'essential-addons-for-elementor-lite'),
|
||||
'content_classes' => 'eael-warning',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
} else {
|
||||
$this->start_controls_section(
|
||||
'eael_section_weform',
|
||||
[
|
||||
'label' => esc_html__('Select Form', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'wpuf_contact_form',
|
||||
[
|
||||
'label' => esc_html__('Select weForm', 'essential-addons-for-elementor-lite'),
|
||||
'description' => esc_html__('Please save and refresh the page after selecting the form', 'essential-addons-for-elementor-lite'),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => Helper::get_weform_list(),
|
||||
'default' => '0',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
if (!apply_filters('eael/pro_enabled', false)) {
|
||||
$this->start_controls_section(
|
||||
'eael_section_pro',
|
||||
[
|
||||
'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_control_get_pro',
|
||||
[
|
||||
'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'1' => [
|
||||
'title' => '',
|
||||
'icon' => 'fa fa-unlock-alt',
|
||||
],
|
||||
],
|
||||
'default' => '1',
|
||||
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
}
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_weform_styles',
|
||||
[
|
||||
'label' => esc_html__('Form Container Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_background',
|
||||
[
|
||||
'label' => esc_html__('Form Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_alignment',
|
||||
[
|
||||
'label' => esc_html__('Form Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'default' => [
|
||||
'title' => __('Default', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-ban',
|
||||
],
|
||||
'left' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'default',
|
||||
'prefix_class' => 'eael-contact-form-align-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_width',
|
||||
[
|
||||
'label' => esc_html__('Form Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_max_width',
|
||||
[
|
||||
'label' => esc_html__('Form Max Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container' => 'max-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_margin',
|
||||
[
|
||||
'label' => esc_html__('Form Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_padding',
|
||||
[
|
||||
'label' => esc_html__('Form Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'separator' => 'before',
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_border',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_weform_field_styles',
|
||||
[
|
||||
'label' => esc_html__('Form Fields Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_input_background',
|
||||
[
|
||||
'label' => esc_html__('Input Field Background', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_input_width',
|
||||
[
|
||||
'label' => esc_html__('Input Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_textarea_width',
|
||||
[
|
||||
'label' => esc_html__('Textarea Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_input_padding',
|
||||
[
|
||||
'label' => esc_html__('Fields Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_input_margin',
|
||||
[
|
||||
'label' => esc_html__('Fields Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_input_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'separator' => 'before',
|
||||
'size_units' => ['px'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_input_border',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_input_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_focus_heading',
|
||||
[
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'label' => esc_html__('Focus State Style', 'essential-addons-for-elementor-lite'),
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_input_focus_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea:focus',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_input_focus_border',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"]:focus,
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea:focus' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_label_style_heading',
|
||||
[
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'label' => esc_html__('Label Style', 'essential-addons-for-elementor-lite'),
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_label_margin',
|
||||
[
|
||||
'label' => __('Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', '%', 'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container .wpuf-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_weform_typography',
|
||||
[
|
||||
'label' => esc_html__('Color & Typography', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_label_color',
|
||||
[
|
||||
'label' => esc_html__('Label Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container, {{WRAPPER}} .eael-weform-container .wpuf-label label' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_field_color',
|
||||
[
|
||||
'label' => esc_html__('Field Font Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_placeholder_color',
|
||||
[
|
||||
'label' => esc_html__('Placeholder Font Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-weform-container ::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .eael-weform-container ::-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_label_heading',
|
||||
[
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'label' => esc_html__('Label Typography', 'essential-addons-for-elementor-lite'),
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_label_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container, {{WRAPPER}} .eael-weform-container .wpuf-label label',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_heading_input_field',
|
||||
[
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'label' => esc_html__('Input Fields Typography', 'essential-addons-for-elementor-lite'),
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_input_field_typography',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="text"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="password"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="email"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="url"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields input[type="number"],
|
||||
{{WRAPPER}} .eael-weform-container ul.wpuf-form li .wpuf-fields textarea',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'eael_section_weform_submit_button_styles',
|
||||
[
|
||||
'label' => esc_html__('Submit Button Styles', 'essential-addons-for-elementor-lite'),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_submit_btn_width',
|
||||
[
|
||||
'label' => esc_html__('Button Width', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 10,
|
||||
'max' => 1500,
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_submit_btn_alignment',
|
||||
[
|
||||
'label' => esc_html__('Button Alignment', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'label_block' => true,
|
||||
'options' => [
|
||||
'default' => [
|
||||
'title' => __('Default', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'fa fa-ban',
|
||||
],
|
||||
'left' => [
|
||||
'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'default',
|
||||
'prefix_class' => 'eael-contact-form-btn-align-',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_submit_btn_typography',
|
||||
'global' => [
|
||||
'default' => Global_Typography::TYPOGRAPHY_PRIMARY
|
||||
],
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_submit_btn_margin',
|
||||
[
|
||||
'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'eael_weform_submit_btn_padding',
|
||||
[
|
||||
'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->start_controls_tabs('eael_weform_submit_button_tabs');
|
||||
|
||||
$this->start_controls_tab('normal', ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_submit_btn_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_submit_btn_background_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_submit_btn_border',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_submit_btn_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]' => 'border-radius: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->start_controls_tab('eael_weform_submit_btn_hover', ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_submit_btn_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_submit_btn_hover_background_color',
|
||||
[
|
||||
'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'eael_weform_submit_btn_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab();
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'eael_weform_submit_btn_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .eael-weform-container ul.wpuf-form .wpuf-submit input[type="submit"]',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render()
|
||||
{
|
||||
if (!function_exists('WeForms')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
if (!empty($settings['wpuf_contact_form'])) {
|
||||
echo '<div class="eael-weform-container">
|
||||
' . do_shortcode('[weforms id="' . esc_attr( $settings['wpuf_contact_form'] ) . '" ]') . '
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Essential_Addons_Elementor\Elements;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Widget_Base;
|
||||
use Essential_Addons_Elementor\Traits\Woo_Product_Comparable;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Class Woo_Product_Compare
|
||||
* @package namespace Essential_Addons_Elementor\Pro\Elements;
|
||||
*/
|
||||
class Woo_Product_Compare extends Widget_Base {
|
||||
use Woo_Product_Comparable;
|
||||
|
||||
protected $products_list = [];
|
||||
protected $remove_action = 'eael-wcpc-remove-product';
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'eael-woo-product-compare';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function get_title() {
|
||||
return esc_html__( 'Woo Product Compare', 'essential-addons-for-elementor-lite' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'eaicon-product-compare';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function get_keywords() {
|
||||
return [
|
||||
'woocommerce product compare',
|
||||
'woocommerce product comparison',
|
||||
'product compare',
|
||||
'product comparison',
|
||||
'products compare',
|
||||
'products comparison',
|
||||
'wc',
|
||||
'woocommerce',
|
||||
'products',
|
||||
'compare',
|
||||
'comparison',
|
||||
'ea',
|
||||
'essential addons',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_custom_help_url() {
|
||||
return 'https://essential-addons.com/elementor/docs/woo-product-compare/';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function get_categories() {
|
||||
return [ 'essential-addons-elementor', 'woocommerce-elements' ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function register_controls() {
|
||||
$this->init_content_wc_notice_controls();
|
||||
if ( ! function_exists( 'WC' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*----Content Tab----*/
|
||||
do_action( 'eael/wcpc/before-content-controls', $this );
|
||||
$this->init_content_product_compare_controls();
|
||||
$this->init_content_table_settings_controls();
|
||||
do_action( 'eael/wcpc/after-content-controls', $this );
|
||||
|
||||
/*----Style Tab----*/
|
||||
do_action( 'eael/wcpc/before-style-controls', $this );
|
||||
$this->init_style_content_controls();
|
||||
$this->init_style_table_controls();
|
||||
do_action( 'eael/wcpc/after-style-controls', $this );
|
||||
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
if ( ! function_exists( 'WC' ) ) {
|
||||
return;
|
||||
}
|
||||
$ds = $this->get_settings_for_display();
|
||||
$product_ids = $this->get_settings_for_display( 'product_ids' );
|
||||
$products = $this->get_products_list( $product_ids );
|
||||
$fields = $this->fields();
|
||||
|
||||
$this->render_compare_table( compact( 'products', 'fields', 'ds' ) );
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<?php // Silence is golden
|
||||
Reference in New Issue
Block a user