<?php
namespace ThemeAtelier\EventfulForElementor\Admin\Widgets\Options;

class EventfulForElementorDetailssettings
{
    /**
     * Content Detailsettings Options.
     */
    public static function ppfe_content_detailsettings_options($widget)
    {
        $widget->start_controls_section(
            'section_detailsettings',
            [
                'label'     => esc_html__('Detail Settings', 'eventful-for-elementor'),
            ]
        );

        $widget->add_control(
			'efpe_page_link_type',
			[
				'label'     => esc_html__( 'Detail Page Link Type', 'eventful-for-elementor' ),
				'type'      => \Elementor\Controls_Manager::SELECT,
				'options'   => [
					'single_page'   => esc_html__( 'Single Page', 'eventful-for-elementor' ),
					'none'          => esc_html__( 'None (no link action)', 'eventful-for-elementor' ),
				],
				'default'   => 'single_page',
			]
		);
        $widget->add_control(
			'efpe_link_target',
			[
				'label'     => esc_html__( 'Target', 'eventful-for-elementor' ),
				'type'      => \Elementor\Controls_Manager::SELECT,
				'options'   => [
					'_self'     => esc_html__( 'Current Tab', 'eventful-for-elementor' ),
					'_blank'    => esc_html__( 'New Tab', 'eventful-for-elementor' ),
					'_parent'   => esc_html__( 'Parent', 'eventful-for-elementor' ),
					'_top'      => esc_html__( 'Top', 'eventful-for-elementor' ),
				],
				'default'   => '_self',
                'condition' => [
                    'efpe_page_link_type' => 'single_page',
                ],
			]
		);

        $widget->add_control(
			'efpe_link_rel',
			[
				'label' 		=> esc_html__( 'Add rel="nofollow" to item links', 'eventful-for-elementor' ),
				'type' 			=> \Elementor\Controls_Manager::SWITCHER,
				'label_on' 		=> esc_html__( 'Show', 'eventful-for-elementor' ),
				'label_off' 	=> esc_html__( 'Hide', 'eventful-for-elementor' ),
				'return_value' 	=> 'yes',
			]
		);

        $widget->end_controls_section();
    }
}