File: /home/confeduphaar/www/wp-content/plugins/ova-framework/ova-elementor/widgets/ova_box_signature.php
<?php
namespace ova_framework\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Core\Schemes\Typography;
use Elementor\Group_Control_Typography;
use Elementor\Core\Schemes\Color;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class ova_box_signature extends Widget_Base {
public function get_name() {
return 'ova_box_signature';
}
public function get_title() {
return __( 'Feature Signature', 'ova-framework' );
}
public function get_icon() {
return 'eicon-posts-ticker';
}
public function get_categories() {
return [ 'ovatheme' ];
}
public function get_script_depends() {
return [ 'script-elementor' ];
}
protected function register_controls() {
$this->start_controls_section(
'section_heading_content',
[
'label' => __( 'Content', 'ova-framework' ),
]
);
$this->add_control(
'title',
[
'label' => __( 'Title', 'ova-framework' ),
'type' => Controls_Manager::TEXT,
'default' => __('47th mayor of Amon City, From on May 25 2018.','ova-framework'),
]
);
$this->add_control(
'excerpt',
[
'label' => __( 'Excerpt', 'ova-framework' ),
'type' => Controls_Manager::TEXTAREA,
'row' => 2,
'default' => __( 'We differentiate ourselves from all the other Australian VC by the fact that we come from startup and blockchain industry ourselves. We are tired of seeing that.','ova-framework' ),
]
);
$this->add_control(
'name',
[
'label' => __( 'Name', 'ova-framework' ),
'type' => Controls_Manager::TEXT,
'default' => __('- Andrew Simmons,','ova-framework'),
]
);
$this->add_control(
'job',
[
'label' => __( 'Job', 'ova-framework' ),
'type' => Controls_Manager::TEXT,
'default' => __('City Mayor,','ova-framework'),
]
);
$this->add_control(
'image_signature',
[
'label' => 'Image Signature',
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_content_style',
[
'label' => __( 'Content', 'ova-framework' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Background::get_type(),
[
'name' => 'content_background',
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .ova_box_signature',
]
);
$this->add_group_control(
\Elementor\Group_Control_Box_Shadow::get_type(),
[
'name' => 'content_box_shadow',
'selector' => '{{WRAPPER}} .ova_box_signature',
]
);
$this->add_group_control(
\Elementor\Group_Control_Border::get_type(),
[
'name' => 'border',
'selector' => '{{WRAPPER}} .ova_box_signature',
]
);
$this->add_control(
'content_border_radius',
[
'label' => esc_html__( 'Border Radius', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'content_padding',
[
'label' => esc_html__( 'Padding', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_title_style',
[
'label' => __( 'Title', 'ova-framework' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .ova_box_signature .title',
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ova_box_signature .title' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'title_margin',
[
'label' => esc_html__( 'Margin', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_excerpt_style',
[
'label' => __( 'Excerpt', 'ova-framework' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'excerpt_typography',
'selector' => '{{WRAPPER}} .ova_box_signature .excerpt',
]
);
$this->add_control(
'excerpt_color',
[
'label' => esc_html__( 'Excerpt Color', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ova_box_signature .excerpt' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'excerpt_margin',
[
'label' => esc_html__( 'Margin', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature .excerpt' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_name_style',
[
'label' => __( 'Name', 'ova-framework' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'name_typography',
'selector' => '{{WRAPPER}} .ova_box_signature .name-job .name',
]
);
$this->add_control(
'name_color',
[
'label' => esc_html__( 'Name Color', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ova_box_signature .name-job .name' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'name_margin',
[
'label' => esc_html__( 'Margin', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature .name-job .name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'name_job_margin',
[
'label' => esc_html__( 'Margin (Name and Job)', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature .name-job' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_job_style',
[
'label' => __( 'Job', 'ova-framework' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'job_typography',
'selector' => '{{WRAPPER}} .ova_box_signature .name-job .job',
]
);
$this->add_control(
'job_color',
[
'label' => esc_html__( 'Job Color', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ova_box_signature .name-job .job' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'job_margin',
[
'label' => esc_html__( 'Margin', 'ova-framework' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .ova_box_signature .name-job .job' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$title = $settings['title'];
$excerpt = $settings['excerpt'];
$name = $settings['name'];
$job = $settings['job'];
$image_signature = $settings['image_signature'];
?>
<div class="ova_box_signature">
<div class="box_signature">
<?php if( $title ){ ?>
<h3 class="title">
<?php echo $title ?>
</h3>
<?php } ?>
<?php if( $excerpt ){ ?>
<p class="excerpt">
<?php echo $excerpt ?>
</p>
<?php } ?>
<?php if( $name || $job ){ ?>
<div class="name-job">
<span class="name second_font"><?php echo esc_html( $name ) ?></span>
<span class="job"><?php echo esc_html( $job ) ?></span>
</div>
<?php } ?>
<?php if( $image_signature ){ ?>
<div class="image-signature">
<img src="<?php echo esc_attr( $image_signature['url'] ) ?>" alt="">
</div>
<?php } ?>
</div>
</div>
<?php
// end if version
}
}