%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/Tab.php |
<?php
namespace Layerdrops\Insur\Widgets;
class Tab extends \Elementor\Widget_Base
{
public function get_name()
{
return 'insur-tab';
}
public function get_title()
{
return __('Tab', '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'),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'sec_title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'sec_sub_title',
[
'label' => __('Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Sub Title', 'insur-addon'),
]
);
$this->add_control(
'sub_title_left_shape',
[
'label' => __('Sub Title Left Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'sub_title_right_shape',
[
'label' => __('Sub Title Right Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$tab = new \Elementor\Repeater();
$tab->add_control(
'title',
[
'label' => __('Tab Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Our Values', 'insur-addon'),
'label_block' => true,
]
);
$tab->add_control(
'summary',
[
'label' => __('Tab Summary', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Summary Text', 'insur-addon'),
'label_block' => true,
]
);
$tab->add_control(
'checklist',
[
'label' => __('Tab Check List', 'insur-addon'),
'type' => \Elementor\Controls_Manager::CODE,
'default' => wp_kses(__('<li><div class="icon"><i class="fa fa-check"></i></div><div class="text"><p>Payment at Contingency</p></div></li>', 'insur-addon'), 'insur_allowed_tags'),
]
);
$tab->add_control(
'icon',
[
'label' => __('Tab Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-mission',
'library' => 'custom-icon',
],
]
);
$tab->add_control(
'image',
[
'label' => __('Tab Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$tab->add_control(
'image_shape',
[
'label' => __('Tab Image Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$tab->add_control(
'active_status',
[
'label' => __('Is active?', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SWITCHER,
'label_on' => __('Yes', 'insur-addon'),
'label_off' => __('No', 'insur-addon'),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'tab',
[
'label' => __('Tab Items', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $tab->get_controls(),
'prevent_empty' => false,
'title_field' => '{{{ title }}}',
]
);
$this->add_control(
'bg_image',
[
'label' => __('Section Background image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$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, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one']);
insur_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-sub-title', ['layout_one']);
insur_typo_and_color_options($this, 'Tab Active Button Title', '{{WRAPPER}} .we-provide__tab-box .tab-buttons .tab-btn.active-btn span', ['layout_one']);
insur_typo_and_color_options($this, 'Tab Active Button Background', '{{WRAPPER}} .we-provide__tab-box .tab-buttons .tab-btn span:before', ['layout_one'], 'background-color', false);
insur_typo_and_color_options($this, 'Tab Button Title', '{{WRAPPER}} .we-provide__tab-box .tab-buttons .tab-btn span', ['layout_one']);
insur_typo_and_color_options($this, 'Tab Title', '{{WRAPPER}} .we-provide__tab-main-content-title', ['layout_one']);
insur_typo_and_color_options($this, 'Tab Summary', '{{WRAPPER}} .we-provide__tab-main-content-text', ['layout_one']);
insur_typo_and_color_options($this, 'Check List', '{{WRAPPER}} .we-provide__tab-main-content-points li .text p', ['layout_one']);
$this->end_controls_section();
}
protected function render()
{
$settings = $this->get_settings_for_display();
include insur_get_template('tab-one.php');
}
}