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/Features.php

<?php

namespace Layerdrops\Zeinet\Widgets;


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

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

		//layout_one
		$this->start_controls_section(
			'layout_one_content',
			[
				'label' => __('Content', 'zeinet-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', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __('Add title', 'zeinet-addon'),
				'default' =>  __('Default Title', 'zeinet-addon'),
			]
		);

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

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

		$layout_one_features_list = new \Elementor\Repeater();

		$layout_one_features_list->add_control(
			'title',
			[
				'label' => __('Text', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::TEXT,
				'default' => __('Installation', 'zeinet-addon'),
				'label_block' => true
			]
		);

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

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

		$this->add_control(
			'layout_one_bg_shape_one',
			[
				'label' => __('Background Shape One', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

		$this->add_control(
			'layout_one_bg_shape_two',
			[
				'label' => __('Background Shape Two', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

		$this->end_controls_section();

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


		$layout_two_features_list = new \Elementor\Repeater();

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

		$layout_two_features_list->add_control(
			'url',
			[
				'label' => __('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_features_list->add_control(
			'summary',
			[
				'label' => __('Summary', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'default' => __('Add Summary Text', 'zeinet-addon'),
				'label_block' => true
			]
		);

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

		$layout_two_features_list->add_control(
			'bg_shape',
			[
				'label' => __('Background Shape', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

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

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

		$this->add_control(
			'layout_two_shape',
			[
				'label' => __('Shape ', 'zeinet-addon'),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [],
			]
		);

		$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, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one']);
		zeinet_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline', ['layout_one']);

		zeinet_typo_and_color_options($this, 'Features Title', '{{WRAPPER}} .why-choose-one__title,{{WRAPPER}} .feature-four__single__title a', ['layout_one', 'layout_two']);
		zeinet_typo_and_color_options($this, 'Summary Text', '{{WRAPPER}} .why-choose-one__text,{{WRAPPER}} .feature-four__single__text', ['layout_one', 'layout_two']);

		$this->end_controls_section();
	}

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