<?php
/**
* Elementor Single Widget
* @package Prinox Tools
* @since 1.0.0
*/
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
class Prinox_About extends Widget_Base {
/**
* Get widget name.
*
* Retrieve Elementor widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'prionx-about-id';
}
/**
* Get widget title.
*
* Retrieve Elementor widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return esc_html__( 'Prinox About', 'prinox-tools' );
}
/**
* Get widget icon.
*
* Retrieve Elementor widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'mg-custom-icon';
}
/**
* Get widget categories.
*
* Retrieve the list of categories the Elementor widget belongs to.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'prinox_widgets' ];
}
protected function register_controls() {
$this->start_controls_section(
'prinox_about_option',
[
'label' => esc_html__( 'About Option', 'prinox-tools' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'shape', [
'label' => esc_html__( 'Shape Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape2', [
'label' => esc_html__( 'Shape2 Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape3', [
'label' => esc_html__( 'Shape 3 Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape4', [
'label' => esc_html__( 'Shape 4 Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'business_1', [
'label' => esc_html__( 'Business Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'business_2', [
'label' => esc_html__( 'Business 2 Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'business_3', [
'label' => esc_html__( 'Business 3 Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'print_icon', [
'label' => esc_html__( 'Print Icon Image', 'prinox-tools' ),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'sub_title', [
'label' => esc_html__( 'Sub Title', 'prinox-tools' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'title-bg',
'label' => esc_html__( 'Background', 'plugin-name' ),
'types' => [ 'classic' ],
'exclude' => [ 'color' ],
'selector' => '{{WRAPPER}} .sec-title h2 span:before',
]
);
$this->add_control(
'title', [
'label' => esc_html__( 'Title', 'prinox-tools' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$this->add_control(
'description', [
'label' => esc_html__( 'Title', 'prinox-tools' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$repeater = new Repeater();
$repeater->add_control(
'icon', [
'label' => esc_html__( 'Icon', 'prinox-tools' ),
'type' => Controls_Manager::ICONS,
'label_block' => true,
]
);
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'prinox-tools' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$repeater->add_control(
'description', [
'label' => esc_html__( 'Description', 'prinox-tools' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$this->add_control(
'features',
[
'label' => esc_html__( 'Add New Features Item', 'prinox-tools' ),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
]
);
$repeater = new Repeater();
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'prinox-tools' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_control(
'listitem',
[
'label' => esc_html__( 'Add New List Item', 'prinox-tools' ),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
]
);
$this->add_control(
'authore_info', [
'label' => esc_html__( 'Authore Info', 'prinox-tools' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
]
);
$this->end_controls_section();
$this->start_controls_section(
'about_style',
[
'label' => __( 'About Style', 'prinox-tools' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'subtitle_color',
[
'label' => esc_html__( 'Sub Title Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .sec-title .title' => 'color: {{VALUE}} ',
],
]
);
$this->add_control(
'subtitle_bg_color',
[
'label' => esc_html__( 'Sub Title BG Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .sec-title .title:before' => 'background-color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'subtitle_typography',
'label' => esc_html__( 'Sub Title Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .sec-title .title',
]
);
$this->add_control(
'title_h',
[
'type' => Controls_Manager::HEADING,
'label' => esc_html__( 'Title', 'prinox-tools' ),
'separator' => 'before',
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .sec-title h2' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => esc_html__( 'Title Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .sec-title h2',
]
);
$this->add_control(
'content_h',
[
'type' => Controls_Manager::HEADING,
'label' => esc_html__( 'Content', 'prinox-tools' ),
'separator' => 'before',
]
);
$this->add_control(
'content_color',
[
'label' => esc_html__( 'Content Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .sec-title .text' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'content_typography',
'label' => esc_html__( 'Content Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .sec-title .text',
]
);
$this->end_controls_section();
$this->start_controls_section(
'feature_block_style',
[
'label' => __( 'Feature Block', 'prinox-tools' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'icon_color',
[
'label' => esc_html__( 'Icon Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .feature-block .icon svg path' => 'fill: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'icon_bg_color',
'label' => esc_html__( 'Background', 'prinox-tools' ),
'types' => [ 'classic', 'gradient'],
'exclude' => [
'image',
],
'selector' => '{{WRAPPER}} .feature-block .icon',
]
);
$this->add_control(
'f_title_h',
[
'type' => Controls_Manager::HEADING,
'label' => esc_html__( 'Title', 'prinox-tools' ),
'separator' => 'before',
]
);
$this->add_control(
'f_title_color',
[
'label' => esc_html__( 'Title Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .feature-block .inner-box h6' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'f_title_typography',
'label' => esc_html__( 'Title Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .sec-title .text',
]
);
$this->add_control(
'f_content_h',
[
'type' => Controls_Manager::HEADING,
'label' => esc_html__( 'Content', 'prinox-tools' ),
'separator' => 'before',
]
);
$this->add_control(
'f_content_color',
[
'label' => esc_html__( 'Content Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .feature-block .feature-text' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'f_content_typography',
'label' => esc_html__( 'Content Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .feature-block .feature-text',
]
);
$this->end_controls_section();
$this->start_controls_section(
'feature_list_style',
[
'label' => __( 'Feature List', 'prinox-tools' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'f_list_color',
[
'label' => esc_html__( 'List Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .business-section .options-list li' => 'color: {{VALUE}} ',
],
]
);
$this->add_control(
'f_list_icon_color',
[
'label' => esc_html__( 'List Icon Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .business-section .options-list li::before' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'f_lsit_typography',
'label' => esc_html__( 'Content Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .business-section .options-list li',
]
);
$this->end_controls_section();
$this->start_controls_section(
'info_style',
[
'label' => __( 'Author Info', 'prinox-tools' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'i_name_color',
[
'label' => esc_html__( 'Author Info Color', 'prinox-tools' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .business-section .author-info' => 'color: {{VALUE}} ',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'author_typography',
'label' => esc_html__( 'Author Info Typography', 'prinox-tools' ),
'selector' => '{{WRAPPER}} .business-section .author-info',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
?>
<!-- Business Section -->
<section class="business-section">
<div class="small-circle-layer"></div>
<?php if(!empty($settings['shape']['url'])):?>
<div class="vector-layer-one" style="background-image: url(<?php echo esc_url($settings['shape']['url']);?>)"></div>
<?php endif;?>
<?php if(!empty($settings['shape2']['url'])):?>
<div class="vector-layer-two" style="background-image: url(<?php echo esc_url($settings['shape2']['url']);?>)"></div>
<?php endif;?>
<?php if(!empty($settings['shape3']['url'])):?>
<div class="vector-layer-three" style="background-image: url(<?php echo esc_url($settings['shape3']['url']);?>)"></div>
<?php endif;?>
<div class="auto-container">
<div class="row clearfix">
<!-- Images Column -->
<div class="images-column col-lg-6 col-md-12 col-sm-12">
<div class="inner-column">
<?php if(!empty($settings['shape4']['url'])):?>
<div class="circle-layer" style="background-image: url(<?php echo esc_url($settings['shape4']['url']);?>)"></div>
<?php endif;?>
<div class="images-outer parallax-scene-1">
<?php if(!empty($settings['business_1']['url'])):?>
<div class="image" data-depth="0.20">
<img src="<?php echo esc_url($settings['business_1']['url']);?>" alt="<?php echo esc_attr($settings['business_1']['alt']);?>" />
</div>
<?php endif;?>
<?php if(!empty($settings['business_2']['url'])):?>
<div class="image-two" data-depth="0.30">
<img src="<?php echo esc_url($settings['business_2']['url']);?>" alt="<?php echo esc_attr($settings['business_2']['alt']);?>" />
</div>
<?php endif;?>
<?php if(!empty($settings['business_3']['url'])):?>
<div class="image-three" data-depth="0.70">
<img src="<?php echo esc_url($settings['business_3']['url']);?>" alt="<?php echo esc_attr($settings['business_3']['alt']);?>" />
</div>
<?php endif;?>
</div>
<?php if(!empty($settings['print_icon']['url'])):?>
<div class="print-icon">
<img src="<?php echo esc_url($settings['print_icon']['url']);?>" alt="<?php echo esc_attr($settings['print_icon']['alt']);?>" />
</div>
<?php endif;?>
</div>
</div>
<!-- Content Column -->
<div class="content-column col-lg-6 col-md-12 col-sm-12">
<div class="inner-column">
<!-- Sec Title -->
<div class="sec-title">
<?php if(!empty($settings['sub_title'])):?>
<div class="title"><?php echo wp_kses( $settings['sub_title'], true )?></div>
<?php endif;?>
<?php if(!empty($settings['title'])):?>
<h2><?php echo wp_kses( $settings['title'], true );?></h2>
<?php endif;?>
<?php if(!empty($settings['description'])):?>
<div class="text"><?php echo wp_kses( $settings['description'], true );?></div>
<?php endif;?>
</div>
<div class="row clearfix">
<?php foreach($settings['features'] as $item):?>
<!-- Feature Block -->
<div class="feature-block col-lg-6 col-md-6 col-sm-12">
<div class="inner-box">
<span class="icon"><?php \Elementor\Icons_Manager::render_icon( $item['icon'], [ 'aria-hidden' => 'true' ] ); ?></span>
<h6><?php echo wp_kses( $item['title'], true );?></h6>
<div class="feature-text"><?php echo wp_kses( $item['description'], true );?></div>
</div>
</div>
<?php endforeach;?>
</div>
<!-- Options List -->
<ul class="options-list">
<?php foreach($settings['listitem'] as $list):?>
<li><?php echo wp_kses( $list['title'], true )?></li>
<?php endforeach;?>
</ul>
<?php if(!empty($settings['authore_info'])):?>
<!-- Author Info -->
<div class="author-info">
<?php echo wp_kses( $settings['authore_info'], true );?>
</div>
<?php endif;?>
</div>
</div>
</div>
</div>
</section>
<!-- End Business Section -->
<?php
}
}
Plugin::instance()->widgets_manager->register( new Prinox_About() );