Hotel Raxa - Advanced Booking System Implementation
🏨 Hotel Booking Enhancements: - Implemented Eagle Booking Advanced Pricing add-on - Added Booking.com-style rate management system - Created professional calendar interface for pricing - Integrated deals and discounts functionality 💰 Advanced Pricing Features: - Dynamic pricing models (per room, per person, per adult) - Base rates, adult rates, and child rates management - Length of stay discounts and early bird deals - Mobile rates and secret deals implementation - Seasonal promotions and flash sales 📅 Availability Management: - Real-time availability tracking - Stop sell and restriction controls - Closed to arrival/departure functionality - Minimum/maximum stay requirements - Automatic sold-out management 💳 Payment Integration: - Maintained Redsys payment gateway integration - Seamless integration with existing Eagle Booking - No modifications to core Eagle Booking plugin 🛠️ Technical Implementation: - Custom database tables for advanced pricing - WordPress hooks and filters integration - AJAX-powered admin interface - Data migration from existing Eagle Booking - Professional calendar view for revenue management 📊 Admin Interface: - Booking.com-style management dashboard - Visual rate and availability calendar - Bulk operations for date ranges - Statistics and analytics dashboard - Modal dialogs for quick editing 🔧 Code Quality: - WordPress coding standards compliance - Secure database operations with prepared statements - Proper input validation and sanitization - Error handling and logging - Responsive admin interface 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
321
wp-content/plugins/eagle-core/eagle-elementor/widgets/brand.php
Normal file
321
wp-content/plugins/eagle-core/eagle-elementor/widgets/brand.php
Normal file
@@ -0,0 +1,321 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* @since 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_BRAND extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_brand';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Brand', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-star';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'elementor-section-title' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'section_brand',
|
||||
[
|
||||
'label' => __( 'Brand', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Logo
|
||||
$this->add_control(
|
||||
'logo',
|
||||
[
|
||||
'label' => __( 'Logo', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
//Logo Width
|
||||
$this->add_control(
|
||||
'width',
|
||||
[
|
||||
'label' => __( 'Offset', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '100',
|
||||
]
|
||||
);
|
||||
|
||||
// Stars Switch
|
||||
$this->add_control(
|
||||
'rating_switch',
|
||||
[
|
||||
'label' => __( 'Rating', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
'default' => 'true',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
//Stars
|
||||
$this->add_control(
|
||||
'stars',
|
||||
[
|
||||
'label' => esc_html__( 'Stars', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 0,
|
||||
'max' => 5,
|
||||
'step' => 1,
|
||||
'default' => 5,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'rating_switch',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'true',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Title
|
||||
$this->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Title', 'eagle' ),
|
||||
'placeholder' => esc_html__( 'Type your title here', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Description
|
||||
$this->add_control(
|
||||
'description',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => \Elementor\Controls_Manager::WYSIWYG,
|
||||
'default' => esc_html__( 'Default description', 'eagle' ),
|
||||
'placeholder' => __( 'Type your description here', 'eagle' ),
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Style
|
||||
$this->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => __( 'Style', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Stars Color
|
||||
$this->add_control(
|
||||
'stars_color',
|
||||
[
|
||||
'label' => __( 'Stars Color', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .brand-info .inner .stars i:before' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .brand-info .inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .brand-info .inner .content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Title]
|
||||
$this->start_controls_section(
|
||||
'title_section',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Title Color
|
||||
$this->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => __( 'Title Color', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .brand-info .inner .title' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .brand-info .inner .title',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Description]
|
||||
$this->start_controls_section(
|
||||
'description_section',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Description Color
|
||||
$this->add_control(
|
||||
'text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .brand-info .inner .desc' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'body_text_color' ),
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Description Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'desc_typography',
|
||||
'selector' => '{{WRAPPER}} .brand-info .inner .desc',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Background]
|
||||
$this->start_controls_section(
|
||||
'background_section',
|
||||
[
|
||||
'label' => __( 'Background', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Background Color
|
||||
$this->add_control(
|
||||
'background_color',
|
||||
[
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .brand-info .inner .content' => 'background: {{VALUE}};',
|
||||
'{{WRAPPER}} .brand-info .inner ' => 'border-color: {{VALUE}};'
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Background Image
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'background_image',
|
||||
'label' => esc_html__( 'Background', 'eagle' ),
|
||||
'types' => [ 'classic', 'video' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .brand-info' => 'background-image: url({{VALUE}});',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
//Rating Render
|
||||
protected function render_stars( ) {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$rating = $settings['stars'];
|
||||
$stars_html = '';
|
||||
|
||||
for ( $stars = 1; $stars <= $rating; $stars++ ) {
|
||||
|
||||
$stars_html .= '<i class="fa fa-star"></i>';
|
||||
}
|
||||
|
||||
return $stars_html;
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$stars_element = '<div>' . $this->render_stars() . '</div>';
|
||||
|
||||
?>
|
||||
<div class="brand-info">
|
||||
<div class="inner">
|
||||
<div class="content">
|
||||
<img src="<?php echo esc_url( $settings['logo']['url'] ) ?>" width="<?php echo esc_html( $settings['width'] ) ?>" alt="<?php echo esc_html( $settings['title'] ) ?>">
|
||||
<div class="stars"><?php echo $stars_element ?></div>
|
||||
<h5 class="title"> <?php echo esc_html( $settings['title'] ) ?></h5>
|
||||
<div class="desc"> <?php echo $settings['description'] ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_CONTACT extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_contact_info';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Contact Info', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-info-circle-o';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'core' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new \Elementor\Repeater();
|
||||
|
||||
//Icon
|
||||
$repeater->add_control(
|
||||
'icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-star',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Title
|
||||
$repeater->add_control(
|
||||
'title', [
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => __( 'Service Title' , 'eagle' ),
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
//Link
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::URL,
|
||||
'placeholder' => __( 'https://your-link.com', 'eagle' ),
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => false,
|
||||
'nofollow' => false,
|
||||
'custom_attributes' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contact',
|
||||
[
|
||||
'label' => __( 'Items', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => __( 'Item #1', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => __( 'Item #2', 'eagle' ),
|
||||
],
|
||||
],
|
||||
'title_field' => '{{{ title }}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
|
||||
|
||||
// New Section [Layout]
|
||||
$this->start_controls_section(
|
||||
'layout_section',
|
||||
[
|
||||
'label' => __( 'Layout', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// Border Color
|
||||
$this->add_control(
|
||||
'border_color', [
|
||||
'label' => __( 'Border Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-contact-info ul li' => 'border-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Seperator Color
|
||||
$this->add_control(
|
||||
'seperator_color', [
|
||||
'label' => __( 'Seperator Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-contact-info ul li i:after' => 'background-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
// Margin Bottom
|
||||
$this->add_control(
|
||||
'spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Vertical Spacing', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 30,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-contact-info ul li' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eth-contact-info ul li:last-child' => 'margin-bottom: 0;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
// Border Radius
|
||||
$this->add_control(
|
||||
'border_radius', [
|
||||
'label' => __( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-contact-info ul li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Title]
|
||||
$this->start_controls_section(
|
||||
'title_section',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Title Color
|
||||
$this->add_control(
|
||||
'title_color', [
|
||||
'label' => __( 'Title Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .title' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Title Typography', 'eagle' ),
|
||||
'name' => 'menu_title_typography',
|
||||
'selector' => '{{WRAPPER}} .title',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Icon]
|
||||
$this->start_controls_section(
|
||||
'Icon_section',
|
||||
[
|
||||
'label' => __( 'Icon', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Icon Size
|
||||
$this->add_control(
|
||||
'size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 15,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .icon i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .icon svg' => 'height: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Icon Color
|
||||
$this->add_control(
|
||||
'icon_color', [
|
||||
'label' => __( 'Icon Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .icon i' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
?>
|
||||
<div class="eth-contact-info">
|
||||
<ul>
|
||||
|
||||
<?php
|
||||
|
||||
foreach ( $settings['contact'] as $item ) :
|
||||
|
||||
if ( ! empty( $item['link']['url'] ) ) {
|
||||
$this->add_link_attributes( 'link', $item['link'] );
|
||||
}
|
||||
|
||||
?>
|
||||
<li>
|
||||
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo '<a ' .$this->get_render_attribute_string( 'link' ).'>' ?>
|
||||
|
||||
<span class="icon"><?php \Elementor\Icons_Manager::render_icon( $item['icon'], [ 'aria-hidden' => 'true' ] ); ?></span>
|
||||
<span class="title"><?php echo esc_html( $item['title'] ) ?></span>
|
||||
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo '</a>' ?>
|
||||
|
||||
</li>
|
||||
<?php
|
||||
|
||||
$this->remove_render_attribute( 'link' );
|
||||
|
||||
endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,508 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Gallery
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_GALLERY extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_gallery';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Gallery', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'core-js', 'core-css' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Data', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Items to Display
|
||||
$this->add_control(
|
||||
'items',
|
||||
[
|
||||
'label' => __( 'Items', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '10',
|
||||
]
|
||||
);
|
||||
|
||||
// Order By
|
||||
$this->add_control(
|
||||
'order_by',
|
||||
[
|
||||
'label' => __( 'Order By', 'plugin-domain' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'ID',
|
||||
'options' => [
|
||||
'none' => __( 'None', 'eagle' ),
|
||||
'ID' => __( 'ID', 'eagle' ),
|
||||
'title' => __( 'Title', 'eagle' ),
|
||||
'date' => __( 'Date', 'eagle' ),
|
||||
'rand' => __( 'Random', 'eagle' ),
|
||||
'menu_order' => __( 'Menu Order', 'eagle' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Order
|
||||
$this->add_control(
|
||||
'order',
|
||||
[
|
||||
'label' => __( 'Order', 'plugin-domain' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'ASC',
|
||||
'options' => [
|
||||
'ASC' => __( 'ASC', 'eagle' ),
|
||||
'DESC' => __( 'DESC', 'eagle' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Offset
|
||||
$this->add_control(
|
||||
'offset',
|
||||
[
|
||||
'label' => __( 'Offset', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// New Section [Layout]
|
||||
$this->start_controls_section(
|
||||
'layout_section',
|
||||
[
|
||||
'label' => __( 'Layout', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
// Style
|
||||
$this->add_control(
|
||||
'style',
|
||||
[
|
||||
'label' => __( 'Style', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'grid',
|
||||
'options' => [
|
||||
'grid' => __( 'Grid', 'eagle' ),
|
||||
'carousel' => __( 'Carousel', 'eagle' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => __( 'Columns', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'options' => [
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6'
|
||||
],
|
||||
|
||||
'desktop_default' => '4',
|
||||
'tablet_default' => '3',
|
||||
'mobile_default' => '1',
|
||||
]
|
||||
);
|
||||
|
||||
// Filters
|
||||
$this->add_control(
|
||||
'filters',
|
||||
[
|
||||
'label' => __( 'Filters', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Show', 'eagle' ),
|
||||
'label_off' => __( 'Hide', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'style',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'grid',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'counter',
|
||||
[
|
||||
'label' => __( 'Counter', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
|
||||
'condition' => [
|
||||
'filters' => 'true',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Loop (Carousel)
|
||||
$this->add_control(
|
||||
'loop',
|
||||
[
|
||||
'label' => __( 'Loop', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'style',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'carousel',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Navigation (Carousel)
|
||||
$this->add_control(
|
||||
'navigation',
|
||||
[
|
||||
'label' => __( 'Navigation', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'style',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'carousel',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'lightbox',
|
||||
[
|
||||
'label' => __( 'Lightbox', 'eagle' ),
|
||||
'description' => __( 'Note: Make sure to disable Elementor Lightbox first.', 'eagle' ),
|
||||
'description' => esc_html__( 'Note: Make sure to disable Elementor Lightbox first.', 'eagle' ) . sprintf( ' <a href="%1$s" target="_blank">%2$s</a>', 'https://elementor.com/help/lightbox/', __( 'Learn more.', 'elementor' ) ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'Hide', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Filters on Style Tab]
|
||||
$this->start_controls_section(
|
||||
'filters_section',
|
||||
[
|
||||
'label' => __( 'Filters', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'filter_color', [
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .gallery-filters a' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'filter_active_color', [
|
||||
'label' => __( 'Active & Hover Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .gallery-filters a.active' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .gallery-filters a:hover' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'filter_typography',
|
||||
'selector' => '{{WRAPPER}} .gallery-filters a',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Title on Style Tab]
|
||||
$this->start_controls_section(
|
||||
'title_section',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_color', [
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .gallery-item figcaption' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .gallery-item figcaption',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Title on Style Tab]
|
||||
$this->start_controls_section(
|
||||
'image_section',
|
||||
[
|
||||
'label' => __( 'Image', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'background',
|
||||
'label' => __( 'Gradient Overlay', 'eagle' ),
|
||||
'types' => [ 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .gallery-item figure:after',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .gallery-item figure' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
// Elementor Responsive Bug: Set default columns
|
||||
$desktop_cols = !empty( $settings['columns'] ) ? $settings['columns'] : 4;
|
||||
$tablet_cols = !empty( $settings['columns_tablet'] ) ? $settings['columns_tablet'] : 3;
|
||||
$mobile_cols = !empty( $settings['columns_mobile'] ) ? $settings['columns_mobile'] : 1;
|
||||
|
||||
$eagle_query_args = array(
|
||||
'post_type' => 'eagle_gallery',
|
||||
'posts_per_page' => $settings['items'],
|
||||
'orderby' => $settings['order_by'],
|
||||
'order' => $settings['order'],
|
||||
'offset' => $settings['offset'],
|
||||
);
|
||||
|
||||
$eagle_gallery_query = new \WP_Query($eagle_query_args);
|
||||
$unique_token = wp_generate_password(5, false, false);
|
||||
|
||||
$class = '';
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( $settings['style'] === 'carousel' ) { ?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
jQuery(function($) {
|
||||
|
||||
var owl = $('#gallery-<?php echo esc_attr( $unique_token ) ?>');
|
||||
owl.owlCarousel({
|
||||
loop: <?php echo $settings['loop'] ? 'true' : 'false' ?>,
|
||||
margin: 30,
|
||||
nav: <?php echo $settings['navigation'] ? 'true' : 'false' ?>,
|
||||
dots: false,
|
||||
navText: [
|
||||
"<i class='ion-ios-arrow-back'></i>",
|
||||
"<i class='ion-ios-arrow-forward'></i>"
|
||||
],
|
||||
responsive: {
|
||||
|
||||
0: {
|
||||
items: <?php echo $mobile_cols ?>
|
||||
},
|
||||
|
||||
768: {
|
||||
items: <?php echo $tablet_cols ?>
|
||||
},
|
||||
|
||||
992: {
|
||||
items: <?php echo $desktop_cols ?>
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
$class .= 'owl-carousel';
|
||||
|
||||
} else {
|
||||
|
||||
$class .= 'row grid row-cols-lg-'. $desktop_cols.' '.'row-cols-md-'.$tablet_cols.' '.'row-cols-sm-'.$mobile_cols;
|
||||
|
||||
}
|
||||
|
||||
if ( $settings['lightbox'] == true ) $class .= ' lightbox-gallery';
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( $settings['style'] === 'grid' && $settings['filters'] == true ) : ?>
|
||||
|
||||
<div class="gallery-filters">
|
||||
<a href="#" data-filter="*" class="filter active"><?php echo esc_html__('All', 'eagle') ?> <?php if ( $settings['counter'] == true ) : ?> <span class="filter-count"></span> <?php endif ?></a>
|
||||
<?php
|
||||
|
||||
$terms = get_terms('eagle_gallery_category');
|
||||
|
||||
foreach ($terms as $term) {
|
||||
|
||||
?>
|
||||
|
||||
<a href="#" data-filter=".filter-<?php echo esc_attr($term->slug); ?>" class="filter"><?php echo esc_html( $term->name ); ?> <?php if ( $settings['counter'] == true ) : ?> <span class="filter-count"></span> <?php endif ?></a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
<div id="gallery-<?php echo esc_attr( $unique_token ) ?>" class="eth-gallery <?php echo esc_attr( $class ) ?>">
|
||||
|
||||
<?php
|
||||
|
||||
if ( $eagle_gallery_query->have_posts()): while ($eagle_gallery_query->have_posts()): $eagle_gallery_query->the_post();
|
||||
|
||||
// Defautls
|
||||
$eagle_gallery_title = get_the_title();
|
||||
$eagle_gallery_img = get_the_post_thumbnail_url();
|
||||
|
||||
// Gallery Grid (Isotope)
|
||||
$terms = get_the_terms(get_the_id(), 'eagle_gallery_category');
|
||||
$term_slug = array();
|
||||
$term_name = array();
|
||||
|
||||
if ( is_array($terms) || is_object($terms) ) {
|
||||
|
||||
foreach ($terms as $term) {
|
||||
$term_slug[] = $term->slug;
|
||||
$term_name[] = $term->name;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="gallery-item isotope-item gallery-item filter-<?php echo join( " ", $term_slug) ?> eth-lined-animation">
|
||||
<figure>
|
||||
<a href="<?php echo esc_url( $eagle_gallery_img ) ?>" data-title="<?php echo $eagle_gallery_title ?>">
|
||||
|
||||
<img src="<?php echo esc_url( $eagle_gallery_img ) ?>" alt="<?php echo esc_html( $eagle_gallery_title ) ?>">
|
||||
</a>
|
||||
<?php if ( $settings['title'] ) : ?><figcaption> <a href="<?php echo esc_url( $eagle_gallery_img ) ?>" class="title" data-title="<?php echo $eagle_gallery_title ?>"> <?php echo esc_html( $eagle_gallery_title ) ?> <span></span></a></figcaption> <?php endif ?>
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
525
wp-content/plugins/eagle-core/eagle-elementor/widgets/map.php
Normal file
525
wp-content/plugins/eagle-core/eagle-elementor/widgets/map.php
Normal file
@@ -0,0 +1,525 @@
|
||||
<?php
|
||||
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_MAP extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_map';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Map', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-google-maps';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'elementor-section-title' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Description
|
||||
$this->add_control(
|
||||
'description',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => \Elementor\Controls_Manager::WYSIWYG,
|
||||
'default' => esc_html__( 'Default description', 'eagle' ),
|
||||
'placeholder' => __( 'Type your description here', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Latitude
|
||||
$this->add_control(
|
||||
'latitude',
|
||||
[
|
||||
'label' => __( 'Map Latitude', 'eagle' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '39.7715865',
|
||||
]
|
||||
);
|
||||
|
||||
// Longitude
|
||||
$this->add_control(
|
||||
'longitude',
|
||||
[
|
||||
'label' => __( 'Map Longitude', 'eagle' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '19.997841',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'position_description',
|
||||
[
|
||||
'raw' => esc_html__( 'How to get Latitude and Longitude.', 'elementor' ) . sprintf( ' <a href="%1$s" target="_blank">%2$s</a>', 'https://support.google.com/maps/answer/18539', esc_html__( 'Learn more.', 'elementor' ) ),
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
|
||||
'render_type' => 'ui',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
// Pin
|
||||
$this->add_control(
|
||||
'pin',
|
||||
[
|
||||
'label' => __( 'Map Pin', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// New Section [Layout]
|
||||
$this->start_controls_section(
|
||||
'layout_section',
|
||||
[
|
||||
'label' => __( 'Layout', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
// Height
|
||||
$this->add_responsive_control(
|
||||
'height',
|
||||
[
|
||||
'label' => __( 'Map Height', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1200,
|
||||
'step' => 1,
|
||||
],
|
||||
|
||||
],
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'desktop_default' => [
|
||||
'size' => 300,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'size' => 20,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'size' => 10,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-google-map .inner-map' => 'height: {{SIZE}}px;',
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 300,
|
||||
],
|
||||
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Zoom
|
||||
$this->add_control(
|
||||
'zoom',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 20,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 14,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
//Border
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'border',
|
||||
'label' => esc_html__( 'Border', 'eagle' ),
|
||||
'selector' =>'{{WRAPPER}} .eth-google-map','.eth-google-map .inner-map',
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Border Radius
|
||||
$this->add_control(
|
||||
'border_radius', [
|
||||
'label' => __( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-google-map' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
'{{WRAPPER}} .eth-google-map .inner-map' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
'default' => [
|
||||
'top' => '180',
|
||||
'right' => '180',
|
||||
'bottom' => '180',
|
||||
'left' => '180',
|
||||
'isLinked' => false,
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
//Shadow
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'box_shadow',
|
||||
'label' => esc_html__( 'Box Shadow', 'eagle' ),
|
||||
'selector' => '{{WRAPPER}} .eth-google-map',
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [StreetView]
|
||||
$this->start_controls_section(
|
||||
'streetview_style',
|
||||
[
|
||||
'label' => __( 'Street View', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Street View
|
||||
$this->add_responsive_control(
|
||||
'streetview',
|
||||
[
|
||||
'label' => __( 'StreetView Button', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Show', 'eagle' ),
|
||||
'label_off' => __( 'Hide', 'eagle' ),
|
||||
'return_value' => 'none',
|
||||
'default' => 'Show',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .toggle-streetview' => 'display: {{VALUE}}',
|
||||
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// StreetView Color
|
||||
$this->add_control(
|
||||
'streetview_color', [
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .toggle-streetview' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// StreetView Icon Color
|
||||
$this->add_control(
|
||||
'streetview_icon_color', [
|
||||
'label' => __( 'Icon Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-google-map .toggle-streetview i' => 'color: {{VALUE}}; ',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// StreetView Position Vertical
|
||||
$this->add_responsive_control(
|
||||
'streetview_position_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Button Position Vertical', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1200,
|
||||
'step' => 1,
|
||||
],
|
||||
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
|
||||
],
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'desktop_default' => [
|
||||
'size' => 30,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'size' => 20,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'size' => 10,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .toggle-streetview' => 'top: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
//StreetView Position Horizontal
|
||||
$this->add_responsive_control(
|
||||
'streetview_position_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Button Position Horizontal', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%'],
|
||||
'range' => [
|
||||
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1200,
|
||||
'step' => 1,
|
||||
],
|
||||
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
|
||||
],
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'desktop_default' => [
|
||||
'size' => 30,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'size' => 20,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'size' => 10,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .toggle-streetview' => 'left: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
$eagle_token = wp_generate_password(5, false, false);
|
||||
|
||||
// If no Google Map API Key don't render
|
||||
if ( empty( himara_get_option('google_map_api_key') ) ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
jQuery(function($) {
|
||||
|
||||
|
||||
|
||||
// GOOGLE MAP
|
||||
// =============================================
|
||||
function initialize() {
|
||||
var map;
|
||||
var panorama;
|
||||
var var_latitude = <?php echo $settings[ 'latitude' ] ?>; // Google Map Latitude
|
||||
var var_longitude = <?php echo $settings[ 'longitude' ] ?>; // Google Map Longitude
|
||||
var pin = '<?php echo $settings['pin']['url']?>';
|
||||
|
||||
//Map pin-window details
|
||||
var hotel_desc = '<?php echo $settings[ 'description' ] ?>';
|
||||
var title = '<?php echo get_bloginfo('name') ?>';
|
||||
|
||||
|
||||
var hotel_location = new google.maps.LatLng(var_latitude, var_longitude);
|
||||
var mapOptions = {
|
||||
center: hotel_location,
|
||||
zoom: <?php echo $settings['zoom']['size'] ?>,
|
||||
scrollwheel: false,
|
||||
streetViewControl: false,
|
||||
styles: [{
|
||||
"featureType": "administrative",
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [{
|
||||
"color": "#444444"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "landscape",
|
||||
"elementType": "all",
|
||||
"stylers": [{
|
||||
"color": "#f5f5f5"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "poi",
|
||||
"elementType": "all",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road",
|
||||
"elementType": "all",
|
||||
"stylers": [{
|
||||
"saturation": -100
|
||||
}, {
|
||||
"lightness": 45
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road.highway",
|
||||
"elementType": "all",
|
||||
"stylers": [{
|
||||
"visibility": "simplified"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road.arterial",
|
||||
"elementType": "labels.icon",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "transit",
|
||||
"elementType": "all",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "water",
|
||||
"elementType": "all",
|
||||
"stylers": [{
|
||||
"color": "#1dc1f8"
|
||||
}, {
|
||||
"visibility": "on"
|
||||
}]
|
||||
}]
|
||||
};
|
||||
|
||||
map = new google.maps.Map(document.getElementById('map-canvas-<?php echo $eagle_token ?>'), mapOptions);
|
||||
|
||||
var contentString =
|
||||
'<div id="infowindow_content">' + hotel_desc + '</div>';
|
||||
|
||||
var var_infowindow = new google.maps.InfoWindow({
|
||||
content: contentString
|
||||
});
|
||||
var marker = new google.maps.Marker({
|
||||
position: hotel_location,
|
||||
map: map,
|
||||
icon: pin,
|
||||
title: title,
|
||||
maxWidth: 500,
|
||||
optimized: false,
|
||||
});
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
var_infowindow.open(map, marker);
|
||||
});
|
||||
panorama = map.getStreetView();
|
||||
panorama.setPosition(hotel_location);
|
||||
panorama.setPov( /** @type {google.maps.StreetViewPov} */ ({
|
||||
heading: 265,
|
||||
pitch: 0
|
||||
}));
|
||||
<?php if( $settings['streetview'] == true) : ?>
|
||||
var openStreet = document.getElementById('openStreetView');
|
||||
if (openStreet) {
|
||||
document.getElementById("openStreetView").onclick = function() {
|
||||
toggleStreetView()
|
||||
};
|
||||
}
|
||||
|
||||
function toggleStreetView() {
|
||||
var toggle = panorama.getVisible();
|
||||
if (toggle == false) {
|
||||
panorama.setVisible(true);
|
||||
} else {
|
||||
panorama.setVisible(false);
|
||||
}
|
||||
}
|
||||
<?php endif ?>
|
||||
}
|
||||
//Check if google map exist
|
||||
if ($("#map-canvas-<?php echo $eagle_token ?>").length) {
|
||||
|
||||
// google.maps.event.addDomListener(window, 'load', initialize());
|
||||
addEventListener("load", initialize, false);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="eth-google-map">
|
||||
<div id="map-canvas-<?php echo $eagle_token ?>" class="inner-map"></div>
|
||||
<div class="toggle-streetview" id="openStreetView">
|
||||
<i class="fa fa-street-view" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
354
wp-content/plugins/eagle-core/eagle-elementor/widgets/news.php
Normal file
354
wp-content/plugins/eagle-core/eagle-elementor/widgets/news.php
Normal file
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor News Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_NEWS extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_news';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle News', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-document-file';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to. */
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/* Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'elementor-themes' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Settings', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'style',
|
||||
[
|
||||
'label' => __( 'Style', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'style-1' => __( 'Style 1', 'eagle' ),
|
||||
'style-2' => __( 'Style 2', 'eagle' ),
|
||||
'style-3' => __( 'Style 3', 'eagle' ),
|
||||
],
|
||||
'default' => 'style-1',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'order_by',
|
||||
[
|
||||
'label' => __( 'Order By', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'date' => __( 'Date', 'eagle' ),
|
||||
'id' => __( 'ID', 'eagle' ),
|
||||
'author' => __( 'Author', 'eagle' ),
|
||||
'title' => __( 'Title', 'eagle' ),
|
||||
'name' => __( 'Title', 'eagle' ),
|
||||
'rand' => __( 'Random', 'eagle' ),
|
||||
],
|
||||
'default' => 'date',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'order',
|
||||
[
|
||||
'label' => __( 'Order', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'asc' => __( 'Ascending', 'eagle' ),
|
||||
'desc' => __( 'Descending', 'eagle' ),
|
||||
],
|
||||
'default' => 'asc',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'items',
|
||||
[
|
||||
'label' => __( 'Items to Display', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '3',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_responsive_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => __( 'Columns', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'options' => [
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6'
|
||||
],
|
||||
|
||||
|
||||
|
||||
'desktop_default' => '3',
|
||||
'tablet_default' => '2',
|
||||
'mobile_default' => '1',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'offset',
|
||||
[
|
||||
'label' => __( 'Offset', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '0',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'meta',
|
||||
[
|
||||
'label' => __( 'Meta', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'eagle' ),
|
||||
'label_off' => esc_html__( 'Hide', 'eagle' ),
|
||||
'return_value' => 'yes',
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'characters_limit',
|
||||
[
|
||||
'label' => __( 'Characters Limit', 'eagle' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => '100',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// New Section [Tab]
|
||||
$this->start_controls_section(
|
||||
'title_section',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .post-title a' => 'color: {{VALUE}}',
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Title Typography', 'eagle' ),
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .post-title',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'meta_section',
|
||||
[
|
||||
'label' => esc_html__( 'Meta', 'eagle' ),
|
||||
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'meta_color',
|
||||
[
|
||||
'label' => esc_html__( 'Meta Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .post-meta' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .post-meta a' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Meta Typography', 'eagle' ),
|
||||
'name' => 'meta_typography',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section(
|
||||
'content_section',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'eagle' ),
|
||||
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Content Color', 'plugin-name' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .post-content p' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'body_text_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Content Typography', 'eagle' ),
|
||||
'name' => 'content_typography',
|
||||
'selector' => '{{WRAPPER}} .post-content p'
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
// QRY
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => $settings['items'],
|
||||
'orderby' => $settings['order_by'],
|
||||
'order' => $settings['order'],
|
||||
'offset' => $settings['offset']
|
||||
);
|
||||
|
||||
$news_qry = new \WP_Query($args);
|
||||
|
||||
?>
|
||||
|
||||
<div class="himara-news <?php echo esc_attr( $settings['style'] ) ?>">
|
||||
|
||||
<div class="row <?php echo esc_attr( 'row-cols-lg-'.$settings['columns'].' '.'row-cols-md-'.$settings['columns_tablet'].' '.'row-cols-sm-'.$settings['columns_mobile'] ) ?>">
|
||||
|
||||
<?php
|
||||
if ($news_qry->have_posts()): while ($news_qry->have_posts()): $news_qry->the_post();
|
||||
|
||||
$eagle_news_title = get_the_title();
|
||||
$eagle_news_url = get_permalink();
|
||||
$eagle_news_thumbnail_url = get_the_post_thumbnail_url();
|
||||
$post_author = get_the_author_meta('display_name');
|
||||
$post_author_id = get_the_author_meta('ID');
|
||||
$post_author_gravatar = get_avatar_url($post_author_id, array('size' => 14));
|
||||
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post-item post-grid-item');?>>
|
||||
|
||||
<figure class="post-thumbnail">
|
||||
<a href="<?php echo esc_url( $eagle_news_url ) ?>">
|
||||
<img src="<?php echo esc_url( $eagle_news_thumbnail_url ) ?>" class="img-fluid" alt="<?php echo esc_html( $eagle_news_title ) ?>">
|
||||
</a>
|
||||
</figure>
|
||||
|
||||
<div class="post-details ">
|
||||
|
||||
<h2 class="post-title">
|
||||
<a href="<?php echo esc_url( $eagle_news_url ) ?>"><?php echo esc_html( $eagle_news_title ) ?></a>
|
||||
</h2>
|
||||
|
||||
|
||||
<?php if ( $settings['meta'] === 'yes' ) : ?>
|
||||
<div class="post-meta">
|
||||
|
||||
<?php echo __('By', 'eagle') ?> <?php echo '<a href="'.esc_url( get_author_posts_url( get_the_author_meta( 'ID', $post_author_id ) ) ).'">'.get_the_author_meta( 'display_name', $post_author_id ).'</a>,' ?>
|
||||
<?php echo __('on', 'eagle') ?> <?php echo strtolower( get_the_date() ) ?>, </span>
|
||||
|
||||
<?php $cats = get_the_category( ', ' ); ?>
|
||||
|
||||
<?php if ( !empty($cats)) : ?>
|
||||
|
||||
in <?php echo wp_kses_post( strtolower( $cats[0] ) ) ?> category
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="post-content">
|
||||
<?php echo himara_get_excerpt( $settings['characters_limit'] ); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
<?php endwhile; endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
/* Live Render */
|
||||
protected function content_template() {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_RESTAURNAT_MENU extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_restaurant_menu';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Restaurant Menu', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-menu-bar';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'core' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new \Elementor\Repeater();
|
||||
|
||||
// Title
|
||||
$repeater->add_control(
|
||||
'title', [
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => __( 'Service Title' , 'eagle' ),
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
// Price
|
||||
$repeater->add_control(
|
||||
'price', [
|
||||
'label' => __( 'Price', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
// Desc
|
||||
$repeater->add_control(
|
||||
'description',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'rows' => 10,
|
||||
'default' => __( 'Default description', 'eagle' ),
|
||||
'placeholder' => __( 'Type your description here', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Image
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => __( 'Image', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$repeater->add_group_control(
|
||||
\Elementor\Group_Control_Image_Size::get_type(),
|
||||
[
|
||||
'name' => 'menu_image_size',
|
||||
'exclude' => [],
|
||||
'include' => [],
|
||||
'default' => 'thumbnail',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::URL,
|
||||
'placeholder' => __( 'https://your-link.com', 'eagle' ),
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => false,
|
||||
'nofollow' => false,
|
||||
'custom_attributes' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'menu',
|
||||
[
|
||||
'label' => __( 'Items', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => __( 'Item #1', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => __( 'Item #2', 'eagle' ),
|
||||
],
|
||||
],
|
||||
'title_field' => '{{{ title }}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
|
||||
|
||||
// New Section [Layout]
|
||||
$this->start_controls_section(
|
||||
'layout_section',
|
||||
[
|
||||
'label' => __( 'Layout', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => __( 'Columns', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'options' => [
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6'
|
||||
],
|
||||
|
||||
'desktop_default' => '2',
|
||||
'tablet_default' => '2',
|
||||
'mobile_default' => '1',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'background',
|
||||
'label' => esc_html__( 'Background', 'eagle' ),
|
||||
'types' => [ 'classic', 'gradient', 'video' ],
|
||||
'selector' => '{{WRAPPER}} .restaurant-menu-item .inner',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'border',
|
||||
'label' => esc_html__( 'Border', 'eagle' ),
|
||||
'selector' => '{{WRAPPER}} .restaurant-menu-item .inner',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$this->add_responsive_control(
|
||||
'border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .restaurant-menu-item .inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_responsive_control(
|
||||
'img_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Image Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'allowed_dimensions' => ['top', 'left'],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .restaurant-menu-item .inner figure img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Info Padding
|
||||
$this->add_responsive_control(
|
||||
'info_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Info Spacing', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .restaurant-menu-item .inner .info' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Vertical Spacing
|
||||
$this->add_control(
|
||||
'menu_vertical_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Menu Veritcal Spacing', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 30,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-restaurant-menu' => 'column-gap: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Horizontal Spacing
|
||||
$this->add_control(
|
||||
'menu_horizontal_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Menu Horizontal Spacing', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 30,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-restaurant-menu' => 'row-gap: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// New Section [Title]
|
||||
$this->start_controls_section(
|
||||
'title_section',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Title Color
|
||||
$this->add_control(
|
||||
'title_color', [
|
||||
'label' => __( 'Title Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .restaurant-menu-item .title' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Title Typography', 'eagle' ),
|
||||
'name' => 'menu_title_typography',
|
||||
'selector' => '{{WRAPPER}} .title',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Price]
|
||||
$this->start_controls_section(
|
||||
'price_section',
|
||||
[
|
||||
'label' => __( 'Price', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Price Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Price Typography', 'eagle' ),
|
||||
'name' => 'menu_price_typography',
|
||||
'selector' => '{{WRAPPER}} .restaurant-menu-item .price',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
// Price Color
|
||||
$this->add_control(
|
||||
'price_color', [
|
||||
'label' => __( 'Price Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .restaurant-menu-item .price' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Description]
|
||||
$this->start_controls_section(
|
||||
'description_section',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Description Color
|
||||
$this->add_control(
|
||||
'description_color', [
|
||||
'label' => __( 'Description Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .restaurant-menu-item .content' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'body_text_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Description Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Description Typography', 'eagle' ),
|
||||
'name' => 'menu_desc_typography',
|
||||
'selector' => '{{WRAPPER}} .restaurant-menu-item .content',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
// Elementor Responsive Bug: Set default columns
|
||||
$desktop_cols = !empty( $settings['columns'] ) ? $settings['columns'] : 2;
|
||||
$tablet_cols = !empty( $settings['columns_tablet'] ) ? $settings['columns_tablet'] : 2;
|
||||
$mobile_cols = !empty( $settings['columns_mobile'] ) ? $settings['columns_mobile'] : 1;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr( 'eb-g-lg-'.$desktop_cols.' '.'eb-g-md-'.$tablet_cols.' '.'eb-g-sm-'.$mobile_cols ) ?> eth-restaurant-menu">
|
||||
|
||||
<?php
|
||||
|
||||
foreach ( $settings['menu'] as $item ) :
|
||||
|
||||
if ( ! empty( $item['link']['url'] ) ) {
|
||||
$this->add_link_attributes( 'link', $item['link'] );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="restaurant-menu-item">
|
||||
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo '<a ' .$this->get_render_attribute_string( 'link' ).'>' ?>
|
||||
|
||||
<div class="inner">
|
||||
|
||||
<figure>
|
||||
<?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $item, 'image_size', 'image' ) ?>
|
||||
</figure>
|
||||
|
||||
<div class="info">
|
||||
<div class="meta">
|
||||
<span class="title"><?php echo esc_html( $item['title'] ) ?></span>
|
||||
<span class="price"><?php echo esc_html( $item['price'] ) ?></span>
|
||||
</div>
|
||||
<p class="content"><?php echo esc_html( $item['description'] ) ?></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo '</a>' ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$this->remove_render_attribute( 'link' );
|
||||
|
||||
endforeach ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Update background control and add Parallax Option
|
||||
add_action( 'elementor/element/section/section_background/before_section_end', function( $control_stack, $args ) {
|
||||
|
||||
// Get existing control
|
||||
$control = \Elementor\Plugin::instance()->controls_manager->get_control_from_stack( $control_stack->get_unique_name(), 'background_attachment' );
|
||||
|
||||
// Add new option
|
||||
$control['options']['parallax'] = __( 'Parallax' );
|
||||
|
||||
// Update the control
|
||||
$control_stack->update_control( 'background_attachment', $control );
|
||||
|
||||
// Parallax Speed
|
||||
$control_stack->add_control(
|
||||
'parallax_speed', [
|
||||
'label' => __( 'Parallax Speed', 'eagle' ),
|
||||
'description' => __( 'Note: The Parallax Live Preview is not working.', 'eagle' ),
|
||||
|
||||
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
|
||||
'default' => [
|
||||
|
||||
'size' => .5,
|
||||
],
|
||||
|
||||
|
||||
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'step' => 0.01,
|
||||
],
|
||||
],
|
||||
|
||||
'label_block' => true,
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'background_attachment',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'parallax',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
}, 10, 2 );
|
||||
|
||||
|
||||
// Override Section Render
|
||||
function eth_change_section_content( $widget_content, $element ) {
|
||||
|
||||
// add_filter('elementor/frontend/section/should_render', function( $widget_content, $widget ) {
|
||||
|
||||
// $content = ob_get_clean();
|
||||
|
||||
|
||||
// if ( 'heading' === $widget->get_name() ) {
|
||||
|
||||
|
||||
$settings = $element->get_settings();
|
||||
|
||||
|
||||
// echo var_dump($settings);
|
||||
|
||||
|
||||
if( $settings['background_attachment'] === 'parallax' ) {
|
||||
|
||||
// $element->add_render_attribute( 'testimonial_content', 'class', $settings['background_attachment'], true );
|
||||
|
||||
// echo "hello";
|
||||
|
||||
// echo var_dump( $settings['parallax_speed'] );
|
||||
|
||||
$element->add_render_attribute( '_wrapper', 'class', 'elementor-eth-parallax' );
|
||||
|
||||
$element->add_render_attribute( '_wrapper', 'data-src', $settings['background_image']['url'] );
|
||||
|
||||
$element->add_render_attribute( '_wrapper', 'data-parallax', 'scroll' );
|
||||
|
||||
$element->add_render_attribute( '_wrapper', 'data-speed', $settings['parallax_speed']['size'] );
|
||||
|
||||
$element->add_render_attribute( '_wrapper', 'data-z-index', '0' );
|
||||
|
||||
$element->add_render_attribute( '_wrapper', 'style', 'background-color: transparent; background-image: unset; ' );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// $element->add_render_attribute(
|
||||
// '_wrapper',
|
||||
// 'class', [
|
||||
// 'elementor-section',
|
||||
// 'elementor-eth-parallax',
|
||||
// ]
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// $settings = $widget->get_settings();
|
||||
|
||||
// if ( $settings['background_attachment'] === 'parallax' ) {
|
||||
|
||||
// $widget_content = "This is an parallax section";
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//}
|
||||
|
||||
return $widget_content;
|
||||
|
||||
}
|
||||
|
||||
|
||||
add_filter('elementor/frontend/section/should_render', 'eth_change_section_content', 10, 2 );
|
||||
@@ -0,0 +1,706 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* @since 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_SERVICES extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_services';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Services', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-settings';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'elementor-section-title' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new \Elementor\Repeater();
|
||||
|
||||
// Title
|
||||
$repeater->add_control(
|
||||
'title', [
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => __( 'Service Title' , 'eagle' ),
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
// Description
|
||||
$repeater->add_control(
|
||||
'description',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'rows' => 10,
|
||||
'default' => __( 'Default description', 'eagle' ),
|
||||
'placeholder' => __( 'Type your description here', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Image
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => __( 'Image', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
// Icon
|
||||
$repeater->add_control(
|
||||
'icon',
|
||||
[
|
||||
'label' => __( 'Icon', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
// Active Icon
|
||||
$repeater->add_control(
|
||||
'active_icon',
|
||||
[
|
||||
'label' => __( 'Active Icon', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
//Link
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::URL,
|
||||
'placeholder' => __( 'https://your-link.com', 'eagle' ),
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => false,
|
||||
'nofollow' => false,
|
||||
'custom_attributes' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->add_control(
|
||||
'services',
|
||||
[
|
||||
'label' => __( 'Slides', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => __( 'Slide #1', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => __( 'Slide #2', 'eagle' ),
|
||||
],
|
||||
],
|
||||
'title_field' => '{{{ title }}}',
|
||||
]
|
||||
);
|
||||
|
||||
// Autoplay
|
||||
$this->add_control(
|
||||
'autoplay',
|
||||
[
|
||||
'label' => __( 'Autoplay', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'On', 'eagle' ),
|
||||
'label_off' => __( 'Off', 'eagle' ),
|
||||
'return_value' => true,
|
||||
'default' => true,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// Style Section
|
||||
$this->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => __( 'Style', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Style
|
||||
$this->add_control(
|
||||
'style',
|
||||
[
|
||||
'label' => __( 'Style', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'normal',
|
||||
'options' => [
|
||||
'normal' => __( 'Normal', 'eagle' ),
|
||||
'on_image' => __( 'On Image', 'eagle' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Image Border Radius
|
||||
$this->add_control(
|
||||
'border_radius_services',
|
||||
[
|
||||
'label' => __( 'Services Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Box Shadow
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'label' => __( 'Box Shadow', 'eagle' ),
|
||||
'name' => 'box_shadow',
|
||||
'selector' => '{{WRAPPER}} .owl-thumb-item'
|
||||
]
|
||||
);
|
||||
|
||||
// Items Spacing
|
||||
$this->add_control(
|
||||
'spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Services Spacing', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 17,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .owl-thumb-item:last-child' => 'margin-bottom: 0',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Section Title
|
||||
$this->start_controls_section(
|
||||
'section_title',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Title Alignment
|
||||
$this->add_control(
|
||||
'title_align',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'eagle' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'eagle' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'eagle' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'left',
|
||||
'toggle' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item .details h5' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'title_typography',
|
||||
|
||||
'selector' => '{{WRAPPER}} .owl-thumb-item .details h5'
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
// Title Color
|
||||
$this->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item .details h5' => 'color: {{VALUE}}',
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
// Title Color Active
|
||||
$this->add_control(
|
||||
'title_color_active',
|
||||
[
|
||||
'label' => __( 'Color Active', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item.active .details h5' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item.active .details h5' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// Section Description
|
||||
$this->start_controls_section(
|
||||
'section_desc',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Title Alignment
|
||||
$this->add_control(
|
||||
'desc_align',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'eagle' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'eagle' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'eagle' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'default' => 'left',
|
||||
'toggle' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item .details p' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Description Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'desc_typography',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .services .owl-thumb-item.active .details p',
|
||||
'{{WRAPPER}} .services .owl-thumb-item .details p',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item.active .details p',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item .details p',
|
||||
],
|
||||
|
||||
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
// Description Color
|
||||
$this->add_control(
|
||||
'desc_color',
|
||||
[
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item .details p' => 'color: {{VALUE}}',
|
||||
],
|
||||
'default' => himara_get_option( 'body_text_color' ),
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Description Color Active
|
||||
$this->add_control(
|
||||
'desc_color_active',
|
||||
[
|
||||
'label' => __( 'Color Active', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item.active .details p' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item.active .details p' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// Section Background
|
||||
$this->start_controls_section(
|
||||
'section_background',
|
||||
[
|
||||
'label' => __( 'Background', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Background Color
|
||||
$this->add_control(
|
||||
'background',
|
||||
[
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item ' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item ' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Background Color Active
|
||||
$this->add_control(
|
||||
'background_active',
|
||||
[
|
||||
'label' => __( 'Color Active', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item.active ' => 'background-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item.active ' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Background Border Color
|
||||
$this->add_control(
|
||||
'background_border',
|
||||
[
|
||||
'label' => __( 'Border Color ', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item' => 'border-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item' => 'border-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
// Background Border Color Active
|
||||
$this->add_control(
|
||||
'background_border_active',
|
||||
[
|
||||
'label' => __( 'Border Color Active', 'eagle' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-thumb-item.active' => 'border-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .services-v2 .owl-thumb-item.active' => 'border-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Section Image
|
||||
$this->start_controls_section(
|
||||
'section_img',
|
||||
[
|
||||
'label' => __( 'Image', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Image Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Title Typography', 'eagle' ),
|
||||
'name' => 'img_title_typography',
|
||||
'selector' => '{{WRAPPER}} .gradient-overlay h4'
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
// Image Title Color
|
||||
$this->add_control(
|
||||
'img_title_color',
|
||||
[
|
||||
'label' => __( 'Title Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .gradient-overlay h4' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Image Border Radius
|
||||
$this->add_control(
|
||||
'img_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .owl-carousel .owl-stage-outer' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'img_background_overlay',
|
||||
'label' => __( 'Gradient Overlay', 'eagle' ),
|
||||
'types' => [ 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .gradient-overlay:after',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'label' => __( 'Title Gradient Overlay', 'eagle' ),
|
||||
'name' => 'img_title_background',
|
||||
'types' => [ 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .services figcaption',
|
||||
'selector' => '{{WRAPPER}} .services-v2 figcaption',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
$eagle_token = wp_generate_password(5, false, false);
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
jQuery(function($) {
|
||||
// =============================================
|
||||
// SERVICES - OWL CAROUSEL
|
||||
// =============================================
|
||||
var owl = $('#services-<?php echo esc_html( $eagle_token ) ?>');
|
||||
owl.owlCarousel({
|
||||
thumbs: true,
|
||||
thumbsPrerendered: true,
|
||||
items: 1,
|
||||
animateOut: 'fadeOut',
|
||||
animateIn: 'fadeIn',
|
||||
loop: true,
|
||||
autoplay: <?php echo $settings['autoplay'] ? 'true' : 'false'?>,
|
||||
dots: false,
|
||||
nav: false,
|
||||
mouseDrag: false,
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<?php if ($settings['style'] === 'normal') : ?>
|
||||
|
||||
<div class="services services-<?php echo esc_attr( $eagle_token ) ?>">
|
||||
<div class="row">
|
||||
<div class="col-lg-7 col-12">
|
||||
<div id="services-<?php echo esc_html( $eagle_token ) ?>" data-slider-id="services-<?php echo esc_html( $eagle_token ) ?>" class="owl-carousel">
|
||||
<?php if ( $settings['services'] ) : ?>
|
||||
<?php foreach ( $settings['services'] as $item ) : ?>
|
||||
<!-- ITEM -->
|
||||
<?php
|
||||
|
||||
if ( ! empty( $item['link']['url'] ) ) {
|
||||
$this->add_link_attributes( 'link', $item['link'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $item['link']['url'] ) ) echo '<a ' .$this->get_render_attribute_string( 'link' ).'>'
|
||||
|
||||
?>
|
||||
<figure class="gradient-overlay">
|
||||
<img src="<?php echo esc_url( $item['image']['url'] ) ?>" class="img-fluid" alt="<?php echo esc_attr( $item['image']['alt'] ) ?>" >
|
||||
<figcaption>
|
||||
<h4><?php echo esc_html( $item['title'] ) ?></h4>
|
||||
</figcaption>
|
||||
</figure>
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo '</a>'?>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5 col-12">
|
||||
<div class="owl-thumbs" data-slider-id="services-<?php echo esc_html( $eagle_token ) ?>">
|
||||
<?php if ( $settings['services'] ) : ?>
|
||||
<?php foreach ( $settings['services'] as $item ) :
|
||||
|
||||
|
||||
if ( !empty( $item['active_icon']['url'] ) ) {
|
||||
|
||||
$active_icon_url = $item['active_icon']['url'];
|
||||
|
||||
} else {
|
||||
|
||||
$active_icon_url = $item['icon']['url'];
|
||||
|
||||
}
|
||||
|
||||
if ( !empty( $item['active_icon']['alt'] ) ) {
|
||||
|
||||
$active_icon_alt = $item['active_icon']['alt'];
|
||||
|
||||
} else {
|
||||
|
||||
$active_icon_alt = $item['icon']['alt'];
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="owl-thumb-item">
|
||||
<span class="icon">
|
||||
<img src="<?php echo esc_url($item['icon']['url']) ?>" alt="<?php echo esc_attr( $item['icon']['alt'] ) ?>" class="icon-normal">
|
||||
<img src="<?php echo esc_url( $active_icon_url ) ?>" alt="<?php echo esc_attr( $active_icon_alt ) ?>" class="icon-active">
|
||||
</span>
|
||||
<div class="details">
|
||||
<h5><?php echo esc_html( $item['title'] ) ?></h5>
|
||||
<p><?php echo esc_html( $item['description'] ) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="services-v2 services-<?php echo esc_attr( $eagle_token ) ?>">
|
||||
<!-- MAIN IMAGE -->
|
||||
<div id="services-<?php echo esc_html( $eagle_token ) ?>" data-slider-id="services-<?php echo esc_html( $eagle_token ) ?>" class="main-image services-v2-owl owl-carousel">
|
||||
<?php if ( $settings['services'] ) : ?>
|
||||
<?php foreach ( $settings['services'] as $item ) : ?>
|
||||
<!-- ITEM -->
|
||||
<figure class="gradient-overlay">
|
||||
<img src="<?php echo esc_url( $item['image']['url'] ) ?>" class="img-fluid" alt="<?php echo esc_attr( $item['image']['alt'] ) ?>">
|
||||
<figcaption>
|
||||
<h4><?php echo esc_html( $item['title'] ) ?></h4>
|
||||
</figcaption>
|
||||
</figure>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<!-- THUMBS -->
|
||||
<div class="owl-thumbs" data-slider-id="services-<?php echo esc_html( $eagle_token ) ?>">
|
||||
<?php if ( $settings['services'] ) : ?>
|
||||
<?php foreach ( $settings['services'] as $item ) :
|
||||
|
||||
if ( !empty( $item['active_icon']['url'] ) ) {
|
||||
|
||||
$active_icon_url = $item['active_icon']['url'];
|
||||
|
||||
} else {
|
||||
|
||||
$active_icon_url = $item['icon']['url'];
|
||||
|
||||
}
|
||||
|
||||
if ( !empty( $active_icon_alt ) ) {
|
||||
|
||||
$active_icon_url = $item['active_icon']['alt'];
|
||||
|
||||
} else {
|
||||
|
||||
$active_icon_alt = $item['icon']['alt'];
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<!-- THUMBNAIL -->
|
||||
<div class="owl-thumb-item">
|
||||
<div class="inner">
|
||||
<span class="icon">
|
||||
<img src="<?php echo esc_url($item['icon']['url']) ?>" alt="<?php echo esc_attr( $item['icon']['alt'] ) ?>" class="icon-normal">
|
||||
<img src="<?php echo esc_url( $active_icon_url ) ?>" alt="<?php echo esc_attr( $active_icon_alt ) ?>" class="icon-active">
|
||||
</span>
|
||||
<div class="details">
|
||||
<h5><?php echo esc_html( $item['title'] ) ?></h5>
|
||||
<p><?php echo esc_html( $item['description'] ) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
338
wp-content/plugins/eagle-core/eagle-elementor/widgets/social.php
Normal file
338
wp-content/plugins/eagle-core/eagle-elementor/widgets/social.php
Normal file
@@ -0,0 +1,338 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_SOCIAL extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_social';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Social Media', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-social-icons';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'core' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new \Elementor\Repeater();
|
||||
|
||||
//Icon
|
||||
$repeater->add_control(
|
||||
'icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-star',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
//Icon
|
||||
$repeater->add_control(
|
||||
'social_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Social Title ', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
]
|
||||
);
|
||||
|
||||
//Link
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::URL,
|
||||
'placeholder' => __( 'https://your-link.com', 'eagle' ),
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => false,
|
||||
'nofollow' => false,
|
||||
'custom_attributes' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'social',
|
||||
[
|
||||
'label' => __( 'Social Media', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => __( 'Social #1', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => __( 'Social #2', 'eagle' ),
|
||||
],
|
||||
],
|
||||
'title_field' => '{{{ social_icon }}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
|
||||
|
||||
// New Section [Layout]
|
||||
$this->start_controls_section(
|
||||
'layout_section',
|
||||
[
|
||||
'label' => __( 'Layout', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
//Border Style
|
||||
$this->add_control(
|
||||
'border_style',
|
||||
[
|
||||
'label' => esc_html__( 'Border Style', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => 'solid',
|
||||
'options' => [
|
||||
'solid' => esc_html__( 'Solid', 'eagle' ),
|
||||
'dashed' => esc_html__( 'Dashed', 'eagle' ),
|
||||
'dotted' => esc_html__( 'Dotted', 'eagle' ),
|
||||
'double' => esc_html__( 'Double', 'eagle' ),
|
||||
'none' => esc_html__( 'None', 'eagle' ),
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a' => 'border-style: {{VALUE}} ;',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
// Margin Right
|
||||
$this->add_control(
|
||||
'spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Spacing', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 30,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a' => 'margin-right: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eth-social-media a:last-child' => 'margin-right: 0;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Border Width
|
||||
$this->add_control(
|
||||
'border_width', [
|
||||
'label' => __( 'Border Width', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Border Radius
|
||||
$this->add_control(
|
||||
'border_radius', [
|
||||
'label' => __( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Border Color
|
||||
$this->add_control(
|
||||
'border_color', [
|
||||
'label' => __( 'Border Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a' => 'border-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Border Color Hover
|
||||
$this->add_control(
|
||||
'border_color_hover', [
|
||||
'label' => __( 'Border Color Hover', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a:hover' => 'border-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Background Color
|
||||
$this->add_control(
|
||||
'background_color', [
|
||||
'label' => __( 'Background Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a' => 'background-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Background Color Hover
|
||||
$this->add_control(
|
||||
'background_color_hover', [
|
||||
'label' => __( 'Background Color Hover', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a:hover' => 'background-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Icon]
|
||||
$this->start_controls_section(
|
||||
'Icon_section',
|
||||
[
|
||||
'label' => __( 'Icon', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Icon Size
|
||||
$this->add_control(
|
||||
'width',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 17,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a i' => 'font-size: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .eth-social-media svg' => 'height: {{SIZE}}px;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Icon Color
|
||||
$this->add_control(
|
||||
'icon_color', [
|
||||
'label' => __( 'Icon Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a i' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Icon Color Hover
|
||||
$this->add_control(
|
||||
'icon_color_hover', [
|
||||
'label' => __( 'Icon Color Hover', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-social-media a i:hover' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
?>
|
||||
|
||||
<div class="eth-social-media">
|
||||
<?php
|
||||
|
||||
foreach ( $settings['social'] as $item ) :
|
||||
|
||||
if ( ! empty( $item['link']['url'] ) ) {
|
||||
$this->add_link_attributes( 'link', $item['link'] );
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo '<a ' .$this->get_render_attribute_string( 'link' ).'>' ?>
|
||||
|
||||
|
||||
<?php \Elementor\Icons_Manager::render_icon( $item['icon'], [ 'aria-hidden' => 'true' ] ); ?>
|
||||
|
||||
<?php if ( ! empty( $item['link']['url'] ) ) echo "</a>" ?>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$this->remove_render_attribute( 'link' );
|
||||
}
|
||||
endforeach ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
628
wp-content/plugins/eagle-core/eagle-elementor/widgets/staff.php
Normal file
628
wp-content/plugins/eagle-core/eagle-elementor/widgets/staff.php
Normal file
@@ -0,0 +1,628 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_STAFF extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_staff';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __('Eagle Staff', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-person';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'core' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new \Elementor\Repeater();
|
||||
|
||||
// Staff Name
|
||||
$repeater->add_control(
|
||||
'name', [
|
||||
'label' => __( 'Name', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'default' => __( 'Staff Name' , 'eagle' ),
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
// Staff Role
|
||||
$repeater->add_control(
|
||||
'role', [
|
||||
'label' => __( 'Role', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
// Desc
|
||||
$repeater->add_control(
|
||||
'description',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'rows' => 10,
|
||||
'default' => __( 'Default description', 'eagle' ),
|
||||
'placeholder' => __( 'Type your description here', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Image
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => __( 'Image', 'eagle' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$repeater->add_group_control(
|
||||
\Elementor\Group_Control_Image_Size::get_type(),
|
||||
[
|
||||
'name' => 'image_size',
|
||||
'exclude' => [],
|
||||
'include' => [],
|
||||
'default' => 'thumbnail',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'staff',
|
||||
[
|
||||
'label' => __( 'Items', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => esc_html__( 'Title #1', 'eagle' ),
|
||||
'content' => esc_html__( 'Item content. Click the edit button to change this text.', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => esc_html__( 'Title #2', 'eagle' ),
|
||||
'content' => esc_html__( 'Item content. Click the edit button to change this text.', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => esc_html__( 'Title #3', 'eagle' ),
|
||||
'content' => esc_html__( 'Item content. Click the edit button to change this text.', 'eagle' ),
|
||||
],
|
||||
[
|
||||
'title' => esc_html__( 'Title #4', 'eagle' ),
|
||||
'content' => esc_html__( 'Item content. Click the edit button to change this text.', 'eagle' ),
|
||||
],
|
||||
],
|
||||
'title' => '{{{ title }}}',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// New Section [Layout]
|
||||
$this->start_controls_section(
|
||||
'layout_section',
|
||||
[
|
||||
'label' => __( 'Layout', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'style',
|
||||
[
|
||||
'label' => esc_html__( 'Layout', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => 'grid',
|
||||
'options' => [
|
||||
'grid' => esc_html__( 'Grid', 'eagle' ),
|
||||
'carousel' => esc_html__( 'Carousel', 'eagle' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => __( 'Columns', 'eagle' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'devices' => [ 'desktop', 'tablet', 'mobile' ],
|
||||
'options' => [
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6'
|
||||
],
|
||||
|
||||
'desktop_default' => '4',
|
||||
'tablet_default' => '3',
|
||||
'mobile_default' => '1',
|
||||
]
|
||||
);
|
||||
|
||||
// Loop (Carousel)
|
||||
$this->add_control(
|
||||
'loop',
|
||||
[
|
||||
'label' => __( 'Loop', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'style',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'carousel',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Navigation (Carousel)
|
||||
$this->add_control(
|
||||
'navigation',
|
||||
[
|
||||
'label' => __( 'Navigation', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'style',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'carousel',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Vertical Spacing
|
||||
$this->add_control(
|
||||
'vertical_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Vertical Spacing', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 30,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .eth-staff' => 'row-gap: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Image]
|
||||
$this->start_controls_section(
|
||||
'Image_section',
|
||||
[
|
||||
'label' => __( 'Image', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Mouse Over Overlay Switch
|
||||
$this->add_control(
|
||||
'overlay',
|
||||
[
|
||||
'label' => __( 'Hover Overlay', 'eagle' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'True', 'eagle' ),
|
||||
'label_off' => __( 'False', 'eagle' ),
|
||||
'return_value' => 'true',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'background',
|
||||
'label' => __( 'Gradient Overlay', 'eagle' ),
|
||||
'types' => [ 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .staff-item figure:before',
|
||||
'conditions' => [
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'overlay',
|
||||
'operator' => 'in',
|
||||
'value' => [
|
||||
'true',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
//Border Radius Image
|
||||
$this->add_responsive_control(
|
||||
'border_img_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item figure img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Role]
|
||||
$this->start_controls_section(
|
||||
'role_section',
|
||||
[
|
||||
'label' => __( 'Role', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Role Color
|
||||
$this->add_control(
|
||||
'role_color', [
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item .position' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Role Background Color
|
||||
$this->add_control(
|
||||
'role_bg_color', [
|
||||
'label' => __( 'Background Color ', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item .position' => 'background: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
//Role Position Top
|
||||
$this->add_control(
|
||||
'role_position_top',
|
||||
[
|
||||
'label' => esc_html__( 'Position Top', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item .position' => 'top: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
//Role Position Left
|
||||
$this->add_control(
|
||||
'role_position_left',
|
||||
[
|
||||
'label' => esc_html__( 'Position Left', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item .position' => 'left: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
// Role Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'role_typography',
|
||||
'selector' => '{{WRAPPER}} .staff-item .position',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
//Role Border Radius
|
||||
$this->add_responsive_control(
|
||||
'role_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item .position' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
|
||||
// New Section [Title]
|
||||
$this->start_controls_section(
|
||||
'title_section',
|
||||
[
|
||||
'label' => __( 'Title', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Title Color
|
||||
$this->add_control(
|
||||
'title_color', [
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .details h5' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'heading_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
// Title Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .details h5',
|
||||
]
|
||||
);
|
||||
|
||||
// Color Description
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'color',
|
||||
'label' => esc_html__( 'Background', 'eagle' ),
|
||||
'types' => [ 'classic' ],
|
||||
'selector' => '{{WRAPPER}} .staff-item .details',
|
||||
]
|
||||
);
|
||||
|
||||
//Border Description
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'border',
|
||||
'label' => esc_html__( 'Border', 'eagle' ),
|
||||
'selector' => '{{WRAPPER}} .staff-item .details',
|
||||
'fields_options' => [
|
||||
'border' => [
|
||||
'default' => 'solid',
|
||||
],
|
||||
'width' => [
|
||||
'default' => [
|
||||
'top' => '0',
|
||||
'right' => '1',
|
||||
'bottom' => '1',
|
||||
'left' => '1',
|
||||
'isLinked' => false,
|
||||
],
|
||||
],
|
||||
'color' => [
|
||||
'default' => '#efefef',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
//Border Radius Description
|
||||
$this->add_responsive_control(
|
||||
'border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .staff-item .details' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// New Section [Description]
|
||||
$this->start_controls_section(
|
||||
'description_section',
|
||||
[
|
||||
'label' => __( 'Description', 'eagle' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
// Description Color
|
||||
$this->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => __( 'Color', 'eagle' ),
|
||||
'type' => \Elementor\Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .details p' => 'color: {{VALUE}}'
|
||||
],
|
||||
'default' => himara_get_option( 'body_text_color' ),
|
||||
]
|
||||
);
|
||||
|
||||
//Description Typography
|
||||
$this->add_group_control(
|
||||
\Elementor\Group_Control_Typography::get_type(),
|
||||
[
|
||||
'label' => __( 'Typography', 'eagle' ),
|
||||
'name' => 'description_typography',
|
||||
'selector' => '{{WRAPPER}} .details p',
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
|
||||
// Elementor Responsive Bug: Set default columns
|
||||
$desktop_cols = !empty( $settings['columns'] ) ? $settings['columns'] : 4;
|
||||
$tablet_cols = !empty( $settings['columns_tablet'] ) ? $settings['columns_tablet'] : 3;
|
||||
$mobile_cols = !empty( $settings['columns_mobile'] ) ? $settings['columns_mobile'] : 1;
|
||||
|
||||
?>
|
||||
<?php
|
||||
$class = '';
|
||||
$eb_unique_token = wp_generate_password(5, false, false);
|
||||
|
||||
if ( $settings['style'] === 'carousel' ) { ?>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
jQuery(function($) {
|
||||
|
||||
var owl = $('#staff-<?php echo esc_attr( $eb_unique_token ) ?>');
|
||||
|
||||
owl.owlCarousel({
|
||||
loop: <?php echo $settings['loop'] ? 'true' : 'false' ?>,
|
||||
margin: 30,
|
||||
nav: <?php echo $settings['navigation'] ? 'true' : 'false' ?>,
|
||||
dots: false,
|
||||
navText: [
|
||||
"<i class='ion-ios-arrow-back'></i>",
|
||||
"<i class='ion-ios-arrow-forward'></i>"
|
||||
],
|
||||
responsive: {
|
||||
|
||||
0: {
|
||||
items: <?php echo $mobile_cols ?>
|
||||
},
|
||||
|
||||
768: {
|
||||
items: <?php echo $tablet_cols ?>
|
||||
},
|
||||
|
||||
992: {
|
||||
items: <?php echo $desktop_cols ?>
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$class .= 'owl-carousel';
|
||||
} else {
|
||||
$class .= 'eth-staff row row-cols-lg-'.$desktop_cols.' '.'row-cols-md-'.$tablet_cols.' '.'row-cols-sm-'.$mobile_cols;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="staff-<?php echo esc_attr( $eb_unique_token ) ?>" class="<?php echo esc_attr($class)?>">
|
||||
|
||||
<?php
|
||||
|
||||
foreach ( $settings['staff'] as $item ) :
|
||||
|
||||
?>
|
||||
|
||||
<div class="staff-item">
|
||||
|
||||
<figure>
|
||||
<?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $item, 'image_size', 'image' ) ?>
|
||||
<span class="position"><?php echo esc_html( $item['role'] ) ?></span>
|
||||
</figure>
|
||||
|
||||
<div class="details">
|
||||
<h5><?php echo esc_html( $item['name'] ) ?></h5>
|
||||
<p><?php echo esc_html( $item['description'] ) ?></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
endforeach ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
112
wp-content/plugins/eagle-core/eagle-elementor/widgets/video.php
Normal file
112
wp-content/plugins/eagle-core/eagle-elementor/widgets/video.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
namespace ElementorEagleThemes\Widgets;
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Elementor Section Title Widget
|
||||
* Author: Eagle Themes
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
class EAGLE_VIDEO extends Widget_Base {
|
||||
|
||||
/* Retrieve the widget name. */
|
||||
public function get_name() {
|
||||
return 'eth_video';
|
||||
}
|
||||
|
||||
/* Retrieve the widget title. */
|
||||
public function get_title() {
|
||||
return __( 'Eagle Video PopUp', 'eagle' );
|
||||
}
|
||||
|
||||
/* Retrieve the widget icon. */
|
||||
public function get_icon() {
|
||||
return 'eicon-video-playlist';
|
||||
}
|
||||
|
||||
/* Retrieve the list of categories the widget belongs to.*/
|
||||
public function get_categories() {
|
||||
return [ 'eaglethemes' ];
|
||||
}
|
||||
|
||||
/*Retrieve the list of scripts the widget depended on. */
|
||||
public function get_script_depends() {
|
||||
return [ 'core' ];
|
||||
}
|
||||
|
||||
/* Register the widget controls. */
|
||||
protected function register_controls() {
|
||||
$this->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => __( 'Content', 'eagle' ),
|
||||
]
|
||||
);
|
||||
|
||||
// URL
|
||||
$this->add_control(
|
||||
|
||||
'url',
|
||||
[
|
||||
'label' => __( 'Video URL', 'eagle' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'placeholder' => __( 'Video URL', 'eagle' ),
|
||||
'show_external' => false,
|
||||
]
|
||||
|
||||
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'eagle' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'.mfp-iframe-holder .mfp-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
/* Render */
|
||||
protected function render() {
|
||||
$settings = $this->get_settings_for_display();
|
||||
?>
|
||||
<div class="video">
|
||||
<div class="container">
|
||||
<div class="video-popup">
|
||||
<a class="popup-video" href="<?php echo $settings['url']['url']; ?>">
|
||||
<i class="fa fa-play"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
/* Live Render */
|
||||
protected function content_template() {
|
||||
?>
|
||||
<div class="video">
|
||||
<div class="container">
|
||||
<div class="video-popup">
|
||||
<a class="popup-vimeo" href="{{ settings.video_url.url }}">
|
||||
<i class="fa fa-play"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user