%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/FancyBox.php

<?php

namespace Layerdrops\Insur\Widgets;


class FancyBox extends \Elementor\Widget_Base
{
	public function get_name()
	{
		return 'insur-fancybox';
	}

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

		$this->end_controls_section();

		$this->start_controls_section(
			'layout_one_content_section',
			[
				'label' => __('Content', 'insur-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'condition' => [
					'layout_type' => ['layout_one']
				]
			]
		);

		$layout_one_item = new \Elementor\Repeater();

		$layout_one_item->add_control(
			'title',
			[
				'label' => __('Title', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('Homepage 01', 'insur-addon'),
				'label_block' => true,
			]
		);

		$layout_one_item->add_control(
			'button_one_label',
			[
				'label' => __('Button One Text', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('Multi Page', 'insur-addon'),
				'label_block' => true,
			]
		);

		$layout_one_item->add_control(
			'button_one_url',
			[
				'label' => __('Button One Url', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::URL,
				'placeholder' => __('#', 'insur-addon'),
				'show_external' => true,
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true,
				],
				'show_label' => false,
			]
		);

		$layout_one_item->add_control(
			'button_two_label',
			[
				'label' => __('Button One Text', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('One Page', 'insur-addon'),
				'label_block' => true,
			]
		);

		$layout_one_item->add_control(
			'button_two_url',
			[
				'label' => __('Button Two Url', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::URL,
				'placeholder' => __('#', 'insur-addon'),
				'show_external' => true,
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true,
				],
				'show_label' => false,
			]
		);

		$layout_one_item->add_control(
			'image',
			[
				'label' => __('Image', 'insur-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

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

		$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}} .home-showcase__title', 'layout_one');

		insur_typo_and_color_options($this, 'Button', '{{WRAPPER}} .home-showcase__buttons__item', 'layout_one');
		insur_typo_and_color_options($this, 'Button Background', '{{WRAPPER}} .home-showcase__buttons__item', 'layout_one', 'background-color', false);

		$this->end_controls_section();
	}

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

Zerion Mini Shell 1.0