Your IP : 216.73.216.0


Current Path : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/
Upload File :
Current File : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/FancyBox.php

<?php

namespace Layerdrops\Zeinet\Widgets;


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

	public function get_title()
	{
		return __('Fancybox', 'zeinet-addon');
	}

	public function get_icon()
	{
		return 'eicon-cogs';
	}

	public function get_categories()
	{
		return ['zeinet-category'];
	}

	protected function register_controls()
	{
		$this->start_controls_section(
			'layout_section',
			[
				'label' => __('Layout', 'zeinet-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'layout_type',
			[
				'label' => __('Select Layout', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::SELECT2,
				'default' => 'layout_one',
				'options' => [
					'layout_one' => __('Layout One', 'zeinet-addon'),
					'layout_two' => __('Layout Two', 'zeinet-addon'),
				]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'layout_one_content_section',
			[
				'label' => __('Content', 'zeinet-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', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('Homepage 01', 'zeinet-addon'),
				'label_block' => true,
			]
		);

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

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

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

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

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

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

		$this->end_controls_section();

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

		$layout_two_item = new \Elementor\Repeater();

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

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

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

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

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

		$layout_two_item->add_control(
			'button_three_label',
			[
				'label' => __('Button Three Text', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('Dark Page', 'zeinet-addon'),
				'label_block' => true,
			]
		);

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

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

		$this->add_control(
			'layout_two_item',
			[
				'label' => __('Fancy Boxes', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'fields' => $layout_two_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', 'zeinet-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		zeinet_typo_and_color_options($this, 'Title', '{{WRAPPER}} .home-showcase__title,{{WRAPPER}} .demo-one__title a', ['layout_one', 'layout_two']);

		zeinet_typo_and_color_options($this, 'Button', '{{WRAPPER}} .home-showcase__buttons__item,{{WRAPPER}} a.thm-btn.thm-btn--home-four', ['layout_one', 'layout_two']);
		zeinet_typo_and_color_options($this, 'Button Background', '{{WRAPPER}} .home-showcase__buttons__item,{{WRAPPER}} a.thm-btn.thm-btn--home-four', ['layout_one', 'layout_two'], 'background-color', false);

		$this->add_control(
			'custom_class',
			[
				'label' => __('Custom Button Class', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => '',
				'label_block' => true,
			]
		);

		$this->end_controls_section();
	}

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