Current File : /home/bravrvjk/cepurhuye.rw/wp-content/plugins/bopea-function/block//simple-text.php
<?php
namespace bopeaElementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Image_Size;
use Elementor\Group_Control_Typography;
use Elementor\Schemes\Color;
use Elementor\Schemes\Typography;
use Elementor\Utils;
use Elementor\Control_Media;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Group_Control_Background;
use Elementor\Repeater;
use Elementor\Icons_Manager;
defined('ABSPATH') || die();
class bopea_section_text extends Widget_Base {
public function get_name() {
return 'bopea-text';
}
public function get_title() {
return esc_html__( 'Simple Text', 'bopea-function' );
}
public function get_icon() {
return 'eicon-text jl-icons';
}
public function get_categories() {
return [ 'bopea-elements' ];
}
protected function register_controls() {
$this->start_controls_section(
'text_elements_settings',
[
'label' => __( 'Text Settings', 'bopea-function' ),
]
);
$this->add_control(
'tag',
[
'label' => __( 'HTML Tag', 'bopea-function' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'div' => 'div',
'span' => 'span',
'p' => 'p',
],
'default' => 'p',
]
);
$this->add_control(
'custom_text',
[
'label' => __( 'Text', 'bopea-function' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'default' => 'A beautifully designed multipurpose theme that comes with everything you need',
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style_title',
[
'label' => __( 'Text Style', 'bopea-function' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'alignment',
[
'label' => __( 'Alignment', 'bopea-function' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'bopea-function' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'bopea-function' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'bopea-function' ),
'icon' => 'eicon-text-align-right',
],
],
'default' => 'left',
'selectors' => [
'{{WRAPPER}}' => 'text-align: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'text_typography',
'label' =>esc_html__( 'Text typography', 'bopea-function' ),
'selector' => '{{WRAPPER}} .jlc-ctw > *',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'link_typography',
'label' =>esc_html__( 'Link typography', 'bopea-function' ),
'selector' => '{{WRAPPER}} .jlc-ctw > * a',
]
);
$this->add_control(
'text_color',
[
'label' => __( 'Text color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}}' => '--jl-ct-color: {{VALUE}}',
]
]
);
$this->add_control(
'text_color_dark',
[
'label' => __( 'Text color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}}' => '--jl-ct-color: {{VALUE}}',
]
]
);
$this->add_control(
'link_color',
[
'label' => __( 'Link color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}}' => '--jl-ct-lcolor: {{VALUE}}',
]
]
);
$this->add_control(
'link_color_dark',
[
'label' => __( 'Link color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}}' => '--jl-ct-lcolor: {{VALUE}}',
]
]
);
$this->add_control(
'link_color_h',
[
'label' => __( 'Link hover color', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}}' => '--jl-ct-lhcolor: {{VALUE}}',
]
]
);
$this->add_control(
'link_color_h_dark',
[
'label' => __( 'Link hover color dark mode', 'bopea-function' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'.options_dark_skin {{WRAPPER}}' => '--jl-ct-lhcolor: {{VALUE}}',
]
]
);
$this->end_controls_section();
}
protected function render( ) {
$settings = $this->get_settings_for_display();
$tag = $settings['tag'];
$custom_text = $settings['custom_text'];
?>
<div class="jlc-ctw">
<?php if (!empty($custom_text)) {?>
<<?php echo esc_html($tag); ?> class="jl-cust">
<?php echo wp_kses_post($custom_text); ?>
</<?php echo esc_html($tag); ?>>
<?php }?>
</div>
<?php
}
}