%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/
Upload File :
Create Path :
Current File : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/ServiceDetails.php

<?php

namespace Layerdrops\Insur\Widgets;


class ServiceDetails extends \Elementor\Widget_Base
{
	public function get_name()
	{
		return 'insur-service-details';
	}

	public function get_title()
	{
		return __('Service Details', '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'),
				]
			]
		);

		$this->end_controls_section();

		//layout_one
		$this->start_controls_section(
			'layout_one_content_section',
			[
				'label' => __('Content', 'insur-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'conditions' => [
					'terms' => [
						[
							'name' => 'layout_type',
							'operator' => '==',
							'value' => 'layout_one'
						]
					]
				]
			]
		);

		$this->add_control(
			'layout_one_sec_title',
			[
				'label' => __('Section Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add title', 'insur-addon'),
				'default' =>  __('Default Title', 'insur-addon'),
			]
		);

		$this->add_control(
			'layout_one_sec_sub_title',
			[
				'label' => __('Section 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_sub_title_left_shape',
			[
				'label' => __('Sub Title Left Shape', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

		$this->add_control(
			'layout_one_sub_title_right_shape',
			[
				'label' => __('Sub Title Right Shape', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);


		$this->add_control(
			'layout_one_content',
			[
				'label' => __('Content', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add Content', 'insur-addon'),
				'default' =>  __('Default Content', 'insur-addon'),
			]
		);

		$layout_one_features = new \Elementor\Repeater();

		$layout_one_features->add_control(
			'title',
			[
				'label' => __('Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => __('Add Title', 'insur-addon'),
				'default' => __('Default Title', 'insur-addon'),
				'label_block' => true
			]
		);

		$layout_one_features->add_control(
			'summary',
			[
				'label' => __('Summary Text', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add Summary Text', 'insur-addon'),
				'default' => __('Default Summary Text', 'insur-addon')
			]
		);

		$layout_one_features->add_control(
			'icon',
			[
				'label' => __('Icon', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::ICONS,
				'default' => [
					'value' => 'icon-easy-to-use',
					'library' => 'custom-font',
				],
			]
		);

		$this->add_control(
			'layout_one_features',
			[
				'label' => __('Features', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'prevent_empty' => false,
				'fields' => $layout_one_features->get_controls(),
				'title_field' => '{{{ title }}}',
			]
		);


		$this->end_controls_section();


		$this->start_controls_section(
			'layout_two_content',
			[
				'label' => __('Content', 'insur-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'conditions' => [
					'terms' => [
						[
							'name' => 'layout_type',
							'operator' => '==',
							'value' => 'layout_two'
						]
					]
				]
			]
		);

		$this->add_control(
			'layout_two_sec_title',
			[
				'label' => __('Section Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add title', 'insur-addon'),
				'default' => __('We’re Cleaning for you Since 1987', 'insur-addon')
			]
		);

		$this->add_control(
			'layout_two_sec_sub_title',
			[
				'label' => __('Section Sub Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add Sub title', 'insur-addon'),
				'default' => __('Best Experts in Cleaning', 'insur-addon')
			]
		);

		$this->add_control(
			'layout_two_sub_title_left_shape',
			[
				'label' => __('Sub Title Left Shape', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

		$this->add_control(
			'layout_two_sub_title_right_shape',
			[
				'label' => __('Sub Title Right Shape', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);


		$layout_two_check_list = new \Elementor\Repeater();


		$layout_two_check_list->add_control(
			'title',
			[
				'label' => __('Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add  Title', 'insur-addon'),
				'default' => __('Room Entitlement & Annual Limits.', 'insur-addon')
			]
		);

		$layout_two_check_list->add_control(
			'icon',
			[
				'label' => __('Icon', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::ICONS,
				'default' => [
					'value' => 'fa fa-check',
					'library' => 'font-awesome',
				],
			]
		);

		$this->add_control(
			'layout_two_check_list',
			[
				'label' => __('Check List', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'fields' => $layout_two_check_list->get_controls(),
				'prevent_empty' => false,
				'title_field' => '{{{ title }}}',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_image_two',
			[
				'label' => __('Image', 'insur-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'conditions' => [
					'terms' => [
						[
							'name' => 'layout_type',
							'operator' => '==',
							'value' => 'layout_two'
						]
					]
				]
			]
		);


		$this->add_control(
			'layout_two_image_one',
			[
				'label' => __('Image', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => \Elementor\Utils::get_placeholder_image_src(),
				],
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'layout_three_content',
			[
				'label' => __('Content', 'insur-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'conditions' => [
					'terms' => [
						[
							'name' => 'layout_type',
							'operator' => '==',
							'value' => 'layout_three'
						]
					]
				]
			]
		);

		$this->add_control(
			'layout_three_sec_title',
			[
				'label' => __('Section Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add title', 'insur-addon'),
				'default' => __('Default Title', 'insur-addon')
			]
		);

		$this->add_control(
			'layout_three_summary',
			[
				'label' => __('Summary', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add Summary', 'insur-addon'),
				'default' => __('Default Summary', 'insur-addon')
			]
		);


		$this->add_control(
			'layout_three_button_label',
			[
				'label' => __('Button Text', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('Get Insured Now', 'insur-addon'),
				'label_block' => true,
			]
		);

		$this->add_control(
			'layout_three_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_three_call_number',
			[
				'label' => __('Call Number', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => __('Add Call Number', 'insur-addon'),
				'default' => __('+92 (003) 68-090', 'insur-addon'),
				'label_block' => true
			]
		);

		$this->add_control(
			'layout_three_call_url',
			[
				'label' => __('Call Url', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => __('Add Call Url', 'insur-addon'),
				'default' => '#',
				'label_block' => true
			]
		);

		$this->add_control(
			'layout_three_call_icon',
			[
				'label' => __('Call Icon', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::ICONS,
				'default' => [
					'value' => 'fas fa-phone',
					'library' => 'font-awesome',
				],
			]
		);

		$layout_three_features_list = new \Elementor\Repeater();

		$layout_three_features_list->add_control(
			'title',
			[
				'label' => __('Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add Feature Title', 'insur-addon'),
				'default' => __('Default Title', 'insur-addon')
			]
		);

		$layout_three_features_list->add_control(
			'summary',
			[
				'label' => __('Summary', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add Summary Text', 'insur-addon'),
				'default' => __('You to pay through multiple payment options, you can pay through', 'insur-addon')
			]
		);

		$layout_three_features_list->add_control(
			'checklist',
			[
				'label' => __('Check List', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::CODE,
				'placeholder' => __('Add Check List', 'insur-addon'),
				'default' => wp_kses(__('<li><div class="icon"><i class="fa fa-check"></i></div><div class="text"><p>Any Visa/Master Credit Card</p></div></li>', 'insur-addon'), 'insur_allowed_tags')
			]
		);

		$layout_three_features_list->add_control(
			'icon',
			[
				'label' => __('Icon', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::ICONS,
				'default' => [
					'value' => 'icon-computer',
					'library' => 'custom-icon',
				],
			]
		);

		$this->add_control(
			'layout_three_features_list',
			[
				'label' => __('Feature List', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'prevent_empty' => false,
				'fields' => $layout_three_features_list->get_controls(),
				'title_field' => '{{{ title }}}',
			]
		);

		$this->end_controls_section(); //end layout_three_content



		//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, {{WRAPPER}} .feature-four__top-title', ['layout_one', 'layout_two', 'layout_three']);
		insur_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-sub-title', ['layout_one', 'layout_two']);

		insur_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .feature-four__top-text', ['layout_three']);

		insur_typo_and_color_options($this, 'Check List', '{{WRAPPER}} .benefits-two__points li .text p', ['layout_two']);

		insur_typo_and_color_options($this, 'Content', '{{WRAPPER}} .why-choose-two__text', ['layout_one']);
		insur_typo_and_color_options($this, 'Feature Title', '{{WRAPPER}} .why-choose-two__list-title, {{WRAPPER}} .feature-four__title', ['layout_one', 'layout_three']);
		insur_typo_and_color_options($this, 'Feature Content', '{{WRAPPER}} .why-choose-two__list-text', ['layout_one']);
		insur_typo_and_color_options($this, 'Feature Summary', '{{WRAPPER}} .feature-four__text', ['layout_three']);
		insur_typo_and_color_options($this, 'Feature Check List', '{{WRAPPER}} .feature-four__points li .text p', ['layout_three']);

		insur_typo_and_color_options($this, 'Button', '{{WRAPPER}} .thm-btn', ['layout_three']);
		insur_typo_and_color_options($this, 'Button Background', '{{WRAPPER}} .thm-btn', ['layout_three'], 'background-color', false);

		$this->end_controls_section();
	}

	protected function render()
	{
		$settings = $this->get_settings_for_display();
		include insur_get_template('service-details-one.php');
		include insur_get_template('service-details-two.php');
		include insur_get_template('service-details-three.php');
	}
}

Zerion Mini Shell 1.0