%PDF- %PDF-
| Direktori : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/ |
| Current File : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/CallToAction.php |
<?php
namespace Layerdrops\Insur\Widgets;
class CallToAction extends \Elementor\Widget_Base
{
public function get_name()
{
return 'insur-call-to-action';
}
public function get_title()
{
return __('Call To Action', 'insur-addon');
}
public function get_icon()
{
return 'eicon-cogs';
}
public function get_categories()
{
return ['insur-category'];
}
protected function register_controls()
{
$this->start_controls_section(
'layout_section',
[
'label' => __('Layout', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'layout_type',
[
'label' => __('Select Layout', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SELECT2,
'default' => 'layout_one',
'options' => [
'layout_one' => __('Layout One', 'insur-addon'),
'layout_two' => __('Layout Two', 'insur-addon'),
'layout_three' => __('Layout Three', 'insur-addon'),
'layout_four' => __('Layout Four', 'insur-addon'),
'layout_five' => __('Layout Five', 'insur-addon'),
'layout_six' => __('Layout Six', 'insur-addon'),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_one'
]
]
);
$this->add_control(
'title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add Title', 'insur-addon'),
'default' => __('Default Title', 'insur-addon'),
]
);
$this->add_control(
'sub_title',
[
'label' => __('Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add Sub Title', 'insur-addon'),
'default' => __('Default Sub Title', 'insur-addon'),
]
);
$this->add_control(
'layout_one_icon',
[
'label' => __('Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-folder',
'library' => 'Custom Icon',
],
]
);
$this->add_control(
'button_label',
[
'label' => __('Button Text', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Trak Your Claim', 'insur-addon'),
'label_block' => true,
]
);
$this->add_control(
'button_url',
[
'label' => __('Button Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$this->add_control(
'shapes',
[
'label' => __('Background Shape One', 'insur-addon'),
'type' => \Elementor\Controls_Manager::GALLERY,
'default' => [],
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_two_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => ['layout_two', 'layout_three', 'layout_four', 'layout_five']
]
]
);
$this->add_control(
'layout_two_title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add Title', 'insur-addon'),
'default' => __('Find a local insurance agent ', 'insur-addon')
]
);
$this->add_control(
'layout_two_call_text',
[
'label' => __('Call Text', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Call to Our Experts', 'insur-addon'),
'label_block' => true,
]
);
$this->add_control(
'layout_two_call_number',
[
'label' => __('Call Number', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('+92 (003) 68-090', 'insur-addon'),
'label_block' => true,
]
);
$this->add_control(
'layout_two_call_url',
[
'label' => __('Call Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => '#',
'label_block' => true,
]
);
$this->add_control(
'layout_two_call_icon',
[
'label' => __('Call Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'placeholder' => __('Call Icon', 'insur-addon'),
'default' => [
'value' => 'fas fa-phone',
'library' => 'custom-icon',
]
]
);
$this->add_control(
'layout_two_button_label',
[
'label' => __('Button Label', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Get a Quote', 'insur-addon'),
'label_block' => true,
]
);
$this->add_control(
'layout_two_button_url',
[
'label' => __('Button Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$this->add_control(
'layout_two_background_image',
[
'label' => __('Background Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_four_top_shape',
[
'label' => __('Top Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
'condition' => [
'layout_type' => 'layout_four'
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_six_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_six'
]
]
);
$this->add_control(
'layout_six_text',
[
'label' => __('Text', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Don’t hesitate, contact us for better future life.', 'insur-addon'),
'label_block' => true,
]
);
$this->add_control(
'layout_six_button_label',
[
'label' => __('Button Text', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Get a Quote', 'insur-addon'),
'label_block' => true,
]
);
$this->end_controls_section();
//General style
$this->start_controls_section(
'general_style',
[
'label' => esc_html__('Style Options', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
insur_typo_and_color_options($this, 'Title', '{{WRAPPER}} .tracking__title, {{WRAPPER}} .cta-one__title', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Sub Title', '{{WRAPPER}} .tracking__sub-title', ['layout_one']);
insur_typo_and_color_options($this, 'Call Text', '{{WRAPPER}} .cta-one__call-number p', ['layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Call Number', '{{WRAPPER}} .cta-one__call-number a', ['layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Button', '{{WRAPPER}} .thm-btn, {{WRAPPER}} .thm-btn.cta-one__btn-1', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Button Background', '{{WRAPPER}} .thm-btn, {{WRAPPER}} .thm-btn.cta-one__btn-1', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five'], 'background-color', false);
$this->end_controls_section();
}
protected function render()
{
$settings = $this->get_settings_for_display();
include insur_get_template('call-to-action-one.php');
include insur_get_template('call-to-action-two.php');
include insur_get_template('call-to-action-three.php');
include insur_get_template('call-to-action-four.php');
include insur_get_template('call-to-action-five.php');
include insur_get_template('call-to-action-six.php');
}
}